Index: BlobExplorer.cpp ================================================================== --- BlobExplorer.cpp +++ BlobExplorer.cpp @@ -2,11 +2,11 @@ / BlobExplorer.cpp / a dialog to explore a BLOB value / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -74,10 +74,12 @@ unsigned char sample_type; unsigned char pixel_type; unsigned char num_bands; if (BlobType == GAIA_GEOMETRY_BLOB) + Geometry = gaiaFromSpatiaLiteBlobWkb(Blob, BlobSize); + else if (BlobType == GAIA_TINYPOINT_BLOB) Geometry = gaiaFromSpatiaLiteBlobWkb(Blob, BlobSize); else if (BlobType == GAIA_GPB_BLOB) Geometry = gaiaFromGeoPackageGeometryBlob(Blob, BlobSize); else if (BlobType == GAIA_XML_BLOB) { @@ -314,11 +316,12 @@ return false; wxBookCtrlBase *book = GetBookCtrl(); // creates individual panels wxPanel *hexadecimal = CreateHexadecimalPage(book); book->AddPage(hexadecimal, wxT("Hexadecimal dump"), true); - if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_GPB_BLOB) + if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_TINYPOINT_BLOB + || BlobType == GAIA_GPB_BLOB) { wxPanel *geometry = CreateGeometryPage(book); book->AddPage(geometry, wxT("Geometry explorer"), false); wxPanel *wkt = CreateWKTPage(book); book->AddPage(wkt, wxT("WKT"), false); @@ -1081,11 +1084,12 @@ { case 0: UpdateHexadecimalPage(); break; case 1: - if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_GPB_BLOB) + if (BlobType == GAIA_GEOMETRY_BLOB || BlobType == GAIA_TINYPOINT_BLOB + || BlobType == GAIA_GPB_BLOB) UpdateGeometryPage(); else if (BlobType == GAIA_XML_BLOB) UpdateXmlDocumentPage(); else UpdateImagePage(); Index: Classdef.h ================================================================== --- Classdef.h +++ Classdef.h @@ -2,11 +2,11 @@ / Classdef.h / class definitions for spatialite_gui - a SQLite /SpatiaLite GUI tool / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -31,10 +31,11 @@ #include "wx/textctrl.h" #include "wx/propdlg.h" #include "wx/generic/propdlg.h" #include "wx/timer.h" #include "wx/string.h" +#include "wx/dynlib.h" #include "config.h" #ifdef SPATIALITE_AMALGAMATION #include @@ -48,25 +49,16 @@ #include #include #include #include +#include #include #include #include "rasterlite2/rl2graphics.h" -// -// functions for QSORT / BSEARCH -// -int cmp_prenodes_code(const void *p1, const void *p2); -int cmp_prenodes_id(const void *p1, const void *p2); -int cmp_nodes2_code(const void *p1, const void *p2); -int cmp_nodes2_id(const void *p1, const void *p2); -int cmp_nodes1_code(const void *p1, const void *p2); -int cmp_nodes1_id(const void *p1, const void *p2); - // // functions for threaded queries // int SqlProgressCallback(void *arg); #if defined(__WIN32) && !defined(__MINGW32__) @@ -151,10 +143,11 @@ ID_LoadXml, ID_Srids, ID_Charset, ID_Help, ID_Attach, + ID_Postgres, ID_SqlLog, ID_DbStatus, ID_CheckGeom, ID_SaneGeom, ID_WFS, @@ -274,15 +267,22 @@ Tree_MapHideAll, Tree_MapConfigure, Tree_MapVisible, Tree_MapFullExtent, Tree_MapLayerFullExtent, + Tree_SqlSample, + Tree_UrlSample, Tree_MapLayerConfigure, Tree_MapLayerInfo, Tree_QuickStyleEdit, Tree_MapRemoveLayer, Tree_MapDeleteItem, + Tree_CreatePostgreSqlConn, + Tree_CloseAllPostgreSqlConns, + Tree_ClosePostgreSqlConn, + Tree_PostgreSqlDropOrphans, + Tree_PostgreSqlInfos, Grid_Clear, Grid_All, Grid_Column, Grid_Row, Grid_Copy, @@ -440,10 +440,11 @@ ID_NET_NAME_ENABLE, ID_NET_NAME, ID_NET_A_STAR, ID_NET_DATA, ID_NET_VIRTUAL, + ID_NET_OVERWRITE, ID_EXIF_PATH, ID_EXIF_FOLDER, ID_EXIF_METADATA, ID_EXIF_GPS_ONLY, ID_GPS_PICS_PATH, @@ -761,10 +762,11 @@ ID_RASTER_KEYWORD_GRID, ID_SYMBOLIZER_NAME, ID_SYMBOLIZER_TITLE, ID_SYMBOLIZER_ABSTRACT, ID_SYMBOLIZER_OPACITY, + ID_SYMBOLIZER_BAND_MODE, ID_SYMBOLIZER_RED, ID_SYMBOLIZER_GREEN, ID_SYMBOLIZER_BLUE, ID_SYMBOLIZER_GRAY, ID_SYMBOLIZER_CONTRAST, @@ -991,10 +993,17 @@ ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, + ID_SYMBOLIZER_COLOR_MAP_MODE, + ID_SYMBOLIZER_MIN_COLOR, + ID_SYMBOLIZER_MIN_PICKER_HEX, + ID_SYMBOLIZER_MIN_PICKER_BTN, + ID_SYMBOLIZER_MAX_COLOR, + ID_SYMBOLIZER_MAX_PICKER_HEX, + ID_SYMBOLIZER_MAX_PICKER_BTN, ID_WMS_URL, ID_WMS_CATALOG, ID_WMS_RESET, ID_WMS_SERVER, ID_WMS_VERSION, @@ -1026,10 +1035,14 @@ ID_VECTOR_LAYER, ID_VECTOR_TYPE, ID_VECTOR_UUID, ID_VECTOR_STYLE, ID_VECTOR_OK, + ID_VECTOR_COPY, + ID_MIME_TYPE, + ID_IMAGE_QUALITY, + ID_SQL_SAMPLE, ID_TOPOGEO_LAYER, ID_TOPOGEO_SRID, ID_TOPOGEO_STYLE, ID_TOPOGEO_FACE, ID_TOPOGEO_EDGE, @@ -1094,12 +1107,23 @@ ID_QUICK_STYLE_COPY, ID_PANE_POINT, ID_PANE_LINE, ID_PANE_POLYGON, ID_PANE_TEXT, + ID_PANE_CONTRAST_ENHANCEMENT, + ID_PANE_CHANNEL_SELECTION, + ID_PANE_COLOR_MAP, ID_PAINT_MAP_STEP, - ID_PAINT_MAP_THREAD_FINISHED + ID_PAINT_MAP_THREAD_FINISHED, + ID_POSTGRES_HOST, + ID_POSTGRES_HOSTADDR, + ID_POSTGRES_PORT, + ID_POSTGRES_DBNAME, + ID_POSTGRES_USER, + ID_POSTGRES_PASSWORD, + ID_POSTGRES_RDONLY, + ID_POSTGRES_TEXTDATES }; enum { // tree item data types @@ -1109,10 +1133,11 @@ MY_ROOT_TOPOLOGIES, MY_ROOT_NETWORKS, MY_ROOT_RASTER, MY_ROOT_VECTOR, MY_ROOT_WMS, + MY_ROOT_POSTGRESQL, MY_ROOT_STYLING, MY_ROOT_METADATA, MY_ROOT_INTERNAL, MY_ROOT_RTREE, MY_TABLE, @@ -1156,11 +1181,18 @@ MY_INT_VARIANT, MY_DBL_VARIANT, MY_TXT_VARIANT, MY_BLOB_VARIANT, MY_NULL_VARIANT, - MY_UNDEFINED + MY_UNDEFINED, + MY_POSTGRES_CONN, + MY_POSTGRES_SCHEMA, + MY_POSTGRES_TABLE, + MY_POSTGRES_VIEW, + MY_POSTGIS_VIEW, + MY_POSTGRES_COLUMN, + MY_POSTGIS_GEOMETRY }; enum { // control IDs for timers @@ -1366,18 +1398,43 @@ wxString DbAlias; // the DB alias [Attached DB] wxString MainName; // the object name [usually: table name] wxString ColName; // the column name [optional] wxString PathOrURL; // the Path or request URL [optional] bool Restricted; // not editable +// PostgreSQL specific + wxString Host; + wxString HostAddr; + int Port; + wxString DbName; + wxString User; + wxString Schema; + wxString Name; + wxString Column; + wxString VirtName; + bool ReadOnly; + bool PK; + bool Select; + bool InsertUpdateDelete; public: MyObject(int type); MyObject(int type, wxString & dbAlias); MyObject(int type, wxString & dbAlias, wxString & name, bool restricted = false); MyObject(int type, wxString & dbAlias, wxString & name, wxString & column); MyObject(int type, wxString & dbAlias, wxString & name, wxString & column, wxString & path_or_url); + MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly); + MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema); + MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema, + wxString & name, wxString & virtname, bool readOnly, bool pk, + bool select, bool insertUpdateDelete); + MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema, + wxString & name, wxString & column, wxString & virtname); virtual ~ MyObject() {; } int GetType() { @@ -1401,10 +1458,62 @@ } wxString & GetPathOrURL() { return PathOrURL; } + wxString & GetHost() + { + return Host; + } + wxString & GetHostAddr() + { + return HostAddr; + } + int GetPort() + { + return Port; + } + wxString & GetDbName() + { + return DbName; + } + wxString & GetUser() + { + return User; + } + wxString & GetSchema() + { + return Schema; + } + wxString & GetName() + { + return Name; + } + wxString & GetColumn() + { + return Column; + } + wxString & GetVirtName() + { + return VirtName; + } + bool IsReadOnly() + { + return ReadOnly; + } + bool HasPK() + { + return PK; + } + bool CanSelect() + { + return Select; + } + bool CanInsertUpdateDelete() + { + return InsertUpdateDelete; + } bool IsTable(); bool IsView(); bool IsTemporary(); bool IsEditable(); bool IsAttachedDB(); @@ -1426,10 +1535,11 @@ bool IsTrigger(); bool IsPrimaryKey(); bool IsPrimaryKeyColumn(); bool IsForeignKey(); bool IsForeignKeyColumn(); + bool IsPostgreSQL(); }; class MyColumnInfo { // @@ -2481,10 +2591,11 @@ wxTreeItemId RootRasterCoverages; wxTreeItemId RootVectorCoverages; wxTreeItemId RootStyling; wxTreeItemId RootWMS; wxTreeItemId RootIsoMetadata; + wxTreeItemId RootPostgreSQL; TopoGeoList Topologies; TopoNetList Networks; RasterCoverageList RasterCoverages; VectorCoverageList VectorCoverages; WmsLayerList WmsLayers; @@ -2504,17 +2615,20 @@ wxString CurrentWmsLayerName; void ExpandTable(wxTreeItemId & item); void ExpandView(wxTreeItemId & item); void ExpandAttachedTable(wxTreeItemId & item); void ExpandAttachedView(wxTreeItemId & item); + void ExpandPostgresTable(wxTreeItemId & item); + void ExpandPostGisView(wxTreeItemId & item); // context menus void DoRootRasterCoveragesContextMenu(wxPoint & pt); void DoRootVectorCoveragesContextMenu(wxPoint & pt); void DoRootWmsLayersContextMenu(wxPoint & pt); void DoRootTopoGeoContextMenu(wxPoint & pt); void DoRootTopoNetContextMenu(wxPoint & pt); void DoRootStylingContextMenu(wxPoint & pt); + void DoRootPostgreSqlContextMenu(wxPoint & pt); void DoRootOthersContextMenu(wxPoint & pt, MyObject * obj); void DoAttachedDbContextMenu(wxPoint & pt, MyObject * obj); void DoRootAttachedContextMenu(wxPoint & pt, MyObject * obj); void DoGenericAttachedContextMenu(wxPoint & pt, wxString & title); void DoTopoGeoContextMenu(wxPoint & pt, wxString & name); @@ -2547,10 +2661,18 @@ void DoAttachedPrimaryKeyColumnContextMenu(wxPoint & pt, MyObject * obj); void DoMainForeignKeyContextMenu(wxPoint & pt, MyObject * obj); void DoAttachedForeignKeyContextMenu(wxPoint & pt, MyObject * obj); void DoMainForeignKeyColumnContextMenu(wxPoint & pt, MyObject * obj); void DoAttachedForeignKeyColumnContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgreSqlContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgresConnContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgresSchemaContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgresTableContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgresViewContextMenu(wxPoint & pt, MyObject * obj); + void DoPostGisViewContextMenu(wxPoint & pt, MyObject * obj); + void DoPostgresColumnContextMenu(wxPoint & pt, MyObject * obj); + void DoPostGisGeometryContextMenu(wxPoint & pt, MyObject * obj); public: MyTableTree() {; } MyTableTree(MyFrame * parent, wxWindowID id = wxID_ANY); @@ -2581,10 +2703,11 @@ wxTreeItemId & GetAltRootNode(wxString & tableName, RootNodes * nodes, bool * tile_data); void AddTable(wxString & tableName, bool virtualTable, bool geometry); void AddTable(wxString & dbAlias, wxString & tableName, bool virtualTable, bool geometry); + void AddTmpMetadata(wxString & tableName); void AddGeoPackageTable(wxString & tableName); void AddGeoPackageTable(wxString & dbAlias, wxString & tableName, RootNodes * nodes); void AddGeoPackageVirtualTable(wxString & tableName); void AddGeoPackageVirtualTable(wxString & dbAlias, wxString & tableName, @@ -2600,10 +2723,11 @@ bool virtualTable, bool geometry, RootNodes * list); void AddView(wxString & viewName, bool geometry); void AddView(wxString & dbAlias, wxString & viewName, bool geometry); void AddView(wxString & dbAlias, wxString & viewName, bool geometry, RootNodes * list); + void AddPostgresTable(class MyPostgres * list, wxString & virtName); void ExpandRoot() { Expand(Root); Expand(RootUserData); CollapseAllChildren(RootTopologies); @@ -2610,10 +2734,11 @@ CollapseAllChildren(RootNetworks); CollapseAllChildren(RootRasterCoverages); CollapseAllChildren(RootVectorCoverages); CollapseAllChildren(RootStyling); CollapseAllChildren(RootWMS); + CollapseAllChildren(RootPostgreSQL); CollapseAllChildren(RootIsoMetadata); Collapse(RootMetadata); Collapse(RootInternal); Collapse(RootSpatialIndex); } @@ -2694,10 +2819,22 @@ } void DeleteAltVectorCoverages(void) { AltVectorCoverages.Flush(); } + void AddPostgresConnection(int num, class MyPostgresConn * conn, + wxTreeItemId & itemId); + void AddPostgresSchema(wxTreeItemId & parent, MyPostgresConn * conn, + wxString & schema, wxTreeItemId & itemId); + void AddPostgresTable(wxTreeItemId & parent, MyPostgresConn * conn, + wxString & schema, wxString & table, + wxString & virtName); + void AddPostgresView(wxTreeItemId & parent, MyPostgresConn * conn, + wxString & schema, wxString & view, wxString & virtName); + void AddPostGisView(wxTreeItemId & parent, MyPostgresConn * conn, + wxString & schema, wxString & table, wxString & geometry, + wxString & virtName); sqlite3 *GetSQLiteHandle(); void OnSelChanged(wxTreeEvent & event); void OnRightClick(wxTreeEvent & event); void OnCmdQueryViewComposer(wxCommandEvent & event); void OnCmdCloneTable(wxCommandEvent & event); @@ -2783,10 +2920,15 @@ void OnCmdDumpDif(wxCommandEvent & event); void OnCmdDumpSylk(wxCommandEvent & event); void OnCmdDumpDbf(wxCommandEvent & event); void OnCmdDumpPostGIS(wxCommandEvent & event); void OnCmdEdit(wxCommandEvent & event); + void OnCmdCreatePostgreSqlConn(wxCommandEvent & event); + void OnCmdCloseAllPostgreSqlConns(wxCommandEvent & event); + void OnCmdClosePostgreSqlConn(wxCommandEvent & event); + void OnCmdPostgreSqlDropOrphans(wxCommandEvent & event); + void OnCmdPostgreSqlInfos(wxCommandEvent & event); bool DropRenameAux1(MyObject * obj, class GeomColsList * geometries, bool * autoincrement); void DropRenameAux2(MyObject * obj, GeomColsList * geometries, wxString & aliasTable, wxString & new_column, wxString & renameSql, wxString & dropSql, @@ -3282,10 +3424,87 @@ MalformedGeom *GetFirst() { return First; } }; + +class PostgresConnectionDialog:public wxDialog +{ +// +// a dialog for connecting to a PosgreSQL DBMS +// +private: + MyFrame * MainFrame; + char *host; + char *hostaddr; + unsigned int port; + char *dbname; + char *user; + char *password; + bool ReadOnly; + bool TextDates; +public: + PostgresConnectionDialog() + { + host = NULL; + hostaddr = NULL; + port = 5432; + dbname = NULL; + user = NULL; + password = NULL; + ReadOnly = true; + TextDates = true; + } + virtual ~ PostgresConnectionDialog() + { + if (host != NULL) + free(host); + if (hostaddr != NULL) + free(hostaddr); + if (dbname != NULL) + free(dbname); + if (user != NULL) + free(user); + if (password != NULL) + free(password); + } + bool Create(MyFrame * parent); + void CreateControls(); + const char *GetHost() + { + return host; + } + const char *GetHostAddr() + { + return hostaddr; + } + int GetPort() + { + return port; + } + const char *GetDbName() + { + return dbname; + } + const char *GetUser() + { + return user; + } + const char *GetPassword() + { + return password; + } + bool IsReadOnly() + { + return ReadOnly; + } + bool IsTextDates() + { + return TextDates; + } + void OnOk(wxCommandEvent & event); +}; class SanitizeAllGeometriesDialog:public wxDialog { // // a dialog supporting Sanitize All Geometries @@ -3754,10 +3973,11 @@ { // // an ancillary class wrapping Tables and Views // private: + wxString DbName; wxString Name; bool View; bool Virtual; bool Geometry; bool GeoPackageGeometry; @@ -3764,13 +3984,18 @@ bool GeoPackageVirtualGeometry; bool FdoOgrGeometry; bool FdoOgrVirtualGeometry; TableViewItem *Next; public: + TableViewItem(wxString & db, wxString & name); TableViewItem(wxString & name, bool is_view, bool is_virtual); ~TableViewItem() {; + } + wxString & GetDbName() + { + return DbName; } wxString & GetName() { return Name; } @@ -3820,10 +4045,12 @@ } bool IsFdoOgrVirtualGeometry() { return FdoOgrVirtualGeometry; } + bool IsPostgresTable(class MyPostgres * list); + bool IsTmpMetadata(); void SetNext(TableViewItem * next) { Next = next; } TableViewItem *GetNext() @@ -3843,10 +4070,11 @@ int Count; TableViewItem **Sorted; public: TableViewList(); ~TableViewList(); + void Add(wxString & db, wxString & name); void Add(wxString & name, bool isView, bool isVirtual); void PrepareSorted(); void SetGeometry(wxString & name); void SetGeoPackageGeometry(wxString & name); void SetGeoPackageVirtualGeometry(wxString & name); @@ -4241,10 +4469,461 @@ MyAttachedDB *GetFirst() { return First; } }; + +class MyPostgresCol +{ +// +// a PostgreSQL Column +// +private: + wxString Name; + bool PK; + MyPostgresCol *Next; +public: + MyPostgresCol(wxString & name) + { + Name = name; + PK = false; + Next = NULL; + } + ~MyPostgresCol() + {; + } + wxString & GetName() + { + return Name; + } + void SetPK() + { + PK = true; + } + bool IsPK() + { + return PK; + } + void SetNext(MyPostgresCol * next) + { + Next = next; + } + MyPostgresCol *GetNext() + { + return Next; + } +}; + +class MyPostgresColumns +{ +// +// a list of PostgreSQL Columns +// +private: + MyPostgresCol * First; + MyPostgresCol *Last; +public: + MyPostgresColumns() + { + First = NULL; + Last = NULL; + } + ~MyPostgresColumns(); + void Add(wxString & name); + void SetPK(wxString & name); + MyPostgresCol *GetFirst() + { + return First; + } + char *BuildWhere(); +}; + +class MyPostGisGeometry +{ +// +// a PostGIS Geometry column +// +private: + wxString Name; + wxString GeomType; + bool MultiType; + int Srid; + int Dims; + MyPostGisGeometry *Next; +public: + MyPostGisGeometry(wxString & name, wxString & type, int srid, int dims); + ~MyPostGisGeometry() + {; + } + wxString & GetName() + { + return Name; + } + wxString & GetGeomType() + { + return GeomType; + } + bool IsMultiType() + { + return MultiType; + } + int GetSrid() + { + return Srid; + } + int GetDims() + { + return Dims; + } + void SetNext(MyPostGisGeometry * next) + { + Next = next; + } + MyPostGisGeometry *GetNext() + { + return Next; + } +}; + +class MyPostgresPK +{ +// +// a ProgresSQL PK column +// +private: + wxString Name; + MyPostgresPK *Next; +public: + MyPostgresPK(wxString & name) + { + Name = name; + Next = NULL; + } + ~MyPostgresPK() + {; + } + wxString & GetName() + { + return Name; + } + void SetNext(MyPostgresPK * next) + { + Next = next; + } + MyPostgresPK *GetNext() + { + return Next; + } +}; + +class MyPostgresTable +{ +// +// a PostgreSQL Table +// +private: + wxString Name; + wxString VirtName; + wxString PostGisName; + bool PkChecked; + bool GrantSelect; + bool GrantInsertUpdateDelete; + MyPostgresPK *FirstPK; + MyPostgresPK *LastPK; + MyPostGisGeometry *First; + MyPostGisGeometry *Last; + MyPostgresTable *Next; +public: + MyPostgresTable(wxString & name); + ~MyPostgresTable(); + wxString & GetName() + { + return Name; + } + void SetVirtName(wxString & name) + { + VirtName = name; + } + wxString & GetVirtName() + { + return VirtName; + } + void SetPostGisName(wxString & name) + { + PostGisName = name; + } + wxString & GetPostGisName() + { + return PostGisName; + } + void Add(wxString & geometry, wxString & type, int srid, int dims); + void AddPK(wxString & column); + MyPostGisGeometry *Find(wxString & column); + bool IsPkColumn(wxString & column); + bool HasPK(); + void SetGrants(bool grantSelect, bool granInsertUpdateDelete) + { + GrantSelect = grantSelect; + GrantInsertUpdateDelete = granInsertUpdateDelete; + } + bool CanSelect() + { + return GrantSelect; + } + bool CanInsertUpdateDelete() + { + return GrantInsertUpdateDelete; + } + bool IsPkAlreadyChecked() + { + return PkChecked; + } + void SetPkChecked() + { + PkChecked = true; + } + MyPostgresPK *GetFirstPK() + { + return FirstPK; + } + MyPostGisGeometry *GetFirst() + { + return First; + } + void SetNext(MyPostgresTable * next) + { + Next = next; + } + MyPostgresTable *GetNext() + { + return Next; + } +}; + +class MyPostgresView +{ +// +// a PostgreSQL View +// +private: + wxString Name; + wxString VirtName; + bool GrantSelect; + bool GrantInsertUpdateDelete; + MyPostgresView *Next; +public: + MyPostgresView(wxString & name); + ~MyPostgresView() + {; + } + wxString & GetName() + { + return Name; + } + void SetVirtName(wxString & name) + { + VirtName = name; + } + wxString & GetVirtName() + { + return VirtName; + } + void SetGrants(bool grantSelect, bool granInsertUpdateDelete) + { + GrantSelect = grantSelect; + GrantInsertUpdateDelete = granInsertUpdateDelete; + } + bool CanSelect() + { + return GrantSelect; + } + bool CanInsertUpdateDelete() + { + return GrantInsertUpdateDelete; + } + void SetNext(MyPostgresView * next) + { + Next = next; + } + MyPostgresView *GetNext() + { + return Next; + } +}; + +class MyPostgresSchema +{ +// +// a PostgreSQL Schema +// +private: + wxString Name; + wxTreeItemId TreeNode; + MyPostgresTable *FirstTable; + MyPostgresTable *LastTable; + MyPostgresTable *CurrentTable; + MyPostgresView *FirstView; + MyPostgresView *LastView; + MyPostgresSchema *Next; +public: + MyPostgresSchema(wxString & name); + ~MyPostgresSchema(); + wxString & GetName() + { + return Name; + } + void Add(wxString & name, wxString & geometry, wxString & type, int srid, + int dims); + void Add(wxString & name); + void SetTreeNode(wxTreeItemId & node) + { + TreeNode = node; + } + wxTreeItemId & GetTreeNode() + { + return TreeNode; + } + MyPostgresTable *GetFirstTable() + { + return FirstTable; + } + MyPostgresView *GetFirstView() + { + return FirstView; + } + void SetNext(MyPostgresSchema * next) + { + Next = next; + } + MyPostgresSchema *GetNext() + { + return Next; + } +}; + +class MyPostgresConn +{ +// +// a connection to some PosgreSQL DBMS +// +private: + wxString Host; + wxString HostAddr; + int Port; + wxString DbName; + wxString User; + bool ReadOnly; + bool TextDates; + wxString ConnectionString; + MyPostgresSchema *First; + MyPostgresSchema *Last; + MyPostgresSchema *Current; + MyPostgresConn *Prev; + MyPostgresConn *Next; +public: + MyPostgresConn(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly, + bool textDates); + ~MyPostgresConn(); + wxString & GetHost() + { + return Host; + } + wxString & GetHostAddr() + { + return HostAddr; + } + int GetPort() + { + return Port; + } + wxString & GetDbName() + { + return DbName; + } + wxString & GetUser() + { + return User; + } + bool IsReadOnly() + { + return ReadOnly; + } + bool IsTextDates() + { + return TextDates; + } + void SetConnectionString(const char *connection_string) + { + ConnectionString = wxString::FromUTF8(connection_string); + } + wxString & GetConnectionString() + { + return ConnectionString; + } + MyPostgresSchema *Add(wxString & schema); + void Add(wxString & schema, wxString & table, wxString & geometry, + wxString & type, int srid, int dims); + void Add(wxString & schema, wxString & view); + MyPostgresSchema *GetFirst() + { + return First; + } + void SetPrev(MyPostgresConn * conn) + { + Prev = conn; + } + MyPostgresConn *GetPrev() + { + return Prev; + } + void SetNext(MyPostgresConn * conn) + { + Next = conn; + } + MyPostgresConn *GetNext() + { + return Next; + } +}; + +class MyPostgres +{ +// +// general container for all PostgreSQL connections +// +private: + MyPostgresConn * First; + MyPostgresConn *Last; + MyPostgresConn *Current; +public: + MyPostgres() + { + First = NULL; + Last = NULL; + Current = NULL; + } + ~MyPostgres() + { + Clear(); + } + void Clear(); + MyPostgresConn *Insert(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly, + bool textDates); + MyPostgresConn *Find(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user); + MyPostgresTable *FindTable(class MyFrame * parent, wxString & virtName); + MyPostgresTable *FindPostGisView(class MyFrame * parent, wxString & virtName); + void Remove(MyPostgresConn * conn); + bool CheckUniqueVirtName(wxString & virtName); + void MakeUniqueVirtName(wxString & baseName, wxString & uniqueName); + MyPostgresConn *GetFirst() + { + return First; + } +}; class MyFrame:public wxFrame { // // the main GUI frame @@ -4324,10 +5003,11 @@ wxBitmap *BtnCheckGeom; // button icon for CheckGeom wxBitmap *BtnSaneGeom; // button icon for SaneGeom wxBitmap *BtnWFS; // button icon for WFS wxBitmap *BtnDXF; // button icon for DXF wxBitmap *BtnMap; // button icon for Map Panel + wxBitmap *BtnPostgres; // button icon for PostgreSQL rl2WmsCachePtr WmsCache; // internal WMS Cache bool ReadOnlyConnection; // AutoSave timer int AutoSaveInterval; int LastTotalChanges; @@ -4351,10 +5031,39 @@ char *GetNum(const char *start, const char *end); bool IsValidSqliteFile(wxString & path); void DoUpdateRL2MaxThreads(); void DoAutoDetachDatabases(); CurrentSqlFilters SqlFilters; + MyPostgres PostgresList; + virtualPQ VirtualPQapi; + wxDynamicLibrary DynamicLibPQ; + wxString PathLibPQ; + bool VirtualPQapiOK; + void DoInitVirtualPQapi(); + void DoLocateLibPQ(wxString & path); + void DoLoadLibPQ(wxString & path); + bool DoCheckPostgres(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user); + bool DoInitPostgres(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly, + bool textDates, const char *conninfo); + void DoSetUniqueVirtNames(); + void DoCreatePostgresTables(); + void DoDropPostgresTables(); + char *DoCreatePostGisSpatialView(MyPostgresTable * table, char *sql); + void DoCreatePostGisSpatialViewTriggers(MyPostgresConn * conn, + MyPostgresSchema * schema, + MyPostgresTable * table); + void GetPQlibVersion(wxString & ver); + void DoCreatePostgreSqlNodes(); + MyPostgresColumns *DoGetPostgresColumns(MyPostgresTable * table); + void DoCheckGrantPermissions(void *pg_conn, wxString & user, + MyPostgresSchema * schema, + MyPostgresTable * table); + void DoCheckGrantPermissions(void *pg_conn, wxString & user, + MyPostgresSchema * schema, + MyPostgresView * view); public: MyFrame(const wxString & title, const wxPoint & pos, const wxSize & size); virtual ~ MyFrame(); enum VectorTypes { @@ -4497,10 +5206,15 @@ void InitializeSpatialMetadata(); void AutoFDOStart(); void AutoFDOStop(); void AutoGPKGStart(); void AutoGPKGStop(); + void AutoPostgresStop(); + bool DoClosePostgreSqlConn(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user); + char *DropPostgreSqlOrphans(); + void DoInitVirtualPG(); void InitTableTree(); void LoadHistory(); bool HasHistory(); void ListAttached(); void AutoFDOStart(wxString & dbAlias, MyAttachedDB * db); @@ -4669,10 +5383,11 @@ void ExportResultSetAsSylk(wxString & path, wxString & sql, wxString & charset, bool date_time); void ExportResultSetAsDbf(wxString & path, wxString & sql, wxString & charset); void GetHelp(wxString & html); + void FeedZipHtml(unsigned char *zip, int offset, const char *data); wxString *GetColumnNames(wxString & table, int *columns); void SetLastDirectory(wxString & path) { LastDirectory = path; } @@ -4724,28 +5439,10 @@ return RsView; } wxString *GetTables(int *cnt); wxString *GetTableColumns(wxString & dbPrefix, wxString & table, int *cnt); wxString *GetTableGeometries(wxString & dbPrefix, wxString & table, int *cnt); - void BuildNetwork(wxString & table, wxString & from, wxString & to, - bool isNoGeometry, wxString & geometry, wxString & name, - bool cost_length, wxString & cost, bool bidirectional, - bool one_way, wxString & one_way_from_to, - wxString & one_way_to_from, bool aStarSupported, - wxString & dataTableName, wxString & virtualTableName); - void BuildNetwork(wxString & table, wxString & from, wxString & to, - wxString & name, wxString & cost, bool bidirectional, - bool one_way, wxString & one_way_from_to, - wxString & one_way_to_from, wxString & dataTableName, - wxString & virtualTableName); - bool CreateNetwork(class Network * net, wxString & table, wxString & from, - wxString & to, wxString & geometry, wxString & name, - bool aStarSupported, double aStarCoeff, - wxString & dataTableName, wxString & virtualTableName); - bool CreateNetwork(class Network * net, wxString & table, wxString & from, - wxString & to, wxString & name, wxString & dataTableName, - wxString & virtualTableName); void ImportExifPhotos(wxString & path, bool folder, bool metadata, bool gps_only); void ImportGpsPhotos(wxString & path, bool folder, wxString & table, wxString & geometry, bool update_statistics, bool spatial_index); @@ -4756,13 +5453,10 @@ wxString & validateErrColumn, int compressed, const char *schemaURI, bool isInternaleSchemaUri); void ImportDXFfiles(wxString & path, bool folder, wxString & prefix, wxString & layer, int srid, bool force2d, bool force3d, bool mixed, bool linked, bool unlinked, bool append); - void OutputNetNode(unsigned char *auxbuf, int *size, int ind, bool node_code, - int max_node_length, class NetNode * pN, int endian_arch, - bool aStarSupported); bool CheckExifTables(); int ExifLoadDir(wxString & path, bool gps_only, bool metadata); int ExifLoadFile(wxString & path, bool gps_only, bool metadata); bool UpdateExifTables(unsigned char *blob, int sz, gaiaExifTagListPtr tag_list, bool metadata, @@ -4976,10 +5670,35 @@ void DoCreateTopoGeo(); void DoCreateTopoNet(); void MapPanelClosing(); + void CreateNetwork(wxString & table, wxString & from, wxString & to, + bool isNoGeometry, wxString & geom, bool isNameEnabled, + wxString & name, bool isGeomLength, wxString & cost, + bool isBidirectional, bool isOneWays, + wxString & oneWayFromTo, wxString & oneWayToFrom, + bool aStarSupported, wxString & dataTableName, + wxString & virtualTableName, bool overwrite); + void GetLastRoutingError(wxString & errCause); + + bool HasPostgreSqlConnections(); + void DoPostgreSqlConnection(); + bool DoCheckPostGisGeometry(wxString & virtName, wxString & columnName); + MyPostgresTable *FindPostgresTable(wxString & virtName) + { + return PostgresList.FindTable(this, virtName); + } + MyPostgresTable *FindPostGisView(wxString & virtName) + { + return PostgresList.FindPostGisView(this, virtName); + } + void InitPostgresPkColumns(MyPostgresConn * conn, MyPostgresSchema * schema, + MyPostgresTable * table); + void InitPostgresPks(void *conn, MyPostgresSchema * schema, + MyPostgresTable * table); + void OnQuit(wxCommandEvent & event); void OnClose(wxCloseEvent & event); void OnAbout(wxCommandEvent & event); void OnConnect(wxCommandEvent & event); void OnConnectReadOnly(wxCommandEvent & event); @@ -4988,10 +5707,14 @@ void OnMemoryDbLoad(wxCommandEvent & event); void OnMemoryDbNew(wxCommandEvent & event); void OnMemoryDbClock(wxCommandEvent & event); void OnMemoryDbSave(wxCommandEvent & event); void OnVacuum(wxCommandEvent & event); + void OnPostgreSQL(wxCommandEvent & event) + { + DoPostgreSqlConnection(); + } void OnMapPanel(wxCommandEvent & event); void OnSqlScript(wxCommandEvent & event); void OnQueryViewComposer(wxCommandEvent & event); void OnCharset(wxCommandEvent & event); void OnLoadShp(wxCommandEvent & event); @@ -5057,11 +5780,11 @@ public: CloneTableDialog() { MainFrame = NULL; } - CloneTableDialog(MyFrame * parent, wxString & dbPrefx, wxString & inTable) + CloneTableDialog(MyFrame * parent, wxString & dbPrefix, wxString & inTable) { Create(parent, dbPrefix, inTable); } bool Create(MyFrame * parent, wxString & dbPrefix, wxString & inTable); virtual ~ CloneTableDialog() @@ -5997,11 +6720,13 @@ {; } LoadXLDialog(MyFrame * parent, wxString & path, wxString & table); bool Create(MyFrame * parent, wxString & path, wxString & table); virtual ~ LoadXLDialog() - {; + { + if (Worksheets != NULL) + delete[]Worksheets; } void CreateControls(); wxString & GetTable() { return Table; @@ -6222,10 +6947,12 @@ bool NameEnabled; // Name column supported wxString NameColumn; // the Name column name bool AStarSupported; // A* algorithm supported wxString DataTable; // name of the binary data table wxString VirtualTable; // name of the VirtualNetwork table + bool Overwrite; // enabled to overwrite existing tables + void SetCurrentTable(); public: NetworkDialog() {; } NetworkDialog(MyFrame * parent); @@ -6295,17 +7022,22 @@ return DataTable; } wxString & GetVirtualTable() { return VirtualTable; + } + bool IsOverwriteEnabled() + { + return Overwrite; } void OnTable(wxCommandEvent & event); void OnDirection(wxCommandEvent & event); void OnCost(wxCommandEvent & event); void OnOneWay(wxCommandEvent & event); void OnNameEnabled(wxCommandEvent & event); void OnNoGeometry(wxCommandEvent & event); + void OnOverwrite(wxCommandEvent & event); void OnOk(wxCommandEvent & event); }; class ExifDialog:public wxDialog { @@ -7015,254 +7747,10 @@ wxDefaultSize, long style = 0); virtual ~ MyHexList(); virtual wxString OnGetItemText(long item, long column) const; }; -class NetNodePre -{ -// -// a class to store a temporary node for Network -// -private: - sqlite3_int64 Id; - wxString Code; - NetNodePre *Next; -public: - NetNodePre(sqlite3_int64 id); - NetNodePre(const char *code); - ~NetNodePre() - {; - } - sqlite3_int64 GetId() - { - return Id; - } - wxString & GetCode() - { - return Code; - } - void SetNext(NetNodePre * next) - { - Next = next; - } - NetNodePre *GetNext() - { - return Next; - } -}; - -class NetNode -{ -// -// a class to store a final node for Network -// -private: - int InternalIndex; - sqlite3_int64 Id; - wxString Code; - double X; - double Y; - class NetArcRef *First; - class NetArcRef *Last; - NetNode *Next; -public: - NetNode(sqlite3_int64 id); - NetNode(wxString & code); - ~NetNode(); - int GetInternalIndex() - { - return InternalIndex; - } - void SetInternalIndex(int idx) - { - InternalIndex = idx; - } - sqlite3_int64 GetId() - { - return Id; - } - wxString & GetCode() - { - return Code; - } - double GetX() - { - return X; - } - void SetX(double x) - { - X = x; - } - double GetY() - { - return Y; - } - void SetY(double y) - { - Y = y; - } - void AddOutcoming(class NetArc * pA); - NetArcRef *GetFirst() - { - return First; - } - NetArc **PrepareOutcomings(int *count); - void SetNext(NetNode * next) - { - Next = next; - } - NetNode *GetNext() - { - return Next; - } -}; - -class NetArc -{ -// -// a class to store an arc for Network -// -private: - sqlite3_int64 RowId; - NetNode *From; - NetNode *To; - double Cost; - NetArc *Next; -public: - NetArc(sqlite3_int64 rowid, NetNode * from, NetNode * to, double cost); - ~NetArc() - {; - } - sqlite3_int64 GetRowId() - { - return RowId; - } - NetNode *GetFrom() - { - return From; - } - NetNode *GetTo() - { - return To; - } - double GetCost() - { - return Cost; - } - void SetNext(NetArc * next) - { - Next = next; - } - NetArc *GetNext() - { - return Next; - } -}; - -class NetArcRef -{ -// -// a class to store a reference to an arc for Network -// -private: - NetArc * Reference; - NetArcRef *Next; -public: - NetArcRef(NetArc * arc) - { - Reference = arc; - Next = NULL; - } - ~NetArcRef() - {; - } - NetArc *GetReference() - { - return Reference; - } - void SetNext(NetArcRef * next) - { - Next = next; - } - NetArcRef *GetNext() - { - return Next; - } -}; - -class Network -{ -// -// a class representing a Network -// -private: - NetNodePre * FirstPre; - NetNodePre *LastPre; - int NumPreNodes; - NetNodePre **SortedPreNodes; - NetArc *FirstArc; - NetArc *LastArc; - NetNode *FirstNode; - NetNode *LastNode; - int NumNodes; - NetNode **SortedNodes; - bool Error; - bool NodeCode; - int MaxCodeLength; -public: - Network(); - ~Network(); - void CleanPreNodes(); - void InsertNode(sqlite3_int64 id); - void InsertNode(const char *code); - void AddNode(sqlite3_int64 id); - void AddNode(wxString & code); - NetNode *ProcessNode(sqlite3_int64 id, double x, double y, NetNode ** pOther); - NetNode *ProcessNode(wxString & code, double x, double y, NetNode ** pOther); - NetNode *ProcessNode(sqlite3_int64 id, NetNode ** pOther); - NetNode *ProcessNode(wxString & code, NetNode ** pOther); - void Sort(); - NetNode *Find(sqlite3_int64 id); - NetNode *Find(wxString & code); - NetNode *GetSortedNode(sqlite3_int64 x); - void AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, sqlite3_int64 id_to, - double node_from_x, double node_from_y, double node_to_x, - double node_to_y, double cost); - void AddArc(sqlite3_int64 rowid, const char *code_from, const char *code_to, - double node_from_x, double node_from_y, double node_to_x, - double node_to_y, double cost); - void AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, sqlite3_int64 id_to, - double cost); - void AddArc(sqlite3_int64 rowid, const char *code_from, const char *code_to, - double cost); - void InitNodes(); - void SetError() - { - Error = true; - } - bool IsError() - { - return Error; - } - void SetNodeCode(bool mode) - { - NodeCode = mode; - } - bool IsNodeCode() - { - return NodeCode; - } - int GetNumNodes() - { - return NumNodes; - } - int GetMaxCodeLength() - { - return MaxCodeLength; - } -}; - class AutoFDOTable { private: char *Name; AutoFDOTable *Next; @@ -11505,11 +11993,11 @@ virtual ~ WmsServersDialog() { if (List != NULL) delete[]List; } - bool Create(WmsDialog * parent, MyFrame * grandparent); + bool Create(MyFrame * grandparent); void CreateControls(); wxString & GetURL() { return URL; } @@ -11658,25 +12146,11 @@ void DoConfigureMapLayer(); public: WmsLayerConfigDialog() {; } - virtual ~ WmsLayerConfigDialog() - { - if (Version != NULL) - free(Version); - if (MaxVersion != NULL) - free(MaxVersion); - if (RefSys != NULL) - free(RefSys); - if (Style != NULL) - free(Style); - if (ImageFormat != NULL) - free(ImageFormat); - if (BgColor != NULL) - free(BgColor); - } + virtual ~ WmsLayerConfigDialog(); bool Create(MyFrame * parent, wxString url, wxString layer); bool Create(MyMapPanel * parent, MapLayer * layer); void CreateControls(); void LoadData(); void InitData(); @@ -11789,10 +12263,138 @@ return IsConfigChanged; } void OnOk(wxCommandEvent & event); void OnQuit(wxCommandEvent & event); }; + +class VectorSqlSampleDialog:public wxDialog +{ +// +// a dialog for configuring an SQL Map Request +// based on some Vector Layer +// +private: + MyFrame * MainFrame; + MyMapPanel *MapPanel; + MapLayer *Layer; + wxString DbPrefix; + wxString LayerName; + char *Style; + wxColour BgColor; + wxString Sql; + void GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp); + void DoUpdateSql(); +public: + VectorSqlSampleDialog() + {; + } + virtual ~ VectorSqlSampleDialog() + { + if (Style != NULL) + free(Style); + } + bool Create(MyMapPanel * parent, MapLayer * layer); + void CreateControls(); + void InitData(); + void PopulateStyles(wxComboBox * stlList); + void OnStyleChanged(wxCommandEvent & event); + void OnMimeTypeChanged(wxCommandEvent & event); + void OnQualityChanged(wxCommandEvent & event); + void OnTransparentChanged(wxCommandEvent & event); + void OnBackgroundChanged(wxCommandEvent & event); + void OnCopy(wxCommandEvent & event); + void OnQuit(wxCommandEvent & event); +}; + +class RasterSqlSampleDialog:public wxDialog +{ +// +// a dialog for configuring an SQL Map Request +// based on some Raster Layer +// +private: + MyFrame * MainFrame; + MyMapPanel *MapPanel; + MapLayer *Layer; + wxString DbPrefix; + wxString LayerName; + char *Style; + wxColour BgColor; + wxString Sql; + void GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp); + void DoUpdateSql(); +public: + RasterSqlSampleDialog() + {; + } + virtual ~ RasterSqlSampleDialog() + { + if (Style != NULL) + free(Style); + } + bool Create(MyMapPanel * parent, MapLayer * layer); + void CreateControls(); + void InitData(); + void PopulateStyles(wxComboBox * stlList); + void OnStyleChanged(wxCommandEvent & event); + void OnMimeTypeChanged(wxCommandEvent & event); + void OnQualityChanged(wxCommandEvent & event); + void OnTransparentChanged(wxCommandEvent & event); + void OnBackgroundChanged(wxCommandEvent & event); + void OnCopy(wxCommandEvent & event); + void OnQuit(wxCommandEvent & event); +}; + +class WmsSqlSampleDialog:public wxDialog +{ +// +// a dialog for configuring an SQL Map Request +// based on some WMS Layer +// +private: + MyFrame * MainFrame; + MyMapPanel *MapPanel; + MapLayer *Layer; + bool RequestURL; + wxString Url; + wxString DbPrefix; + wxString LayerName; + char *Version; + char *MaxVersion; + char *Style; + char *ImageFormat; + char *BgColor; + int Transparent; + wxString Sql; + void GetButtonBitmap(const char *color, wxBitmap & bmp); + void ParseBgColor(const char *color, unsigned char *red, unsigned char *green, + unsigned char *blue); + unsigned char ParseHex(const char *byte); + void DoUpdateSql(); + void DoUpdateUrl(); + int CheckMarker(wxString & url); + int DoQueryWmsCoverage(const char *db_prefix, const char *cvg_name, int srid, + char **url, int *swap_axes); +public: + WmsSqlSampleDialog() + {; + } + virtual ~ WmsSqlSampleDialog(); + bool Create(MyMapPanel * parent, MapLayer * layer, bool request_url = false); + void CreateControls(); + void InitData(); + void FindMaxVersion(); + void PopulateImageFormats(wxComboBox * fmtList); + void PopulateStyles(wxComboBox * stlList); + void OnStyleChanged(wxCommandEvent & event); + void OnMimeTypeChanged(wxCommandEvent & event); + void OnVersionChanged(wxCommandEvent & event); + void OnTransparentChanged(wxCommandEvent & event); + void OnBgColorChanged(wxCommandEvent & event); + void OnCopy(wxCommandEvent & event); + void OnQuit(wxCommandEvent & event); +}; class TopologyLayerConfigDialog:public wxDialog { // // a dialog for configuring a TopoGeo Layer @@ -12866,10 +13468,269 @@ { return XmlStyle; } const unsigned char *CloneXmlStyle(); }; + +class QuickStyleRasterObj +{ +// +// a class wrapping a Quick Style - Raster +// +private: + char UUID[64]; + bool MinScaleEnabled; + bool MaxScaleEnabled; + double ScaleMin; + double ScaleMax; + double Opacity; + bool Normalize; + bool Histogram; + bool Gamma; + double GammaValue; + bool TripleBand; + bool SingleBand; + unsigned char RedBand; + unsigned char GreenBand; + unsigned char BlueBand; + unsigned char GrayBand; + bool SrtmColorMap; + bool TerrainColorMap; + bool NdviColorMap; + bool ColorRamp; + double MinValue; + char MinValueColor[8]; + double MaxValue; + char MaxValueColor[8]; + bool ShadedRelief; + double ShadedReliefFactor; + char *XmlStyle; + char *DoCreateRasterXML(); + char *DoCreatePredefinedSrtmStyle(char *base_xml); + char *DoCreatePredefinedTerrainStyle(char *base_xml); + char *DoCreatePredefinedNdviStyle(char *base_xml); +public: + QuickStyleRasterObj(); + ~QuickStyleRasterObj() + { + if (XmlStyle) + sqlite3_free(XmlStyle); + } + QuickStyleRasterObj *Clone(); + bool Compare(QuickStyleRasterObj * style); + const char *GetUUID() + { + return UUID; + } + void EnableMinScale(bool mode) + { + MinScaleEnabled = mode; + } + bool IsMinScaleEnabled() + { + return MinScaleEnabled; + } + void EnableMaxScale(bool mode) + { + MaxScaleEnabled = mode; + } + bool IsMaxScaleEnabled() + { + return MaxScaleEnabled; + } + void SetScaleMin(double x) + { + ScaleMin = x; + } + double GetScaleMin() + { + return ScaleMin; + } + void SetScaleMax(double x) + { + ScaleMax = x; + } + double GetScaleMax() + { + return ScaleMax; + } + void SetOpacity(double x) + { + Opacity = x; + } + double GetOpacity() + { + return Opacity; + } + void SetNormalize(bool mode) + { + Normalize = mode; + } + bool IsNormalize() + { + return Normalize; + } + void SetHistogram(bool mode) + { + Histogram = mode; + } + bool IsHistogram() + { + return Histogram; + } + void SetGamma(bool mode) + { + Gamma = mode; + } + bool IsGamma() + { + return Gamma; + } + void SetGammaValue(double value) + { + GammaValue = value; + } + double GetGammaValue() + { + return GammaValue; + } + void SetTripleBand(bool mode) + { + TripleBand = mode; + } + bool IsTripleBand() + { + return TripleBand; + } + void SetSingleBand(bool mode) + { + SingleBand = mode; + } + bool IsSingleBand() + { + return SingleBand; + } + void SetRedBand(unsigned char red) + { + RedBand = red; + } + unsigned char GetRedBand() + { + return RedBand; + } + void SetGreenBand(unsigned char green) + { + GreenBand = green; + } + unsigned char GetGreenBand() + { + return GreenBand; + } + void SetBlueBand(unsigned char blue) + { + BlueBand = blue; + } + unsigned char GetBlueBand() + { + return BlueBand; + } + void SetGrayBand(unsigned char gray) + { + GrayBand = gray; + } + unsigned char GetGrayBand() + { + return GrayBand; + } + void SetSrtmColorMap(bool mode) + { + SrtmColorMap = mode; + } + bool IsSrtmColorMap() + { + return SrtmColorMap; + } + void SetTerrainColorMap(bool mode) + { + TerrainColorMap = mode; + } + bool IsTerrainColorMap() + { + return TerrainColorMap; + } + void SetNdviColorMap(bool mode) + { + NdviColorMap = mode; + } + bool IsNdviColorMap() + { + return NdviColorMap; + } + void SetColorRamp(bool mode) + { + ColorRamp = mode; + } + bool IsColorRamp() + { + return ColorRamp; + } + void SetMinValue(double x) + { + MinValue = x; + } + double GetMinValue() + { + return MinValue; + } + void SetMinValueColor(const char *x) + { + strcpy(MinValueColor, x); + } + const char *GetMinValueColor() + { + return MinValueColor; + } + void SetMaxValue(double x) + { + MaxValue = x; + } + double GetMaxValue() + { + return MaxValue; + } + void SetMaxValueColor(const char *x) + { + strcpy(MaxValueColor, x); + } + const char *GetMaxValueColor() + { + return MaxValueColor; + } + void SetShadedRelief(bool mode) + { + ShadedRelief = mode; + } + bool IsShadedRelief() + { + return ShadedRelief; + } + void SetShadedReliefFactor(double x) + { + ShadedReliefFactor = x; + } + double GetShadedReliefFactor() + { + return ShadedReliefFactor; + } + char *CreateXmlStyle(); + void UpdateXmlStyle(); + const char *GetXmlStyle() + { + return XmlStyle; + } + unsigned char *CloneXmlStyle(); +}; class QuickStyleVectorDialog:public wxPropertySheetDialog { // // a dialog for configuring a Quick Style (Vector) @@ -12963,10 +13824,85 @@ void OnCmdIsAlignedChanged(wxCommandEvent & event); void OnCmdGeneralizeLineChanged(wxCommandEvent & event); void OnFont1Changed(wxCommandEvent & event); void OnFont2Changed(wxCommandEvent & event); }; + +class QuickStyleRasterDialog:public wxPropertySheetDialog +{ +// +// a dialog for configuring a Quick Style (Raster) +// +private: + MyFrame * MainFrame; + MyMapPanel *MapPanel; + MapLayer *Layer; + wxString DbPrefix; + wxString LayerName; + bool CanApplyContrastEnhancement; + bool IsMultiband; + unsigned char NumBands; + unsigned char RedBand; + unsigned char GreenBand; + unsigned char BlueBand; + unsigned char GrayBand; + bool CanApplyColorMap; + bool CanApplyNDVI; + double MinPixelValue; + double MaxPixelValue; + bool CanApplyShadedRelief; + QuickStyleRasterObj *Style; + bool IsConfigChanged; + int PageContrastEnhancementIndex; + int PageChannelSelectionIndex; + int PageColorMapIndex; + wxPanel *CreateMainPage(wxWindow * book); + wxPanel *CreateContrastEnhancementPage(wxWindow * book); + wxPanel *CreateChannelSelectionPage(wxWindow * book); + wxPanel *CreateColorMapPage(wxWindow * book); + bool RetrieveMainPage(); + bool RetrieveContrastEnhancementPage(bool check = true); + bool RetrieveChannelSelectionPage(bool check = true); + bool RetrieveColorMapPage(bool check = true); + void UpdateMainPage(); + void UpdateContrastEnhancementPage(); + void UpdateChannelSelectionPage(); + void UpdateColorMapPage(); + void GetCoverageInfos(); + bool UpdateStyle(); +public: + QuickStyleRasterDialog() + {; + } + virtual ~ QuickStyleRasterDialog() + { + if (Style != NULL) + delete Style; + } + bool Create(MyMapPanel * parent, MapLayer * layer); + void CreateButtons(); + bool ConfigChanged() + { + return IsConfigChanged; + } + void OnQuit(wxCommandEvent & event); + void OnOk(wxCommandEvent & event); + void OnApply(wxCommandEvent & event); + void OnExport(wxCommandEvent & event); + void OnCopy(wxCommandEvent & event); + void OnPageChanging(wxNotebookEvent & event); + void OnPageChanged(wxNotebookEvent & event); + void OnCmdScaleChanged(wxCommandEvent & event); + void OnCmdContrastChanged(wxCommandEvent & event); + void OnCmdBandModeChanged(wxCommandEvent & event); + void OnCmdColorMapModeChanged(wxCommandEvent & event); + void OnCmdColorMinChanged(wxCommandEvent & event); + void OnCmdMinColorPicker(wxCommandEvent & event); + void OnCmdColorMaxChanged(wxCommandEvent & event); + void OnCmdMaxColorPicker(wxCommandEvent & event); + void OnShadedChanged(wxCommandEvent & event); +}; class QuickStyleTopologyDialog:public wxPropertySheetDialog { // // a dialog for configuring a Quick Style (Topology) @@ -15416,10 +16352,11 @@ CachedFrame *CachedEdgeSeeds; CachedFrame *CachedLinkSeeds; CachedFrame *CachedFaceSeeds; QuickStyleObj *QuickStyle; QuickStyleTopologyObj *QuickStyleTopology; + QuickStyleRasterObj *QuickStyleRaster; MapLayer *Prev; MapLayer *Next; public: MapLayer(LayerListItem * layer); ~MapLayer(); @@ -15432,21 +16369,30 @@ return QuickStyle; } QuickStyleTopologyObj *GetQuickStyleTopology() { return QuickStyleTopology; + } + QuickStyleRasterObj *GetQuickStyleRaster() + { + return QuickStyleRaster; } QuickStyleObj *CloneQuickStyle() { return QuickStyle->Clone(); } QuickStyleTopologyObj *CloneQuickStyleTopology() { return QuickStyleTopology->Clone(); + } + QuickStyleRasterObj *CloneQuickStyleRaster() + { + return QuickStyleRaster->Clone(); } bool UpdateQuickStyle(QuickStyleObj * style); bool UpdateQuickStyle(QuickStyleTopologyObj * style); + bool UpdateQuickStyle(QuickStyleRasterObj * style); WmsLayerSettings *GetWmsConfig() { return WmsConfig; } RasterLayerConfig *GetRasterConfig() @@ -15675,10 +16621,14 @@ bool Changed; wxTreeItemId Root; // the root node wxImageList *Images; // the images list wxTreeItemId CurrentItem; // the tree item holding the current context menu wxTreeItemId DraggedItem; // the tree item to be moved + void DoWmsSqlSample(MapLayer * lyr); + void DoWmsUrlSample(MapLayer * lyr); + void DoVectorSqlSample(MapLayer * lyr); + void DoRasterSqlSample(MapLayer * lyr); public: MyLayerTree() {; } MyLayerTree(MyMapPanel * parent, wxWindowID id = wxID_ANY); @@ -15707,10 +16657,12 @@ void OnCmdHideAll(wxCommandEvent & event); void OnCmdMapConfigure(wxCommandEvent & event); void OnCmdVisible(wxCommandEvent & event); void OnCmdMapFullExtent(wxCommandEvent & event); void OnCmdMapLayerFullExtent(wxCommandEvent & event); + void OnCmdMapSqlSample(wxCommandEvent & event); + void OnCmdMapUrlSample(wxCommandEvent & event); void OnCmdRemoveLayer(wxCommandEvent & event); void OnCmdDeleteItem(wxCommandEvent & event); void OnCmdLayerInfo(wxCommandEvent & event); void OnCmdMapLayerConfigure(wxCommandEvent & event); void OnCmdQuickStyleEdit(wxCommandEvent & event); @@ -15835,11 +16787,11 @@ UnusedThreads = NULL; NumThreads = 0; } void PrepareThreadsPool(int count); int FindUnusedThread(); - void ReleaseThread(int index, SingleLayerPainter * lyr); + void ReleaseThread(int index); }; class MyMapView:public wxPanel { // @@ -15926,10 +16878,12 @@ } void EnableMultiThreading(bool mode) { MultiThreadingEnabled = mode; } + int GetImageWidth(); + int GetImageHeight(); double GetMapMinX() { return MapMinX; } double GetMapMinY() @@ -15958,10 +16912,12 @@ } double GetGeoMaxY() { return GeoMaxY; } + void DoPrepareBBox(wxString & bbox); + void GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy); MapLayer *GetFirstLayer() { return FirstLayer; } bool IsMultiThreadingEnabled() @@ -16221,10 +17177,26 @@ } void UpdateMapViewPoint(int fromSrid, int toSrid) { MapView->UpdateMapViewPoint(fromSrid, toSrid); } + int GetImageWidth() + { + return MapView->GetImageWidth(); + } + int GetImageHeight() + { + return MapView->GetImageHeight(); + } + void DoPrepareBBox(wxString & bbox) + { + MapView->DoPrepareBBox(bbox); + } + void GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy) + { + MapView->GetBBox(srid, minx, miny, maxx, maxy); + } double GetMapMinX() { return MapView->GetMapMinX(); } double GetMapMinY() Index: Dialogs.cpp ================================================================== --- Dialogs.cpp +++ Dialogs.cpp @@ -2,11 +2,11 @@ / Dialogs.cpp / various dialog classes / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -4223,11 +4223,11 @@ sql += wxT(", '::with-triggers::'"); if (Resequence->GetValue() == true) sql += wxT(", '::resequence::'"); if (Append->GetValue() == true) sql += wxT(", '::append::'"); - for (int i = 1; i < ignoreCtrl->GetCount(); i++) + for (unsigned int i = 1; i < ignoreCtrl->GetCount(); i++) { if (ignoreCtrl->IsSelected(i) == true) { wxString str = ignoreCtrl->GetString(i); xname = (char *) malloc((str.Len() * 4) + 1); @@ -4236,11 +4236,11 @@ free(xname); sql += wxT(", '::ignore::") + wxString::FromUTF8(xname2) + wxT("'"); free(xname2); } } - for (int i = 1; i < castCtrl->GetCount(); i++) + for (unsigned int i = 1; i < castCtrl->GetCount(); i++) { if (castCtrl->IsSelected(i) == true) { wxString str = castCtrl->GetString(i); xname = (char *) malloc((str.Len() * 4) + 1); @@ -4307,19 +4307,31 @@ OneWayFromTo = wxT(""); OneWayToFrom = wxT(""); NameColumn = wxT(""); DataTable = wxT(""); VirtualTable = wxT(""); - if (wxDialog::Create(parent, wxID_ANY, wxT("Build Network")) == false) + Overwrite = false; + if (wxDialog::Create(parent, wxID_ANY, wxT("Create Network")) == false) return false; // populates individual controls CreateControls(); // sets dialog sizer GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); // centers the dialog window Centre(); + wxString table; + if (MainFrame->GetCurrentlySelectedTable(table) == true) + { + // automatically selecting the current table + wxListBox *tableCtrl = (wxListBox *) FindWindow(ID_NET_TABLE); + int sel = tableCtrl->FindString(table); + if (sel != wxNOT_FOUND) + tableCtrl->SetSelection(sel); + TableName = table; + SetCurrentTable(); + } return true; } void NetworkDialog::CreateControls() { @@ -4349,18 +4361,10 @@ tables, wxLB_SINGLE | wxLB_HSCROLL); delete[]tables; tableNameSizer->Add(tableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); size = wxSize(140, 80); wxSize size2 = wxSize(140, 60); - wxString table; - if (MainFrame->GetCurrentlySelectedTable(table) == true) - { - // automatically selecting the current table - int sel = tableCtrl->FindString(table); - if (sel != wxNOT_FOUND) - tableCtrl->SetSelection(sel); - } // the NodeFrom COLUMN wxBoxSizer *netSizer = new wxBoxSizer(wxHORIZONTAL); row0Sizer->Add(netSizer, 0, wxALIGN_RIGHT | wxALL, 0); wxStaticBox *netBox = new wxStaticBox(this, wxID_STATIC, wxT("Network configuration"), @@ -4544,27 +4548,36 @@ boxSizer->Add(outSizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); wxStaticBox *outTablesBox = new wxStaticBox(this, wxID_STATIC, wxT("Output Tables"), wxDefaultPosition, wxDefaultSize); - wxBoxSizer *outTablesSizer = new wxStaticBoxSizer(outTablesBox, wxHORIZONTAL); + wxBoxSizer *outTablesSizer = new wxStaticBoxSizer(outTablesBox, wxVERTICAL); outSizer->Add(outTablesSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *out1Sizer = new wxBoxSizer(wxHORIZONTAL); + outTablesSizer->Add(out1Sizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); wxStaticText *dataTableLabel = new wxStaticText(this, wxID_STATIC, wxT("&binary data Table:")); - outTablesSizer->Add(dataTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); + out1Sizer->Add(dataTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); wxTextCtrl *dataTableCtrl = new wxTextCtrl(this, ID_NET_DATA, wxT(""), wxDefaultPosition, wxSize(150, 22)); - outTablesSizer->Add(dataTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - outTablesSizer->AddSpacer(15); + out1Sizer->Add(dataTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + out1Sizer->AddSpacer(15); wxStaticText *virtualTableLabel = new wxStaticText(this, wxID_STATIC, wxT("&VirtualNetwork Table:")); - outTablesSizer->Add(virtualTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); + out1Sizer->Add(virtualTableLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); wxTextCtrl *virtualTableCtrl = new wxTextCtrl(this, ID_NET_VIRTUAL, wxT(""), wxDefaultPosition, wxSize(150, 22)); - outTablesSizer->Add(virtualTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + out1Sizer->Add(virtualTableCtrl, 0, wxALIGN_RIGHT | wxALL, 5); +// Overwrite existing output tables + wxBoxSizer *out2Sizer = new wxBoxSizer(wxHORIZONTAL); + outTablesSizer->Add(out2Sizer, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 0); + wxCheckBox *overwrite = new wxCheckBox(this, ID_NET_OVERWRITE, + wxT + ("&Overwrite existing output tables")); + out2Sizer->Add(overwrite, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 1); // OK - CANCEL buttons wxBoxSizer *okCancelBox = new wxBoxSizer(wxHORIZONTAL); boxSizer->Add(okCancelBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); wxButton *ok = new wxButton(this, wxID_OK, wxT("&OK")); okCancelBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); @@ -4584,19 +4597,29 @@ (wxObjectEventFunction) & NetworkDialog::OnOneWay); Connect(ID_NET_NAME_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) & NetworkDialog::OnNameEnabled); Connect(ID_NET_NO_GEOM, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) & NetworkDialog::OnNoGeometry); + Connect(ID_NET_OVERWRITE, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & NetworkDialog::OnOverwrite); } void NetworkDialog::OnTable(wxCommandEvent & WXUNUSED(event)) { // // TABLE selection changed // wxListBox *tableCtrl = (wxListBox *) FindWindow(ID_NET_TABLE); TableName = tableCtrl->GetStringSelection(); + SetCurrentTable(); +} + +void NetworkDialog::SetCurrentTable() +{ +// +// The currently selected Table changed +// wxTextCtrl *dataTableCtrl = (wxTextCtrl *) FindWindow(ID_NET_DATA); wxString data_table = TableName + wxT("_net_data"); dataTableCtrl->SetValue(data_table); wxTextCtrl *virtualTableCtrl = (wxTextCtrl *) FindWindow(ID_NET_VIRTUAL); wxString net_table = TableName + wxT("_net"); @@ -4777,10 +4800,21 @@ GeomLength = false; costSel->SetSelection(1); costCtrl->Enable(true); } } + +void NetworkDialog::OnOverwrite(wxCommandEvent & WXUNUSED(event)) +{ +// +// Overwrite check box +// + if (Overwrite == true) + Overwrite = false; + else + Overwrite = true; +} void NetworkDialog::OnOk(wxCommandEvent & WXUNUSED(event)) { // // all done: @@ -6682,11 +6716,10 @@ int rows; int columns; char *value; wxSpinCtrl *sridNewCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_NEW); wxSpinCtrl *sridOldCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_OLD); - wxButton *ok = (wxButton *) FindWindow(wxID_OK); int newSrid = sridNewCtrl->GetValue(); int oldSrid = sridOldCtrl->GetValue(); int inserted = 0; char *sql = @@ -6937,11 +6970,10 @@ int rows; int columns; char *value; wxSpinCtrl *sridNewCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_NEW); wxSpinCtrl *sridOldCtrl = (wxSpinCtrl *) FindWindow(ID_ADDALL_SRID_OLD); - wxButton *ok = (wxButton *) FindWindow(wxID_OK); int newSrid = sridNewCtrl->GetValue(); int oldSrid = sridOldCtrl->GetValue(); int inserted = 0; char *sql = Index: DialogsGraph.cpp ================================================================== --- DialogsGraph.cpp +++ DialogsGraph.cpp @@ -2,11 +2,11 @@ / DialogsGraph.cpp / graphics dialog classes / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2010-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by Index: Exif.cpp ================================================================== --- Exif.cpp +++ Exif.cpp @@ -2,11 +2,11 @@ / Exif.cpp / methods related to EXIF import and XmlBLOB import/export / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -2331,27 +2331,23 @@ { for (i = 1; i <= rows; i++) { const char *name; bool ok_id = false; - bool ok_name = false; bool ok_photo = false; bool ok_width = false; bool ok_height = false; bool ok_timestamp = false; bool pKey = false; - bool ok_pk = false; bool err_pk = false; name = results[(i * columns) + 1]; if (atoi(results[(i * columns) + 5]) == 0) pKey = false; else pKey = true; if (strcasecmp(name, "id") == 0) ok_id = true; - if (strcasecmp(name, "name") == 0) - ok_name = true; if (strcasecmp(name, "photo") == 0) ok_photo = true; if (strcasecmp(name, "width") == 0) ok_width = true; if (strcasecmp(name, "heigth") == 0) @@ -2358,13 +2354,11 @@ ok_height = true; if (strcasecmp(name, "timestamp") == 0) ok_timestamp = true; if (pKey == true) { - if (strcasecmp(name, "id") == 0) - ok_pk = true; - else + if (strcasecmp(name, "id") != 0) err_pk = true; } if (ok_id == true && pKey != true) err_pk = true; if (err_pk == true) @@ -2592,11 +2586,10 @@ // importing a single EXIF-GPS image into the DB Table // sqlite3_int64 val64; int ret; wxString timestamp; - char *errMsg = NULL; double longitude; double latitude; gaiaGeomCollPtr geom; bool ok; unsigned char *geoblob; ADDED HtmlHelp.cpp Index: HtmlHelp.cpp ================================================================== --- HtmlHelp.cpp +++ HtmlHelp.cpp @@ -0,0 +1,5443 @@ +/* +/ HtmlHelp.cpp +/ spatialite_gui HTML Help generator +/ +/ This code was autogenerated by "helpgen" on xxxxx +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2017 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include "Classdef.h" + +#include + +void MyFrame::GetHelp(wxString & html_text) +{ +// +// return the HTML Help Page from the ZIP compressed data +// + unsigned char *zip_buf = NULL; + int uncompressed_len = 595001; + int compressed_len = 67145; + uLong inLen = compressed_len; + uLong outLen = uncompressed_len; + const Bytef *in; + Bytef *out; + char *html = NULL; + +// allocating the ZIP compressed buffer + zip_buf = (unsigned char *) malloc(uncompressed_len); + if (zip_buf == NULL) + goto error; + +// feeding the ZIP compressed buffer + FeedZipHtml(zip_buf, 0, "789cecbd6977e338b228f8b9ea5770f29ed725bff6927666f7"); + FeedZipHtml(zip_buf, 25, + "adcec5ef386da7cb5ddeaeadaccae5e4f1a12448622545aa49"); + FeedZipHtml(zip_buf, 50, + "ca4bcdbcff3eb100204882142553b25de99a797dd302080462"); + FeedZipHtml(zip_buf, 75, + "4320108878f3ffec9deeb63f9ded3bbfb48f8f9cb30fef8e0e"); + FeedZipHtml(zip_buf, 100, + "779d676b1b1bbfbfd8ddd8d86bef71c3cbf5e79b4e3b7283d8"); + FeedZipHtml(zip_buf, 125, + "4bbc3070fd8d8dfd9367db3fbe1926237ffbcd50b8bded1f7f"); + FeedZipHtml(zip_buf, 150, + "f8e1cd4824aed30d834404c9db6789b84936b0c76ba73b74a3"); + FeedZipHtml(zip_buf, 175, + "58246f3fb4dfaffdfccc1926c9784dfc67e25dbd7d26bbaf25"); + FeedZipHtml(zip_buf, 200, + "b763f18c4649bcc417db176337f1dc232f11cec5ff1c39fd49"); + FeedZipHtml(zip_buf, 225, + "d0c5b96327127d1189a02b1cdf8b93371bdc1d3f8c935b5f38"); + FeedZipHtml(zip_buf, 250, + "38909cbc1bc734e40fc32de7ffed867e18bd0adcabdbd70eb6"); + FeedZipHtml(zip_buf, 275, + "aeb9be37085e75617211bdfebf0ef57ba1fa75fc89903f76f4"); + FeedZipHtml(zip_buf, 300, + "6f51781dbcfebff89b97190f7f7ab341d3c3746f3608216f3a"); + FeedZipHtml(zip_buf, 325, + "61efd6e90ca8dfdb67ffd5c7ff9e13d636b7db6e07400dfbce"); + FeedZipHtml(zip_buf, 350, + "2e2f3f868f36a169e2c3fff8def61bd719c242e1b398f0e003"); + FeedZipHtml(zip_buf, 375, + "1e2ee3fff8cf4af1f266c3dd7eb3019fe6be8fdc18d687df6f"); + FeedZipHtml(zip_buf, 400, + "f100e7f4030eb0553ac206c0f1a61301692384770bc70bdc11"); + FeedZipHtml(zip_buf, 425, + "e0b5029c97ebff587fbed61357c2ff5bd089c7afe7fbdf6a6a"); + FeedZipHtml(zip_buf, 450, + "2388000f221c7105a4c82ef74a44317c0880c130bff11fce61"); + FeedZipHtml(zip_buf, 475, + "d00f9d2f6ed0733a13cfef39e198074f449c78c1e0ab0d0785"); + FeedZipHtml(zip_buf, 500, + "9107221091d77db67dc0ff20e44d120f70715b6f003fecb880"); + FeedZipHtml(zip_buf, 525, + "b203fabf0ec8034e1e3b6311a1d0048246a8182006914154f0"); + FeedZipHtml(zip_buf, 550, + "e2521c8ddcc01b4f7c1787732e64a72a48466e32e441f05fb5"); + FeedZipHtml(zip_buf, 575, + "8017511446f98923310e239af560fff4c2d970cedbedd3b353"); + FeedZipHtml(zip_buf, 600, + "873ac70e22fcda8d025c65c5d0be0806c9f0b27b95f0f8fcf7"); + FeedZipHtml(zip_buf, 625, + "460fe8ed22e1278197ac018224696b81db1bc5e980b66f9d7e"); + FeedZipHtml(zip_buf, 650, + "148e9cbdbd8dbde30b270813977f6df96130f092494f6c203e"); + FeedZipHtml(zip_buf, 675, + "f11f2b15d37480943c4781119c7e1839ef8e4edf3961e70f20"); + FeedZipHtml(zip_buf, 700, + "6d15b4e3e765837c09c2600df1d073a3de571a732042d0b3c8"); + FeedZipHtml(zip_buf, 725, + "803506decc930c47007cc44934e912e5dcc280cec0bb1281e3"); + FeedZipHtml(zip_buf, 750, + "25b1f3bbf0fdb56f01a83da70d2ad33917e348c4a0afdc29ac"); + FeedZipHtml(zip_buf, 775, + "3ade6a6ce2775ee046b7334cfdc23675d8495c0f39d14986a2"); + FeedZipHtml(zip_buf, 800, + "b0ae8da913a2ae2e425c09c6c88bbb7950e2c958898cb80913"); + FeedZipHtml(zip_buf, 825, + "18281d12c00471ac24e7cbfc780018ee77ce018f725bf13108"); + FeedZipHtml(zip_buf, 850, + "abeb1544d84d12311a134049e8701fd00a3e02237a6a5caf52"); + FeedZipHtml(zip_buf, 875, + "9d74c311a22ae6b115286beae7ba32db858d293704ad0d7f47"); + FeedZipHtml(zip_buf, 900, + "f86ac9bd378ad7d2816077ea8a35f85104312d7796b1c6ff28"); + FeedZipHtml(zip_buf, 925, + "c3f659e80595b4ff67d997bb93e84a385f8ebc00b69e082101"); + FeedZipHtml(zip_buf, 950, + "de3cc73da86ab8ff2e1b0ec7b9a071aa3effb9ecf38b49d407"); + FeedZipHtml(zip_buf, 975, + "04395fce42ff76804c5e03987f95638506a95447cfab187837"); + FeedZipHtml(zip_buf, 1000, + "f4fda99be078b3a0d392a19bd05eeeb8e37114de782046c291"); + FeedZipHtml(zip_buf, 1025, + "960af0b4cfca7de88d63e7ca739de377e7d54ab3a0bcd219ac"); + FeedZipHtml(zip_buf, 1050, + "a3560e6655477a73ab3f4e41f609286f34f605b0770a5908f6"); + FeedZipHtml(zip_buf, 1075, + "849bc0fe5b3d5a67d6e19c2fb4c9c763d1f5faa8ae849b4c40"); + FeedZipHtml(zip_buf, 1100, + "be2b9965f3654105d69cc7ed5d21827a75e7e9cd3e8fb456ea"); + FeedZipHtml(zip_buf, 1125, + "4d505006bca185510fb60b60b7048f47acc2a7e995cd7f8cfd"); + FeedZipHtml(zip_buf, 1150, + "495cb135ecf4fb20d87ce24a87247bea200a27f07ff0d81085"); + FeedZipHtml(zip_buf, 1175, + "3e6ba2eac90aba080167b3dd5f3b8613db9e0ba7361c5bfd78"); + FeedZipHtml(zip_buf, 1200, + "18f4c48d33849ffc299a65f39f78e4ebc2007e38a85810eeb9"); + FeedZipHtml(zip_buf, 1225, + "38d52ef7a4d988f381be17b8c18256ee4e59061daf2ae6b838"); + FeedZipHtml(zip_buf, 1250, + "dadbb8d887e1a05bcf39726fc51411f8a717e336e3568c7978"); + FeedZipHtml(zip_buf, 1275, + "714a70f700eeeab1fabd303f8ee63d1ce9fddee9c6e9c1b983"); + FeedZipHtml(zip_buf, 1300, + "9b22acb743865ef59083f1b7024e33639e1eeca2de3c73bbdf"); + FeedZipHtml(zip_buf, 1325, + "dc819861e8c27e822c71dc8976ddee50ac75dc181008a78829"); + FeedZipHtml(zip_buf, 1350, + "dbfe78b3b0b1e038e7ffbb1d89dc284e4b6de9ceaeebfb1d80"); + FeedZipHtml(zip_buf, 1375, + "38aeb2ab6f46fe3b6d5a5b29f3117a80715d755a8abc824e30"); + FeedZipHtml(zip_buf, 1400, + "d9e5fc70cff102546753769c241cc3117e705b31585b7659ab"); + FeedZipHtml(zip_buf, 1425, + "61870522b90ea36f75463be1ae15835d8faaf4c8ef70b641d6"); + FeedZipHtml(zip_buf, 1450, + "8dc349547d22c45ebe5765ae929638f2ba6049558ea4f4f6b3"); + FeedZipHtml(zip_buf, 1475, + "6db47fc1aa7603114ee2549f97f81c8af4fb8f0f9bb904e90c"); + FeedZipHtml(zip_buf, 1500, + "fe257aa8a55741c2c308c6497f62e5c5bffee6461efa56e254"); + FeedZipHtml(zip_buf, 1525, + "bf94cd475e0e7238913326f5d4882de18aad674e0794bb801f"); + FeedZipHtml(zip_buf, 1550, + "369f39b890b1db035d3f78fb6c8bff861da5abfebef67ac910"); + FeedZipHtml(zip_buf, 1575, + "7a3e7ffebfd8e3f42641f7cff69b2482ffd703d9c4eec1db67"); + FeedZipHtml(zip_buf, 1600, + "ff78e690dfe9ed33763c3d333d44cfc5f3ee73fefe8737c317"); + FeedZipHtml(zip_buf, 1625, + "a9d7a511af060eb891f4f07f22092302373420e83dc7ffefd9"); + FeedZipHtml(zip_buf, 1650, + "f67bf925741d4a70acfd2e6ee1787493eda597fae299ed8bc9"); + FeedZipHtml(zip_buf, 1675, + "68e4a27cc0273940d065b66df897e4a2df6c74186e3943cfd2"); + FeedZipHtml(zip_buf, 1700, + "a7e55c855ecf59715e396fbc6d65117bd9ef4cc8b623017b3e"); + FeedZipHtml(zip_buf, 1725, + "5909a03827518426024c9fbab3705a47b90d5ce031721a3ab1"); + FeedZipHtml(zip_buf, 1750, + "1cbb88c73cf8891b0d4472d91d4f2a5790765bd422da3483b3"); + FeedZipHtml(zip_buf, 1775, + "7bf6a1fe3afaa0c26ffc721264db1b83fc3d0cfbf1a81af51d"); + FeedZipHtml(zip_buf, 1800, + "06f6871f60af39f97074e4787d87bf73bc580de6df3a93406a"); + FeedZipHtml(zip_buf, 1825, + "2fd12b5d2628983f5e96af32d3dcd822cfce4fffbdfe72f645"); + FeedZipHtml(zip_buf, 1850, + "f277b32f7220c2b87c8d666b634b440b7ef60592dd3ff3f2a2"); + FeedZipHtml(zip_buf, 1875, + "0437e8f20566db1b5b221f1e665fa43c74ccbc4cdfeb8055b4"); + FeedZipHtml(zip_buf, 1900, + "55bece5c87c6167ae4753e1e1f6dcdbe52f9e1ec4bfdc58d0f"); + FeedZipHtml(zip_buf, 1925, + "d1675b5ca36ac92eee5d18fac20daa57d73effb08f50e1eae0"); + FeedZipHtml(zip_buf, 1950, + "042522ff16cd1ac05a84debe6b58126ea38923023007b00920"); + FeedZipHtml(zip_buf, 1975, + "39dc3d3df94d835102ebb19b0c615fb6422bdb9605eff14efb"); + FeedZipHtml(zip_buf, 2000, + "1713941288c14ad566b8156cb3c3b26007e9dfdd393a7ab7b3"); + FeedZipHtml(zip_buf, 2025, + "fbebc5b40580edf78715706c5816c0a88f6b60ba14c3cbc4ec"); + FeedZipHtml(zip_buf, 2050, + "548c223c3bd2442f0558755826e03b7bbfed9ceceeefd55940"); + FeedZipHtml(zip_buf, 2075, + "3b9a04df4aa1a7d665820e1f9efc5a07ee7301ca3172d1a75c"); + FeedZipHtml(zip_buf, 2100, + "02bbeeb14cf8cff7f74fdae73b27ed3a6b380dfcdbe9ebc8f4"); + FeedZipHtml(zip_buf, 2125, + "5ae65a4e4f8e3ed55ecf79824770eb22b8695990a7464615b8"); + FeedZipHtml(zip_buf, 2150, + "c60e5d8057b62d0be03c282510ef8fe381155c6c5816acfb67"); + FeedZipHtml(zip_buf, 2175, + "1707d3004d0f240550b96959c0be07e6fd58676397dec03209"); + FeedZipHtml(zip_buf, 2200, + "94cd4b13bd0c40ca9fe4b4b0e9ec5742ff4ae58276cfec2bd9"); + FeedZipHtml(zip_buf, 2225, + "3d2b5fc2501aa30efc877dc9652e3de6ec307796b67ebbbb3e"); + FeedZipHtml(zip_buf, 2250, + "8f8a83b3a998504e412b3a54e3b2966502e3b4584bada82559"); + FeedZipHtml(zip_buf, 2275, + "5771570f9835fae6313ab876dd18b6904358f940444562669a"); + FeedZipHtml(zip_buf, 2300, + "819cae3f11484bb96ca4a522af1ea3eea10e786f3c49e498e3"); + FeedZipHtml(zip_buf, 2325, + "308ebd0e9cc8f04a5cf4f0f61ffbc841c96d4cd7efaff4792e"); + FeedZipHtml(zip_buf, 2350, + "08cd481a38d5c921c47a29dff26af6c209f42a5b2bb7562f95"); + FeedZipHtml(zip_buf, 2375, + "fb38e348743d3efd36b966397a934bc6a892b205635bf572f9"); + FeedZipHtml(zip_buf, 2400, + "6b43934dfd70d5f95344e1e5d8ede538a330646358a3c099d9"); + FeedZipHtml(zip_buf, 2425, + "70a6bc04877dc70da4bfdaf51d371a4c46d2dba096419a053f"); + FeedZipHtml(zip_buf, 2450, + "7663bc47422f370396c205ad613fc3b461a4688920ad625b40"); + FeedZipHtml(zip_buf, 2475, + "1d786d308e0cbab8f67cdfe9c0d2dc5e0f7e9dc41490143ba3"); + FeedZipHtml(zip_buf, 2500, + "49778837b91e29bacffbe7a7b11387b86211c49348c8c1fe33"); + FeedZipHtml(zip_buf, 2525, + "f1f0ae8103d5a6b1025e6495b102b655b3027f2d59c199f2df"); + FeedZipHtml(zip_buf, 2550, + "d441579da1b8b96424663788c27c8df109c5c0a57c32751172"); + FeedZipHtml(zip_buf, 2575, + "2fb27287865eb1472c129c07b724d8c7e8d73c9b285a8b1bbc"); + FeedZipHtml(zip_buf, 2600, + "ea63b8ba611489781c06f417f0e22fe2c6dd03e532c2c04ce2"); + FeedZipHtml(zip_buf, 2625, + "915547ac0fd671e4e79b6ee7e77fedbfc7d15f33783033f0e5"); + FeedZipHtml(zip_buf, 2650, + "6444303a7de09798998d8440cda8b86ebd16f1eea073de8751"); + FeedZipHtml(zip_buf, 2675, + "57ecc42713df2f729ad1485cb159640af8752bf7ab6407e397"); + FeedZipHtml(zip_buf, 2700, + "728e00a001081c9a0880b2ca7fb3d3d005b9019101ccb6b009"); + FeedZipHtml(zip_buf, 2725, + "30dd454fa094dd18b6f7943d56ec187c4d81d83f84f04174ed"); + FeedZipHtml(zip_buf, 2750, + "c522335fbeb3e376e2d09f2482dc8d4908322d35489c60570a"); + FeedZipHtml(zip_buf, 2775, + "eb8bae50c231d4308cbc81078c66405121d2917013f1e1c3e1"); + FeedZipHtml(zip_buf, 2800, + "9e45a4755bd60cabaf7a5d7db7f7d269c109b9178e561c1c10"); + FeedZipHtml(zip_buf, 2825, + "ac44752f8ab1f3af363644b07eed7df3c6a2e7b9eb6134d8c0"); + FeedZipHtml(zip_buf, 2850, + "bf363e041e328eebfbb79793c0fbcf445c7a3d8c16e87b6068"); + FeedZipHtml(zip_buf, 2875, + "6d1bcd0e373b6933da502be52b3fdefbc7ee5074bf01d71797"); + FeedZipHtml(zip_buf, 2900, + "6e34b658e0ff3fa7bdffb13ddfee536fad30e7339cd8e96ab0"); + FeedZipHtml(zip_buf, 2925, + "dc6d43b26548634e1dd026f43bb201cf889c842c479c84e10b"); + FeedZipHtml(zip_buf, 2950, + "1870cb61bbfc6f5a060d50899b7698b87e2582323dee8825d7"); + FeedZipHtml(zip_buf, 2975, + "e94e4614f17d251c1307b43c80e8cd64db1d0c2231c0d0a4be"); + FeedZipHtml(zip_buf, 3000, + "367627db9527c8fda01bf6c48773cb815737b59c49e49bd096"); + FeedZipHtml(zip_buf, 3025, + "1a2d3f547cb3aa9e84548ed420b79c89088f1b6b026102d678"); + FeedZipHtml(zip_buf, 3050, + "b63de65f1cfa0514042dbb090ef202e807e2cf4cc3a8508f15"); + FeedZipHtml(zip_buf, 3075, + "7ee02807827bb2cda3d2c413dace5cffdabd957b0bef54a0d7"); + FeedZipHtml(zip_buf, 3100, + "5c9a829ecef0c991f6a7751d36911d339c24e6a04a39f29682"); + FeedZipHtml(zip_buf, 3125, + "db1fecd9bc264501851215da077d3ab78cdaceb6ec241539ef"); + FeedZipHtml(zip_buf, 3150, + "c4a92107ffd18e9518df666055d3ab15c1c03dd177277e62c2"); + FeedZipHtml(zip_buf, 3175, + "cfef4dcab812f6e532aed44d337065f9370d31a5eb8c7dd70b"); + FeedZipHtml(zip_buf, 3200, + "9004fcca0077992c5765788f88d9184f95d05f7256ba47c633"); + FeedZipHtml(zip_buf, 3225, + "f25596578b6c452b7d546ce54527607bbc07b8cfdc646861ae"); + FeedZipHtml(zip_buf, 3250, + "6c87d61d7634180a6ccf30ba757044c6952b637f4183038195"); + FeedZipHtml(zip_buf, 3275, + "cde2e054e8f2988d25d09ac21fdde0d689294810ce36c9d0f1"); + FeedZipHtml(zip_buf, 3300, + "ddee377e6ca141a83023c1447ceff9a21a2db65e77c10d8ee7"); + FeedZipHtml(zip_buf, 3325, + "e0808c9b961774fd09310e30a8b802c640d3913aecdf241cc8"); + FeedZipHtml(zip_buf, 3350, + "bfb2601422eed885982250835881c0e9c86b127129cec4cda3"); + FeedZipHtml(zip_buf, 3375, + "c619c0588d32a3c39d31a611729ff8c0b9aef1c008a7bd1420"); + FeedZipHtml(zip_buf, 3400, + "3cecf19ba3727c0998ae8824fcb5e57c2494007a68e3fa0256"); + FeedZipHtml(zip_buf, 3425, + "d6a7cc2fb591b68f960e45b50ff99929c57a78b4fa8f38fbba"); + FeedZipHtml(zip_buf, 3450, + "e39c333ed8231283ea8d57a523453a59a0ef2756f08cfd588c"); + FeedZipHtml(zip_buf, 3475, + "5d0abdcf3882742f74e78cbc04f6121c0774bb8383f9f490a3"); + FeedZipHtml(zip_buf, 3500, + "cbdb0a1c1c45643f4defdf8c7dafebe1c1523eaca4394570e5"); + FeedZipHtml(zip_buf, 3525, + "456140fe832b191a4a2172673bedc39da3c3f6fee5c5feee87"); + FeedZipHtml(zip_buf, 3550, + "f3c3f6a7b7c80737427b9e8c53a4f6f878f844a62722f208f5"); + FeedZipHtml(zip_buf, 3575, + "fb183a7c851dc8372ed831a0ac6d938426a44d39c467784dfa"); + FeedZipHtml(zip_buf, 3600, + "281ce3fb84c383f1b7c131d867b61388d9de4246c653b6c9d8"); + FeedZipHtml(zip_buf, 3625, + "eaef0ac60e3838589a2107221ccbe8f9919a54f1269c920d44"); + FeedZipHtml(zip_buf, 3650, + "c6407b0f633691c112374ac8e6f062792782e3e185160db3ca"); + FeedZipHtml(zip_buf, 3675, + "6f4f86ae36e8d99017298f32c3f4480780be8e80c506c462a9"); + FeedZipHtml(zip_buf, 3700, + "6cecabfb163d2e71a5a3e3a7a48bcc090318507acdd2402b09"); + FeedZipHtml(zip_buf, 3725, + "3a74db7bb7d6f7d87b8eaa05c7a0217df736ac3ad5eed1ea2a"); + FeedZipHtml(zip_buf, 3750, + "2892eb302749e42895342903f14024e5e0198d56d03a75aec7"); + FeedZipHtml(zip_buf, 3775, + "cee5f6617a1825aeedb066c3dd249d579d8cebeafdced1c5fe"); + FeedZipHtml(zip_buf, 3800, + "9493b8c2ecce683cf43a5e3889a78945b667e302e2eae11b90"); + FeedZipHtml(zip_buf, 3825, + "95dc60cd480c9c524e420c7a9e6cb3f352090ea180dc92f2c7"); + FeedZipHtml(zip_buf, 3850, + "c25a3c76538e266838e16c6850c5641470547d2d319946abd2"); + FeedZipHtml(zip_buf, 3875, + "aecd8b8e8d5a53a4681af4d66e4b902ccb529a11b20b91489f"); + FeedZipHtml(zip_buf, 3900, + "ff597ab1985fb5a513add92bdeb1d590ae8c95c2740b26a30e"); + FeedZipHtml(zip_buf, 3925, + "de5df5e108cb17103d6f802e83160c99b9f15c915201a23406"); + FeedZipHtml(zip_buf, 3950, + "e5cde75e5c47fb7227a6cbc1156d961a2f13c96b15bf621b4c"); + FeedZipHtml(zip_buf, 3975, + "a61250c7656d2c7944887fd2f7593852f93a83e3369f3168da"); + FeedZipHtml(zip_buf, 4000, + "00bd8b2022f48d0694cfe6ee2409f1d96297a409361e7c9d23"); + FeedZipHtml(zip_buf, 4025, + "3d69a41af200a4b3b499018c271220e77cb3036cc5c30fc300"); + FeedZipHtml(zip_buf, 4050, + "d648e6965a0099ddd0d4f7434e8431c6580bb9f802e242365c"); + FeedZipHtml(zip_buf, 4075, + "e36e2444502edb077538c4d2c92a155e9dfbfaf3621036330b"); + FeedZipHtml(zip_buf, 4100, + "e24411666c0293626ea7822adacfcf4317b0bf88988dca7c25"); + FeedZipHtml(zip_buf, 4125, + "a13d5fc9a33055d5c22e03103aeb792cdfc36901aaff738978"); + FeedZipHtml(zip_buf, 4150, + "b139176b8572c81774c4cca81f706879c749c73439a5ba2b0f"); + FeedZipHtml(zip_buf, 4175, + "1cf3e89bbaaed9375676a4f5fa24de94c1c509bbc482bd7201"); + FeedZipHtml(zip_buf, 4200, + "d1ebc48ed598903d9ac0446161b031c4092ca7cbe2c2c93eb4"); + FeedZipHtml(zip_buf, 4225, + "7ecc13c3509319c46919e10fbd6d052841530775f587235b87"); + FeedZipHtml(zip_buf, 4250, + "0d990ea8203cf14237013055f84af4427c379ec277b28763d5"); + FeedZipHtml(zip_buf, 4275, + "44cb43722dac9593288724dc4d66411368b76a2c718732965c"); + FeedZipHtml(zip_buf, 4300, + "4d83282c1135b590a87779fda0c6dba64169a4691cd8315846"); + FeedZipHtml(zip_buf, 4325, + "c71e18dd7ba188839f12e716dded371e50c74b52d73c5d47e3"); + FeedZipHtml(zip_buf, 4350, + "56b7061fadf5fddb32f1374182ad229e7441cbe0c578865032"); + FeedZipHtml(zip_buf, 4375, + "d06192c13c8ed5e08e519d98ea51ec0d3b1dcb830ff8b1e5dc"); + FeedZipHtml(zip_buf, 4400, + "9445b2dd3dca4dbb2d99614392a99b4ae377a76b7b9982bf2e"); + FeedZipHtml(zip_buf, 4425, + "16d2a80b6d31a6b730a094e73f2f5e35d4cdf5308c85eaccf6"); + FeedZipHtml(zip_buf, 4450, + "e94d46a7a87155e48cea809df1f2c893de49378053c4da26ee"); + FeedZipHtml(zip_buf, 4475, + "9b9be5f880692cf8805f178e8f19b0b1245c24ae0d17f0ebc2"); + FeedZipHtml(zip_buf, 4500, + "719120804152131daab78991aa4559de48d0cf2de7b67459ab"); + FeedZipHtml(zip_buf, 4525, + "8b5cf238f282ae37863d484bae1d13b71b929c60d6b93dcf0d"); + FeedZipHtml(zip_buf, 4550, + "b4b79dce31a069753464721db25346deab92c1d813a08447c8"); + FeedZipHtml(zip_buf, 4575, + "3dd8e53f13b7872f70d427ecc05f77f0ecc59b820eb13419e7"); + FeedZipHtml(zip_buf, 4600, + "0b00b236f69828f06ffee7d78a7029e1f9c8a2f87fe9fd6921"); + FeedZipHtml(zip_buf, 4625, + "660a1ae6e5291d1ccb832f9435e3119a1eb8c1ca5053c60f4a"); + FeedZipHtml(zip_buf, 4650, + "968f7b257068309d05776d2a7777c11ad7a66daf872212191d"); + FeedZipHtml(zip_buf, 4675, + "2153ef0578d52f198cc3854a97628b6f0e93052fc5aa1eeebe"); + FeedZipHtml(zip_buf, 4700, + "9a3d318884b01047362c58eda501ae7245b9b00ab904966309"); + FeedZipHtml(zip_buf, 4725, + "6999e3f8666cf111df8c17ba02d3ea8081f8bc444f43b01533"); + FeedZipHtml(zip_buf, 4750, + "0161638069b640d3f9e1c08dbc64388a5760655e9c860a8fc3"); + FeedZipHtml(zip_buf, 4775, + "6bf68469495232ce9e230c5e943ad2b86893daff281cc85343"); + FeedZipHtml(zip_buf, 4800, + "4bc673ab0b448d60bc29599176ed51204f28a517d37e185a1e"); + FeedZipHtml(zip_buf, 4825, + "68d0cf0bc5a68ff93aacaa6640267d5453db1c05ca4260ec14"); + FeedZipHtml(zip_buf, 4850, + "d77234f77eaee882485f242e0a3c6372c7ebac61807cb696e7"); + FeedZipHtml(zip_buf, 4875, + "40eb87b9fb67ad3652550e3cc221cbc099cf578dd86e2f8da1"); + FeedZipHtml(zip_buf, 4900, + "2a47bc15d788a9cefd5819562428a123f1841f3b7361062320"); + FeedZipHtml(zip_buf, 4925, + "fafaf3f2ae9b6548549c2425b803886029c65e9423dcf55176"); + FeedZipHtml(zip_buf, 4950, + "39ca1fbbc8f60df577a75a8ea18bc5ecc35f17cab9c48d5b25"); + FeedZipHtml(zip_buf, 4975, + "fc975df4566bd6256f4d5df2e673eb9a379f2f7ed19bcf6bad"); + FeedZipHtml(zip_buf, 5000, + "1a409975d99bcfabd77d76585cf4d961361abf995dce98c90a"); + FeedZipHtml(zip_buf, 5025, + "48786de8de33dcd62c9085d755c458ad3893d451cd34eb2226"); + FeedZipHtml(zip_buf, 5050, + "981959ac45cab7fadb4a5c9e2bfb2d8f3fd970cfb69934c828"); + FeedZipHtml(zip_buf, 5075, + "7bb282b4ecbe114e69960b46f875b1671798203d58caf5b8b1"); + FeedZipHtml(zip_buf, 5100, + "b3063a993538fc8346e989b1e00065bcc71b0abc4ecd7a12e4"); + FeedZipHtml(zip_buf, 5125, + "e5123f37a46fc7211685b812eb4ec5baadcb5ef4aa9b3ff45c"); + FeedZipHtml(zip_buf, 5150, + "fc27b29c7af0d7c52e053651803c0ac384d390e3bb14450a75"); + FeedZipHtml(zip_buf, 5175, + "7f3cd51cbc487a3d7175390e2d0784b46da10b81f1279ceed8"); + FeedZipHtml(zip_buf, 5200, + "bc88bef27486f5dc538bf84eaf59e4a2627754be626c5c2ced"); + FeedZipHtml(zip_buf, 5225, + "5c0ac65ec272db369f5d7bc12ebb059dc77f73233ba3ca8665"); + FeedZipHtml(zip_buf, 5250, + "7129858ce24d8b8558149f2145533657f2374570a4b14af392"); + FeedZipHtml(zip_buf, 5275, + "1931606769d5b20c7e9e1131a552d00052ee7ae7d44c659347"); + FeedZipHtml(zip_buf, 5300, + "7137856bb93c10c9911b27bf33f8c7b6443cf67ed6abe4b2c4"); + FeedZipHtml(zip_buf, 5325, + "821584605839299995e5b69e6522ee91818cab678578670407"); + FeedZipHtml(zip_buf, 5350, + "4d8c0fd36f9a3ab74cad160731acac9b270e7d8f59782eccb7"); + FeedZipHtml(zip_buf, 5375, + "aa91e0ab1247994034949cab2242c840d53e32c75484aa5e0f"); + FeedZipHtml(zip_buf, 5400, + "059d1ceab10c64d24cf550b933b9a9874da3e3c34468cb9ddc"); + FeedZipHtml(zip_buf, 5425, + "78be0762b9b250e49af3d444f42e1cd131428fb212e1fb9a4a"); + FeedZipHtml(zip_buf, 5450, + "6cdb7a5b512eaba31847d1ea212813bb3dc6221daa71e2b554"); + FeedZipHtml(zip_buf, 5475, + "ba0a4516b0ab693a5d7dc61137093d39311e37624af1589178"); + FeedZipHtml(zip_buf, 5500, + "43a9079aa54c821aa0ad1c5a79dbcc7812b39dcf70322604eb"); + FeedZipHtml(zip_buf, 5525, + "eae12b54d7e94aacf3f2cad982b7b83afb4359cfe624100be5"); + FeedZipHtml(zip_buf, 5550, + "a9e4774def11722b6f46f6e46053f7892ccaca759bbddfc341"); + FeedZipHtml(zip_buf, 5575, + "6cf96eb108b45628b2bb9a7d77ac3af728ecbd5f3d1f559935"); + FeedZipHtml(zip_buf, 5600, + "cfd855d20e7f1dddf5fee707180715f9fc23959e3a007e823d"); + FeedZipHtml(zip_buf, 5625, + "4e7dc0dfd47ae2ca23124563572c7bafb165cf3fd22ccbeea9"); + FeedZipHtml(zip_buf, 5650, + "f5542f7b176307abd6bddbd8bae71f69967577f582aa177e0c"); + FeedZipHtml(zip_buf, 5675, + "4aa572e1c78d2d7cfe916659f8482fa87ae1683145812b1365"); + FeedZipHtml(zip_buf, 5700, + "9db813dee7011fb66c7b2cf15e73223ff750b3e0c2cbac3150"); + FeedZipHtml(zip_buf, 5725, + "6b04148959907318742d6fcb09278777be055728997fa4f931"); + FeedZipHtml(zip_buf, 5750, + "e2c1c266c2c4fbd01aba8398783fb71f3b8f89f9479a1f137d"); + FeedZipHtml(zip_buf, 5775, + "219219f0f0c98d2c99ce090f9f7a4de161fe91e6c7c32d2c6c"); + FeedZipHtml(zip_buf, 5800, + "1686c0026c183b5ca1368e1bd31af38f343f4262b9c05975c6"); + FeedZipHtml(zip_buf, 5825, + "7b37198696645e2c2b948ba22169b9c3587790175ade2c08d9"); + FeedZipHtml(zip_buf, 5850, + "1dbab6ab3c362e1ac3c6fc23cd8f8b2eae6c16541c79b64a03"); + FeedZipHtml(zip_buf, 5875, + "84096c6a0a1777196b7e6cf8306b35323eac5fac57eda91fe2"); + FeedZipHtml(zip_buf, 5900, + "e676d5bb8c350b0e684d35b653ea57b18b7e889bdb47ef32d6"); + FeedZipHtml(zip_buf, 5925, + "cc6b9fba8152af8a7df343dcdcce7997b1665ef9f42d93bad5"); + FeedZipHtml(zip_buf, 5950, + "d8293fc4cded9577196b6614d4df24a97bd556f0216e6e33b8"); + FeedZipHtml(zip_buf, 5975, + "cb5833e3a0d62e80b7d755e20f3d9a93ff3b0d36db0640ebaa"); + FeedZipHtml(zip_buf, 6000, + "614353bf0a25003d9ad302771a6c8ef5d7b19da96315ff4397"); + FeedZipHtml(zip_buf, 6025, + "e604e04e83cd818129327057b76b6f14a73e579b7b95ef5af6"); + FeedZipHtml(zip_buf, 6050, + "f636f68e2f30e85dd6be6ef96130f092494f6c608405fe63e5"); + FeedZipHtml(zip_buf, 6075, + "117962f7f630401096648bca0d06472eba258f2f5a8e5e6645"); + FeedZipHtml(zip_buf, 6100, + "d8a642c03496a853f4efdaf0f5bb08a0caded6924f5f5661b7"); + FeedZipHtml(zip_buf, 6125, + "0b606390557605d0ac17af705e1fcabbc1e4c2fe9c9c427eb7"); + FeedZipHtml(zip_buf, 6150, + "226342d2442471ad34e895b705f8d8239309d58a6b580422db"); + FeedZipHtml(zip_buf, 6175, + "92a2fb4861979cb7886fe4477103e88b890d33589b2aa7d3d6"); + FeedZipHtml(zip_buf, 6200, + "82ff1d4962dd7dc65a34a46ca37b26d69942d75e32f41489d3"); + FeedZipHtml(zip_buf, 6225, + "e9974092bb6a8c8e2e043e49a8b479aede3827ebeefc21bac9"); + FeedZipHtml(zip_buf, 6250, + "63ba9b398c3f7b637b6d08ddd4a25b5c993680cb9dcf987fa0"); + FeedZipHtml(zip_buf, 6275, + "ad8b5f50490cbc6593dfad124b50fa4be3c167d8773609ab98"); + FeedZipHtml(zip_buf, 6300, + "9269d5794effa64c4aab24ff7ffbaf9fb736375f739f0f27bf"); + FeedZipHtml(zip_buf, 6325, + "9e9cfe7ec2db55216db66b3cd00aaec2ae8c7a944f4028bb7a"); + FeedZipHtml(zip_buf, 6350, + "c299d6d304c07af34bab1201c406858d3cca314fc2acf7f9f0"); + FeedZipHtml(zip_buf, 6375, + "6cad1b8e88adf1be9e0cf4b21d3c3eebf5cb302f9b9e305f17"); + FeedZipHtml(zip_buf, 6400, + "f3677bef9d5ed8a5612a507ee095a25c36b51cd83e06e209e1"); + FeedZipHtml(zip_buf, 6425, + "53107e70f89e3155c5e0c1a094c1b9e909db35d9fbe4602ab6"); + FeedZipHtml(zip_buf, 6450, + "db5ebf94b955db13beebe1bb7df87e3a7bff7b2c4af95bb53d"); + FeedZipHtml(zip_buf, 6475, + "21bc1ec2ff7db63f9dc3f76fcad5b76a7b42783d84ef7fd40a"); + FeedZipHtml(zip_buf, 6500, + "5ca7637a33d93ef3053ec48599c42b2ab18069d8f25f700660"); + FeedZipHtml(zip_buf, 6525, + "83706eec5c0bacfa5449ba83715c453dd9fc44c0fa045c3b38"); + FeedZipHtml(zip_buf, 6550, + "bb989d88e957262189bcb8e09a14fd5d744a0f0eaaed8996f5"); + FeedZipHtml(zip_buf, 6575, + "6809f83a9bbedd9c6d95ee36dcf484eeba9bcd96f30577e8ad"); + FeedZipHtml(zip_buf, 6600, + "e7cf9f7f9d82f803911c7b23d1068458a2d2d3c69633766ffd"); + FeedZipHtml(zip_buf, 6625, + "904b5fe6d15fc70766c13ee600645476c3898f2907012588f7"); + FeedZipHtml(zip_buf, 6650, + "57e42a45b837065e9fdfbbe95fc69ce26855ea03f5f31fb0e0"); + FeedZipHtml(zip_buf, 6675, + "5ccf3fc65bb95f123014733fc55783bfdf8c7cfdab3bc6ecc1"); + FeedZipHtml(zip_buf, 6700, + "44a00df5bb9eca6cfcd3a3e761abf9dfc73d9ac2c8034844d6"); + FeedZipHtml(zip_buf, 6725, + "4bd44e1dae61a11d3b690295485628e4df474081358532cc30"); + FeedZipHtml(zip_buf, 6750, + "85c1f2e531d0282914ee60bd3e335b5b7482a70a3656ff98a2"); + FeedZipHtml(zip_buf, 6775, + "72394d317f85b7ad46a16f733c19872321d73196c53e56759d"); + FeedZipHtml(zip_buf, 6800, + "d1ac98e030527c002b5877a82bf384bb942a912b4344025850"); + FeedZipHtml(zip_buf, 6825, + "6533978547af87a12fe87bed5028962b84ad80472709ca676a"); + FeedZipHtml(zip_buf, 6850, + "3dd549ad4b8a4b566e4017ff73e42569a64855753a9d29763a"); + FeedZipHtml(zip_buf, 6875, + "de60a092ca4077ac8971bcf3f1f268ffe4a0fd0b26d3a1a5ae"); + FeedZipHtml(zip_buf, 6900, + "82c63978b752af96a5f61c6620921b1b66672785613eb973c2"); + FeedZipHtml(zip_buf, 6925, + "b144592fc4177640a01155510911691e55b8e84e2274ff7971"); + FeedZipHtml(zip_buf, 6950, + "3c41bf34d36a121b85d380e49c673e53130aa9cf68aa0bf7c3"); + FeedZipHtml(zip_buf, 6975, + "ae265294aa76582e53dc665792ab53e4acd6e6c5a22687a7af"); + FeedZipHtml(zip_buf, 7000, + "d3cabc38d31a17e3457279f34825e726f8a1c5b28695501173"); + FeedZipHtml(zip_buf, 7025, + "d7c00b6283939c92d4ad18625714df7c5ad48df00aa42ac27a"); + FeedZipHtml(zip_buf, 7050, + "330197f855fb233f9ba134f49955198236f7762d53abaa1d5b"); + FeedZipHtml(zip_buf, 7075, + "e7537d92a9872553bbe124483e04b1db17ed88d4a335715fa1"); + FeedZipHtml(zip_buf, 7100, + "536b46ab2f4f302ee3595dcc857479fabccba427f41cb98864"); + FeedZipHtml(zip_buf, 7125, + "ac9520617aad36ae48f427d883e660ec7b344ecf93453bf048"); + FeedZipHtml(zip_buf, 7150, + "32f2029d621e63ad0128b370725a4910c447262aa66cccbaea"); + FeedZipHtml(zip_buf, 7175, + "186d8a80745753b80631517e4db3b254be9c56826554d164e1"); + FeedZipHtml(zip_buf, 7200, + "ac03f12496d0291aacbc06e91a09ca9787e9c12a30190f95e5"); + FeedZipHtml(zip_buf, 7225, + "033fc71eb04db67a3092f66eaf8ffa25975ae3e765575a5f80"); + FeedZipHtml(zip_buf, 7250, + "7b30bf877a2b8f2cf495b4c580df257add7bb9ed2af63a3dd8"); + FeedZipHtml(zip_buf, 7275, + "4505000ac1e36c6895bd9584e22740ee095dd0544331ed353b"); + FeedZipHtml(zip_buf, 7300, + "e0030dc64a0f87a553c5614d3dfd2cc86d4e8a4b298e0fec10"); + FeedZipHtml(zip_buf, 7325, + "764c84951dc075ce4e0f4fdae9ebd2821d18893157684a0b4a"); + FeedZipHtml(zip_buf, 7350, + "5d503c00463c2881c70a387c95ab1d0a00378ce862f56a849b"); + FeedZipHtml(zip_buf, 7375, + "665499c5c9cee36396922eab15892a4715ae830d32c6d360f2"); + FeedZipHtml(zip_buf, 7400, + "13a70e56f5c749fe271e080c6c63b8c7d1824a75e845fb523e"); + FeedZipHtml(zip_buf, 7425, + "df2de45e912df326a75a02b5a886e62d9e81e063375e233ba4"); + FeedZipHtml(zip_buf, 7450, + "cf99238fdd6f82e1cfa6b8cf6ecc6a4fa6e2a9f8c499fd41ea"); + FeedZipHtml(zip_buf, 7475, + "24e5a9c4f669392fccf83e4991b3529921450351446f0adf9c"); + FeedZipHtml(zip_buf, 7500, + "f8e54325960fb43ccdfeba145999414a58aca41642246296e2"); + FeedZipHtml(zip_buf, 7525, + "1b87928a7dcd849f4cc5e5e70a647e9e1b9bce9f7f294c7fb6"); + FeedZipHtml(zip_buf, 7550, + "e0daf9730e6c1f5760fb787e6c8ffe52d83eb6617b340f6f57"); + FeedZipHtml(zip_buf, 7575, + "a1fbf31df03d8dbbcbe9f1b828f1d94a8a3f6725c6118c60a7"); + FeedZipHtml(zip_buf, 7600, + "04b6c0313dd9c4b513594c0400aec6c996bd49e20b07e0e8bd"); + FeedZipHtml(zip_buf, 7625, + "85622e9d661624c662401b9f2a13c8056261b57400e09c9fb0"); + FeedZipHtml(zip_buf, 7650, + "4042cd5453252d5184a943033a0da0f17e27cca37dfd68f06b"); + FeedZipHtml(zip_buf, 7675, + "a011ab9ea539b808fad8416f0931e400cc182c18458daaf0cd"); + FeedZipHtml(zip_buf, 7700, + "0c29b7ee9716c7133ff16cb2d0a372e63280f25d5a6ff02f48"); + FeedZipHtml(zip_buf, 7725, + "abd7940340adf7adae6be8a08d8a05dd30a99e90b9d1d1f781"); + FeedZipHtml(zip_buf, 7750, + "b45baf344bc1bcf57c37d2c958e1736f824e833010ab60e427"); + FeedZipHtml(zip_buf, 7775, + "ec1c08b9d808a57246dd068b6be18940b3cb8ae697d7701e48"); + FeedZipHtml(zip_buf, 7800, + "892597903a91940f61bd117e2a758d65996cd78bba36af68da"); + FeedZipHtml(zip_buf, 7825, + "d672ba55db5e779a8d8cb90c27f1ac1b1cfd3ed56f1627625c"); + FeedZipHtml(zip_buf, 7850, + "3af2576719bb643638bceb8778d3717478b27fd13e3f3c3970"); + FeedZipHtml(zip_buf, 7875, + "dcf1380a6fbc51eaeb61b49a1b25e671b8415412cb5211d6ce"); + FeedZipHtml(zip_buf, 7900, + "36e32dbd8b9a860b7408712156d7cfe4e44524b12cf41d7404"); + FeedZipHtml(zip_buf, 7925, + "b14b8aa78f9d6178ad3c9e24688adde8b52355204c4b417601"); + FeedZipHtml(zip_buf, 7950, + "f2c9a80f9c063287dcccf523d52758811165ec3633ab4cfe5b"); + FeedZipHtml(zip_buf, 7975, + "7f1124b25d2f29d4df2c5c98f2f472cac936e6f39e1813ce2c"); + FeedZipHtml(zip_buf, 8000, + "0cfbbeef8de31269908d7715879b4bf7c62b1707b023ab3b7c"); + FeedZipHtml(zip_buf, 8025, + "7ff222113f556018b30a810f4a70042fe12f28323b51d72e2e"); + FeedZipHtml(zip_buf, 8050, + "d0b0e09da316bf6365edf201e2242c9787bf96a44ddd922668"); + FeedZipHtml(zip_buf, 8075, + "ec00d566d8985eab425c3fc59408508cbc048d2dc5ddd99188"); + FeedZipHtml(zip_buf, 8100, + "188c7339dc00eb72cb87367c2f3533e73fed7877dff112af5b"); + FeedZipHtml(zip_buf, 8125, + "2ac64687fbdef99ee4bd31795754ad25efc57df5af2ff77fdd"); + FeedZipHtml(zip_buf, 8150, + "0d5ba9fa0b386bda6a7715fb3c6de30f48accf4e8f3e1d9c9e"); + FeedZipHtml(zip_buf, 8175, + "54ede14cb5a76dfc3bdcc6ab843adbe76933af9cf9d148bdde"); + FeedZipHtml(zip_buf, 8200, + "c96b4afdd366fe57927bbd512791677b0150ecd3cc667eb959"); + FeedZipHtml(zip_buf, 8225, + "3186ecb2f524fb4bdbf189b4c047be07c2cbb29a5c8728d4b1"); + FeedZipHtml(zip_buf, 8250, + "130fdd485f3062880ee6408e04ddce766ff4c30956135fa7e2"); + FeedZipHtml(zip_buf, 8275, + "072f3e86ee158ed8f3fab4a52644728f4654fca1c755dc40a3"); + FeedZipHtml(zip_buf, 8300, + "fff575cda3b534b2f78f17549ae820f22c19acd2b6f40e7227"); + FeedZipHtml(zip_buf, 8325, + "12ae9fbb7e8cbd3fcbd3efa02c62446b5e4657a1258cbc8117"); + FeedZipHtml(zip_buf, 8350, + "d8af99cb24b06e74f845fbf241c23f8f0629ade4b1ad95c700"); + FeedZipHtml(zip_buf, 8375, + "564921c05c6aaa0b5b61ecb4a4fcd2ded81b0899d79f0a9479"); + FeedZipHtml(zip_buf, 8400, + "dbb86c046945ae585044308632cb4ff8de52415f9f69a56075"); + FeedZipHtml(zip_buf, 8425, + "1d7c908693e91b4d7d2dccc1d64914fa32925ec64623a65905"); + FeedZipHtml(zip_buf, 8450, + "24a0ea3a98838f5e0dbc9a9e9767e2cb8069c28def6da320e3"); + FeedZipHtml(zip_buf, 8475, + "ab05599391a8c24f104848bbee24061545418c7857cbb7d71e"); + FeedZipHtml(zip_buf, 8500, + "bf5a93e1dde9bba20ddfcb0d0f4363dd471ab6a5c493c65fb1"); + FeedZipHtml(zip_buf, 8525, + "4f7016fab78330a839bc845e55369c06bd0e7fb40f3d157b1b"); + FeedZipHtml(zip_buf, 8550, + "88be69bd0e39145f6b56989c458049a6f46c2b1f24cf77fb2b"); + FeedZipHtml(zip_buf, 8575, + "5cd6223114af7ea3d27abefa7c4532310b9552a46e1cc3a8e6"); + FeedZipHtml(zip_buf, 8600, + "6b8b3b5c9b97ebc13696701be0266bd785d9f607a44f66d087"); + FeedZipHtml(zip_buf, 8625, + "0f760d0bd689895ef7935e7cd28b4f7a7116bdf88bb87107b8"); + FeedZipHtml(zip_buf, 8650, + "28bb5acc343f208d3283567ca84b58b0521caa653fe9c4279d"); + FeedZipHtml(zip_buf, 8675, + "f8a41367d189eff0ddd771c7e27e572d2de7a6ca71765bd1c8"); + FeedZipHtml(zip_buf, 8700, + "4ef72a9fda6d79e33d3e22a037009bb0347e01805e68fa690b"); + FeedZipHtml(zip_buf, 8725, + "e0953f45298598d832e4d7eb61687cff966282b1de820e907f"); + FeedZipHtml(zip_buf, 8750, + "fd23517da6070ac7efce1d7ef107f43407aba627076b965355"); + FeedZipHtml(zip_buf, 8775, + "b7dfed21d97c41b24b23a07a2986c1ca195291cb8b464325ed"); + FeedZipHtml(zip_buf, 8800, + "92fbcb2785cde5ccb3f78c77255b57062b97106cff2611b6c7"); + FeedZipHtml(zip_buf, 8825, + "7efc7bba87dbde2d2c1083e91e9b7b9c5c5c6d07b40ca563e8"); + FeedZipHtml(zip_buf, 8850, + "8437fc321b340f8648e2b373f41d0262cd32e2772f95de0e0f"); + FeedZipHtml(zip_buf, 8875, + "76ce2d19b7f9f76a9c95e40dba3bc6002e9c57e53030f7028d"); + FeedZipHtml(zip_buf, 8900, + "32f5b6d6c87a4eda4527fe361e1badbc9eba2f153362bc719d"); + FeedZipHtml(zip_buf, 8925, + "6124fa6f9f0d93641cbfdad8b8bebe5e1fb89ebb36f0e2752f"); + FeedZipHtml(zip_buf, 8950, + "d9e8e39b5f1ff6c64e3c7631b50026dbb8f6be79ff87deaf23"); + FeedZipHtml(zip_buf, 8975, + "fec0e422ecbab8b50917b69f1890c1e9a3ba68141633d5d431"); + FeedZipHtml(zip_buf, 9000, + "511bdcb4103eab76930d2d86f38d2df3c90265062f24941d97"); + FeedZipHtml(zip_buf, 9025, + "553a2603c864af00a91dbdaf7f9c53d7e479414fb174fa0009"); + FeedZipHtml(zip_buf, 9050, + "8ebde0a3e56a8f1bec125aa77802020ae79cf90659888644bc"); + FeedZipHtml(zip_buf, 9075, + "dfaca572cb8fc93da90b80ef80403fd1531e5ff413aab88b09"); + FeedZipHtml(zip_buf, 9100, + "29f8d1386ac85e0e5427988c3a22ba23d14c083cca10a5394f"); + FeedZipHtml(zip_buf, 9125, + "9f6baac9f7a98c7c9f9a20df1c832c8c7cb7f5c8175e8be8d1"); + FeedZipHtml(zip_buf, 9150, + "d0cfbd29113f68b83bfde61ae49ec50f8e57c3c7237fee4d89"); + FeedZipHtml(zip_buf, 9175, + "fc414313f47b7cf237198f1f8bfc798125e104ebbdcf0f08ef"); + FeedZipHtml(zip_buf, 9200, + "94126a32723e9bf8675f4b9e0af78a69999dd2ec3874a9aafc"); + FeedZipHtml(zip_buf, 9225, + "67a7e7c17138aeccf905dc5e420e687848e4706fbe0b727881"); + FeedZipHtml(zip_buf, 9250, + "2563054bc7f1432287948ee3474b8ee39ad251420e687848e4"); + FeedZipHtml(zip_buf, 9275, + "90d2f11726c79d73cf6d72eeb96c1925cc8097441399a6a0e8"); + FeedZipHtml(zip_buf, 9300, + "cf619f9797c4ceefc2f7d7be05e1754069929d7375d674d92b"); + FeedZipHtml(zip_buf, 9325, + "f394942e0a478899f26c74d8da72aebf2539e7c34cbe509d2e"); + FeedZipHtml(zip_buf, 9350, + "11a4b0d1816713c78f77165fcd7ab5f92eb1f15d89e602ecfc"); + FeedZipHtml(zip_buf, 9375, + "fe6bbb1d02cb5b15986ab4a16d29ce20987be39894ab8325ac"); + FeedZipHtml(zip_buf, 9400, + "7ccf0d124ad12133d0010094848ec497c09289e87274d7e95a"); + FeedZipHtml(zip_buf, 9425, + "a6a92df59f2d33080e0b7cf2f6b9764f71020fe9a52adf20e8"); + FeedZipHtml(zip_buf, 9450, + "62a39cf333cd846a4e14321b9bca6bbc1cf3373df67df2bf84"); + FeedZipHtml(zip_buf, 9475, + "a204c978099bc131e82df933afb49c00e6a784a3f4a3191195"); + FeedZipHtml(zip_buf, 9500, + "e6bc295062f1931497bad0c52c70aafbe43213945279f66f2d"); + FeedZipHtml(zip_buf, 9525, + "ac266fe9ab043dfd4eca227d31b334ca688082ac2f6ef8dcda"); + FeedZipHtml(zip_buf, 9550, + "16047df333dcafbe9270949d1b8afb0233521a9651ce4bc745"); + FeedZipHtml(zip_buf, 9575, + "cd6ee4989a0d616618488e2acb98a6b8dcc52d67b153dd27b7"); + FeedZipHtml(zip_buf, 9600, + "99a094315cc91ea98398a66d94c7854d2cf7e93ce8abd86696"); + FeedZipHtml(zip_buf, 9625, + "3a5f091696b1cca5ce7cef4c5a63873d2ed962cd68b84add98"); + FeedZipHtml(zip_buf, 9650, + "db09cdefe61371fba6b5a4996ccb5eecba9631e1bd33e2b40d"); + FeedZipHtml(zip_buf, 9675, + "1a4f90bba1ef5b18511d7bb199934f567b36cc610891c501e6"); + FeedZipHtml(zip_buf, 9700, + "744ba403583d1fcb9fb81c354b5df83d80709f0c6d03a984ad"); + FeedZipHtml(zip_buf, 9725, + "dff50ada351be0d8b36b353f4de8da8cc9bfd08916438cf290"); + FeedZipHtml(zip_buf, 9750, + "fadda2e52f1d74582921ea7849844962bb29cf857d9507315d"); + FeedZipHtml(zip_buf, 9775, + "70ccaef7fcae4f4ebd28e3d45b97deeb08c3c96381c567620a"); + FeedZipHtml(zip_buf, 9800, + "2927471505a9e2a385d68a7e922da1f2fe14fc63058314f7df"); + FeedZipHtml(zip_buf, 9825, + "1c87946c7c7353ae72375ac274f7c92d993df511b2cc9d2f5d"); + FeedZipHtml(zip_buf, 9850, + "b61abb7479c799989fae5d2cd72ebffffaaefcd6051a51ac3a"); + FeedZipHtml(zip_buf, 9875, + "fa0e0e388491d9cce54b93e33ffc3b988e9d0dab6e61de55dd"); + FeedZipHtml(zip_buf, 9900, + "c2bcd3b73065087c34b7318a0befff32c62a0f662be15b7b85"); + FeedZipHtml(zip_buf, 9925, + "66e0d6295731cd0cfdf06f6214826d173156e41b1f1282b26e"); + FeedZipHtml(zip_buf, 9950, + "8f19b054e31a666173d8fd380b5bcb02a77a24b7305936339c"); + FeedZipHtml(zip_buf, 9975, + "162502aebf9242a87d19338961f515cc0246cf2e6c41b0373e"); + FeedZipHtml(zip_buf, 10000, + "c1e3b87fc9b250f692c0ca45c705659ebd4298015bb52e5f16"); + FeedZipHtml(zip_buf, 10025, + "364b61ad4d4e5372edd2f4621e801fb1d6ad8b85cb6a6c8ac7"); + FeedZipHtml(zip_buf, 10050, + "f91dcb7223302beeea5cb92c613a3b0a96b1c8654e7cefec39"); + FeedZipHtml(zip_buf, 10075, + "cb7d8b551356efa8c7f94d2f7f4730bb644fb96c59e8449635"); + FeedZipHtml(zip_buf, 10100, + "2f76554b98efde5970969b962c0bda5df9a5be0c6390cc7139"); + FeedZipHtml(zip_buf, 10125, + "ebea9fc3f350f39a6569f396e265a9cb5e3e048fee8ec5caaa"); + FeedZipHtml(zip_buf, 10150, + "99e654dcb3feec066cfa45cef397ba60911ebbfbb862296110"); + FeedZipHtml(zip_buf, 10175, + "fb6e3737e5ea5eb02c68b6bfdefdca3239e6ce372c2f6c372c"); + FeedZipHtml(zip_buf, 10200, + "612771bd406541c83f5dd9987aafc2a95ff21ef1effcb66527"); + FeedZipHtml(zip_buf, 10225, + "b65f99f2efb513ab98d239e3a7cbde21f971576c65a2a8de0d"); + FeedZipHtml(zip_buf, 10250, + "c84efcfbaf6d1bcee0e79275a3064a5fa665d5509a426f61a9"); + FeedZipHtml(zip_buf, 10275, + "6a6658349052de4dc8b778a856ba09a5cc0b400e476e90385b"); + FeedZipHtml(zip_buf, 10300, + "7b0ea1a014414af91671c42dd5ec91aaee1c67cdf8f103e1ad"); + FeedZipHtml(zip_buf, 10325, + "7736ddbb20cd39f2e26e5e7bc693f1388ce8665adc84588623"); + FeedZipHtml(zip_buf, 10350, + "d58244d124feeed5e0c56f07366e859f2b243a123ee52ccc0b"); + FeedZipHtml(zip_buf, 10375, + "f414695faebcc3129c2f3859d7f55d7c21fb1bd7603988dcf1"); + FeedZipHtml(zip_buf, 10400, + "d0ebc66c09d5567dbf8e7c1ba2e0e7a6549fca16260745cece"); + FeedZipHtml(zip_buf, 10425, + "f658c5144addc81b1763e156ef55fd22419e6d9f9d9ffe7bfd"); + FeedZipHtml(zip_buf, 10450, + "6539417e3d3e2282fc2a6e8721d0e3d88dbe4dc6ce11a67976"); + FeedZipHtml(zip_buf, 10475, + "07c24a0f8513cc3adaf7a23821c1e517cbf2467b200211e11b"); + FeedZipHtml(zip_buf, 10500, + "699c63a0eedd852f307de02b2eac214087f78c4ff5372e5f91"); + FeedZipHtml(zip_buf, 10525, + "8b84c1c37453c96da5ff03ad6f2b2f188d2d07fec70c0158ea"); + FeedZipHtml(zip_buf, 10550, + "83cc9a8110b8deb2d0871f0aec7f6067ff8345b03f0d8ad5e0"); + FeedZipHtml(zip_buf, 10575, + "8b5fde2f9fd7513b0792cb01be016a9adb99f8fc901ed4abb5"); + FeedZipHtml(zip_buf, 10600, + "bf755ed00a92219c8470e017eb371844a1d8b7b7ea84306774"); + FeedZipHtml(zip_buf, 10625, + "edc5ccfee124c1f483bcb9e977fdf8e5d6facd54b6867ee56c"); + FeedZipHtml(zip_buf, 10650, + "0d8d40e987cfd607b3b1b508ff7d717a62656d6e9a87bdb191"); + FeedZipHtml(zip_buf, 10675, + "73e8c6f7bd0bca55645812d0f66ff7cabda0adc439650c9e84"); + FeedZipHtml(zip_buf, 10700, + "0a5b16f654d6280c22d7458be9e2019d227968ae3e9cd0c36b"); + FeedZipHtml(zip_buf, 10725, + "34b738ffe52bfe46e76da6a4ca9d6d8e050a428d22844da6fe"); + FeedZipHtml(zip_buf, 10750, + "a5d98d64c9f213ca4fabd7f24ee6e17c17de14bb6e65baee9e"); + FeedZipHtml(zip_buf, 10775, + "5fd0f0f1100c41a5534a2679415f1a833b7f77f8bb5dcc1299"); + FeedZipHtml(zip_buf, 10800, + "effed23a11a6bb9c32cf3f2cf3d06799692861f374912de3df"); + FeedZipHtml(zip_buf, 10825, + "5c07e262fcc783175f89cffa22bc6ff5ccf1eff79421d51440"); + FeedZipHtml(zip_buf, 10850, + "04833883f2dcf6448f4e48ceafc609c926724eeb2c8c9383c3"); + FeedZipHtml(zip_buf, 10875, + "0b3250e0a78ee78369b2329523ece8305b5b8ec845283e4446"); + FeedZipHtml(zip_buf, 10900, + "20bccdc40556d7c47eb96f62c95cd02ee502764535cb031664"); + FeedZipHtml(zip_buf, 10925, + "98adc403c923e081f60c3cf0fee0bd8d05e0e7120e58c54445"); + FeedZipHtml(zip_buf, 10950, + "852dbada9fd22c5f006cc416eff74ed3c44ad26ff29eacb869"); + FeedZipHtml(zip_buf, 10975, + "fb31ae20bf19870125f99e794ffef829cddc54b6097ffcf4b9"); + FeedZipHtml(zip_buf, 11000, + "aad396ec745cd5e9851ac9daabdece6725b6d1d872fa837ed3"); + FeedZipHtml(zip_buf, 11025, + "71ec4be37ce48bd9c2d377e276c946d89eba11628fb58e1f76"); + FeedZipHtml(zip_buf, 11050, + "32ae478ce9aefcdab0802f6f6e73c85ce0d099d63f4bc477f9"); + FeedZipHtml(zip_buf, 11075, + "139b8da3c701d52a9c1193e1a52a91f3a801964d1d4cce5f67"); + FeedZipHtml(zip_buf, 11100, + "2df3c8755fbabacedbedd3b3d372b5de56465fdb0b6e6734f8"); + FeedZipHtml(zip_buf, 11125, + "368edd71e07dcbedf916b59da9d4a26ab3c4785b69e25e5f61"); + FeedZipHtml(zip_buf, 11150, + "1a28374b4e1bc896455eb8742a192949286bb9dca665567bf0"); + FeedZipHtml(zip_buf, 11175, + "f70866ec79030f73d40ec389df433703ad26ba123d06d19eab"); + FeedZipHtml(zip_buf, 11200, + "ddc869d8c2e39288e3cc88b080b778f502e72111110eb09aac"); + FeedZipHtml(zip_buf, 11225, + "3c4cadac63859a42851927539c47bd3289a98aebe7fdf3535a"); + FeedZipHtml(zip_buf, 11250, + "570b0e9cb9895c50c2bebfb29edba0caf1aa79cf44a0e63a8d"); + FeedZipHtml(zip_buf, 11275, + "3eb9f5e2557218fac2951581b056520b8b3a9c7fd8a75ff8d5"); + FeedZipHtml(zip_buf, 11300, + "cdfb9da30bfa7b8546445ce135f715576ba2124a9867114664"); + FeedZipHtml(zip_buf, 11325, + "1089b7b49f53a2df0bba3e96558021113d5436c80474031ae8"); + FeedZipHtml(zip_buf, 11350, + "c777ef4e295ff62c98bc8d3370aecfba55db3726b3b5e524f9"); + FeedZipHtml(zip_buf, 11375, + "475347a7efaaf7ea46eb6f950975cdedba5df7b072e78bae97"); + FeedZipHtml(zip_buf, 11400, + "f94b2eac6c8c9c95a2e1bbbed1da4bedc93cc3e9a66a63c860"); + FeedZipHtml(zip_buf, 11425, + "b2cc2dec1c9fdfe73dac36ac953acab32fec9743af3b442127"); + FeedZipHtml(zip_buf, 11450, + "2d4c4e6650134012d07ba0f9b3a3301ee4588616076eee9617"); + FeedZipHtml(zip_buf, 11475, + "fdd9c58e1534c9b63f80837aba60ac54e73b93382d5f575000"); + FeedZipHtml(zip_buf, 11500, + "6efc4a7bee7ff80996fb9172d9ffb4eaf01f9f337fd193cc9f"); + FeedZipHtml(zip_buf, 11525, + "10c5b2957f28c5ddc91e1ded2c4f4da9653e366c165b9c6a18"); + FeedZipHtml(zip_buf, 11550, + "394ce32d9e0165eabc48f6c90b634f7c5919957718bfd8b3e2"); + FeedZipHtml(zip_buf, 11575, + "051bee0b2dbb43d1fd16db3222231e3209c3eb9459c4fff0d2"); + FeedZipHtml(zip_buf, 11600, + "53258646150f922ae1675b17f624d9ccdb3590619342c6d0c2"); + FeedZipHtml(zip_buf, 11625, + "58759ed3bf69db5e756a4d88f6c71a0ff1e1e4d793d3df4f72"); + FeedZipHtml(zip_buf, 11650, + "d61b15ad577b0f181d576157c698d15f941f5a5b4ce58f7b0f"); + FeedZipHtml(zip_buf, 11675, + "e363e1c61354fc7632aae67b2566192d8f9f689933f2903058"); + FeedZipHtml(zip_buf, 11700, + "0ad46ee4a9d6b9a2eae61ae03ef75d0adb90dba407c6a31b24"); + FeedZipHtml(zip_buf, 11725, + "1e859fc4934e22cba56a4317fecd9b3015d02b284bb4bf9d91"); + FeedZipHtml(zip_buf, 11750, + "401dbbcae1ad531e08a1a16c1129f8753e9b67b62fef13ed17"); + FeedZipHtml(zip_buf, 11775, + "5ce40d8cf0be8844d0855f6ee3448c1c3839e80a85c520d832"); + FeedZipHtml(zip_buf, 11800, + "3c8aa40495dc50eaf5b09c5496e054ec810d4da18ab148ee80"); + FeedZipHtml(zip_buf, 11825, + "0ee74bc015dcc23f64a03532e078ecc3e9f06bca17bf635881"); + FeedZipHtml(zip_buf, 11850, + "2e9b18886bc3730da7366d5ef2568e15067867b7a815b237b1"); + FeedZipHtml(zip_buf, 11875, + "e25ae566b13f1a2796984ad9301f67cffcf1b299bbc90d03f7"); + FeedZipHtml(zip_buf, 11900, + "82bffdd7cf5b9b9baf333b0263a3feb640d5228c3d412314e7"); + FeedZipHtml(zip_buf, 11925, + "6427858dadd2096275ae10887c64d70ab25f607c97654f512d"); + FeedZipHtml(zip_buf, 11950, + "f3127ed6af1743f9f247117f21cac36f14a52768fb924e0118"); + FeedZipHtml(zip_buf, 11975, + "5a85a6b0d638c693560523fc864ac3c607d45011a023e2c8bb"); + FeedZipHtml(zip_buf, 12000, + "ecfb2ebf8b51be383324ac9c4b9a1d7b5ebfd4e3e5107dc83b"); + FeedZipHtml(zip_buf, 12025, + "d4ded07dd81d0965d96ae2c82422c1c1379d1642b8b2ca75c3"); + FeedZipHtml(zip_buf, 12050, + "5dd867f09b35dffbc64ee9085db2183c1af3d8ad2b2fc45064"); + FeedZipHtml(zip_buf, 12075, + "f93806adad9e1bf59cd3835d3ebfafe82038f4e4793d2ce7c9"); + FeedZipHtml(zip_buf, 12100, + "756c6af3702f14b143ae52f4c6ba60d351a1d0241c039d065e"); + FeedZipHtml(zip_buf, 12125, + "1720a22d6c1a039fc399c6e602c934df89e14a4ce8854cd02c"); + FeedZipHtml(zip_buf, 12150, + "43674d8af6fec7b6b47491a4445e2ccf9a6a0ca093b42402aa"); + FeedZipHtml(zip_buf, 12175, + "5684d4a11f5689f571a16058df3e2a2eb497629af5604da4de"); + FeedZipHtml(zip_buf, 12200, + "13c0a79678dd4c7309274c61856999e41634c522d94d73558f"); + FeedZipHtml(zip_buf, 12225, + "80765a93780244bfe50b132a63cdd7335d7712132f3241bce4"); + FeedZipHtml(zip_buf, 12250, + "afca6064bbcb5dba8b09dde80961ddaa9014d9687d05a55a66"); + FeedZipHtml(zip_buf, 12275, + "28f69e79ff3afbe7cbb6ddd491d4725b4405e3bd58facf4718"); + FeedZipHtml(zip_buf, 12300, + "dd9184111ed23a725d88e6c1fc86d27e7025fcd0e685512d73"); + FeedZipHtml(zip_buf, 12325, + "e27d8ecfefd3158067613718f882118b523360ef897cc5bb4e"); + FeedZipHtml(zip_buf, 12350, + "de38f5d4d84bf12d9dd660f4042272c6982f2856be1c351663"); + FeedZipHtml(zip_buf, 12375, + "05830cbeb48e0f4f3eae3af0bf9f56565bc73b1ff51f8efa6b"); + FeedZipHtml(zip_buf, 12400, + "e723ffc51db37f61cfafe562b47f330631b73a48b9a9d409e1"); + FeedZipHtml(zip_buf, 12425, + "8eb0723936d82a172ec11f3107357463da1f8bb0d342591250"); + FeedZipHtml(zip_buf, 12450, + "4db2a3836e193a94cb522e956646af677a9b2d69299ffe28d5"); + FeedZipHtml(zip_buf, 12475, + "568eee134a0f5572dfc26df77be342cb49c20414467aedc280"); + FeedZipHtml(zip_buf, 12500, + "392d325d39088012f182819ae613da50ac7e25a244dcac5420"); + FeedZipHtml(zip_buf, 12525, + "e11c5fd2db71404d0f1005045701039d108e41186c1b7918fa"); + FeedZipHtml(zip_buf, 12550, + "002c80c0d11ff4410512ce05c6ef5bd4286041b6cda9099b93"); + FeedZipHtml(zip_buf, 12575, + "ac9cdfed8b57dca09d6b979fc092fb8eb674b2005094803de8"); + FeedZipHtml(zip_buf, 12600, + "e110edeef52a85e27f3b19b672242eb54d0123478c1f68021b"); + FeedZipHtml(zip_buf, 12625, + "c469f1933d663bdd0d89e8bbf07b1888d5da7719f48565249e"); + FeedZipHtml(zip_buf, 12650, + "0286aaa0e8fb30ea8aa35fcead24558df746d37f4f60019897"); + FeedZipHtml(zip_buf, 12675, + "b7c37979d7382f6fc7cccb4b404a31defdbdb5c27138caf87c"); + FeedZipHtml(zip_buf, 12700, + "93d00d8361a0c07fcf61328583933011aff87c6b1cdf9597d8"); + FeedZipHtml(zip_buf, 12725, + "4b045d6eb9a05ffbe42f4ed80c857d4306a791a10a5fc81835"); + FeedZipHtml(zip_buf, 12750, + "03d5f03f38b904a492021afe723aa44bfc4e250c185be220d6"); + FeedZipHtml(zip_buf, 12775, + "6c0e56222e0096d3ed52dcc5c047ff83b3eb87dd6ff4f6ef7c"); + FeedZipHtml(zip_buf, 12800, + "02e46fd14142aabc5ab365a4b7ab4753f3b1730847cdea4ee3"); + FeedZipHtml(zip_buf, 12825, + "b031c186b5e2a7d38451d1b90e2f3c31432d6690b46898294a"); + FeedZipHtml(zip_buf, 12850, + "293c9d3966618ac3b85a3918ed53b260a49e8405f18219c1d9"); + FeedZipHtml(zip_buf, 12875, + "52cf2256c84165d20b1468983dbd5168e8424579843bc96ca2"); + FeedZipHtml(zip_buf, 12900, + "ac3fa912e5b2200703253a3a9470f25ce3240893d766bfb5cd"); + FeedZipHtml(zip_buf, 12925, + "fc65a0c48f27e272c97833a12d8c73ca1b1e1be991c5b50761"); + FeedZipHtml(zip_buf, 12950, + "4e56b2d95c906475d86f2afffd5519b051f5319daba63364f3"); + FeedZipHtml(zip_buf, 12975, + "8cf8ea6133e25d6383233176bd281f1fec26095eb6caeb1bee"); + FeedZipHtml(zip_buf, 13000, + "e38c5c1f73040873d1df79e0f0851b7889f7a74865baa00672"); + FeedZipHtml(zip_buf, 13025, + "3d2af480ad6161a6496b1cc6b1d7f16f579c5882689825f80a"); + FeedZipHtml(zip_buf, 13050, + "659ab94201f515264bea0db4d5f8e84e223e32e045ef48c5bf"); + FeedZipHtml(zip_buf, 13075, + "63643afad0e140d14de257e9d3157a63017c283081059de8bc"); + FeedZipHtml(zip_buf, 13100, + "ae6058f4530ffd1e833aa362f829a6947f13506102d3717569"); + FeedZipHtml(zip_buf, 13125, + "26f3e546e55384fd003fdda5a481253e8e42978742df8ce909"); + FeedZipHtml(zip_buf, 13150, + "c76aef0af0d68f00028e31c38c1faafd35a9d4378c337e178a"); + FeedZipHtml(zip_buf, 13175, + "17c2d2912cd38364360441cba6a73e1df958874289600cceb1"); + FeedZipHtml(zip_buf, 13200, + "8883aca61e366f5dacb35e1bba57f0f98d2b93a47941d7eb09"); + FeedZipHtml(zip_buf, 13225, + "f63bc6891bd1cb557e24e36d8b80c6d1e44ecfae38663b7330"); + FeedZipHtml(zip_buf, 13250, + "859d498c9338bb325050740b017cd9f5dd387ee5a822313a80"); + FeedZipHtml(zip_buf, 13275, + "d84cf22e7f32736a9bbd72bf4b0eeaa48953b343667f54e833"); + FeedZipHtml(zip_buf, 13300, + "f3cba6cf814cfdb16e0f9a9a1215b55e7d943e17a3f04a9c4b"); + FeedZipHtml(zip_buf, 13325, + "012af35ada7acdcad0e66bbf19c65b055ef245e462d499f641"); + FeedZipHtml(zip_buf, 13350, + "3f16d1292aa63e7aa65127be314bafb06ca17f262b6bea760d"); + FeedZipHtml(zip_buf, 13375, + "b1c5d7d3e485c6a0508ea48b354a793be6d9e45d833917f1de"); + FeedZipHtml(zip_buf, 13400, + "5892d7dbfe4e24466d3399dd829fbf151fe5e1d79ad7548529"); + FeedZipHtml(zip_buf, 13425, + "759983d45444dc90f8950fb4b8565dcfc38b5460527afe927d"); + FeedZipHtml(zip_buf, 13450, + "f9c201061361bb5775e33cdd8c6b60ca54a65ed1a572a0dfd3"); + FeedZipHtml(zip_buf, 13475, + "a14dbafe9c31235dd6f8d6929df6a42951a1a6eab44b92f3ba"); + FeedZipHtml(zip_buf, 13500, + "c045148b13909a0ec480b2f11107ea29d7f3bbe89b7ce52083"); + FeedZipHtml(zip_buf, 13525, + "7b33ba99b60563bdbc33e825d3b6ce14e11d04770ae82dba13"); + FeedZipHtml(zip_buf, 13550, + "05856dee949d69324990eaa9bca007ff0c7057c1d7904a70c1"); + FeedZipHtml(zip_buf, 13575, + "80d51908c9d1bc5eb003e6d1bb7185e2bdab6dae1eb2b275ae"); + FeedZipHtml(zip_buf, 13600, + "387ecd78df9a9aecdfb921be2b71526e88e77b3c14434d5173"); + FeedZipHtml(zip_buf, 13625, + "b9e6f7203d83a6cc64dadeced1e1c9fe45fbfcf0e420269d7b"); + FeedZipHtml(zip_buf, 13650, + "767af4e9e0f4245ea5b8290a70894bcd8d0f41772a418a7d1e"); + FeedZipHtml(zip_buf, 13675, + "08490267122c8c2a0bd1136e9ce474044578e2efb8473c2909"); + FeedZipHtml(zip_buf, 13700, + "a924001fed509b2e39fd90363e103ecc0492ad65de6b2b5ec4"); + FeedZipHtml(zip_buf, 13725, + "1f613f0854ee47300de4b95ed4d70f9803a8a36c849eb2116c"); + FeedZipHtml(zip_buf, 13750, + "5e2a56100ec6b3f9827500e9064ccb4703cb04aa1896144f3a"); + FeedZipHtml(zip_buf, 13775, + "6b038da5123dc148cf9a8936b2a43d1e106d520df940099402"); + FeedZipHtml(zip_buf, 13800, + "d804950cfbdc2e39d4fc80e82377ac074a1c095d1394c99ec8"); + FeedZipHtml(zip_buf, 13825, + "6cc4497b3c20fa1c7f386a1f3e340547d950466124d55b2b5e"); + FeedZipHtml(zip_buf, 13850, + "698c42d3d55caedb43a3d583547829c152f09aa4da14b567f6"); + FeedZipHtml(zip_buf, 13875, + "7968f47a780ad0942e82ad214af16c3957918d5c45a7d20322"); + FeedZipHtml(zip_buf, 13900, + "dac1fee9f17efbfcd3eee9d1d1fe6efbf09e48973dded49191"); + FeedZipHtml(zip_buf, 13925, + "4ae198d781ac0b283e200aa55bd65aeabcccaac6352323c912"); + FeedZipHtml(zip_buf, 13950, + "a5309be5cd7552488baf37fa94d7abe1fd2f930d4dce6f18a0"); + FeedZipHtml(zip_buf, 13975, + "7302318f4eb741a2acadb97131a3b6cac15094ec12483475f3"); + FeedZipHtml(zip_buf, 14000, + "4258f3ca92e5ee824ccc32a9e4d60724553981b2cbd2fd88d1"); + FeedZipHtml(zip_buf, 14025, + "1c1234ef1139c732f3cace9d0e803918e6929af90f393578fc"); + FeedZipHtml(zip_buf, 14050, + "aeae324c7cbc96facb2e300fd99a9186eac96566d3279ca1cc"); + FeedZipHtml(zip_buf, 14075, + "a64b3e7e7a287a4433233fb7c4abaf2f3ab9da57ce3867268e"); + FeedZipHtml(zip_buf, 14100, + "ae54a0320b9b7dc59f1ffc923fcfb7e6e3f2351f3ffc351fcf"); + FeedZipHtml(zip_buf, 14125, + "49e88a557ffe6b2d3b559eff3d5f1ed17f94e51195cea7ef5a"); + FeedZipHtml(zip_buf, 14150, + "557e2cf2d1c79633a6d0a6337d852d037e6d6f2c33279f193f"); + FeedZipHtml(zip_buf, 14175, + "9d8dd39a7a3a4b7c78b36624f654af0b9d313fd7ece580954f"); + FeedZipHtml(zip_buf, 14200, + "f04aa5d2b2d17c9a1f89337e7a8f48bc6d128996bdebf3fc48"); + FeedZipHtml(zip_buf, 14225, + "9cf1d37b44e29ff3205107e1e8d3418ca66a662ccc6876e57a"); + FeedZipHtml(zip_buf, 14250, + "5411b214eb967de4787eaccff8e93d627dd420d6473361fdce"); + FeedZipHtml(zip_buf, 14275, + "79b1ff59b69fed4ea22bd8618bcf56bf7ee79bdc05c6e8965c"); + FeedZipHtml(zip_buf, 14300, + "35a56d2da78b9c4a58345957f372365fe40cdfdd139fbb92ab"); + FeedZipHtml(zip_buf, 14325, + "8d836efa8c989bb0bc7ca96ed80f7a2548532db3a1acfe570f"); + FeedZipHtml(zip_buf, 14350, + "0b61f41e7b0abe9c28bc66a9de7a86b83b12c120195ab2c472"); + FeedZipHtml(zip_buf, 14375, + "43190a6c6a527a17f8edf19ba413f66ed56be7cce27e7edeef"); + FeedZipHtml(zip_buf, 14400, + "4b85f1c30fa763111ca07ac2404a9d06337d114de199129615"); + FeedZipHtml(zip_buf, 14425, + "7662752689e3d1e2fbbe87c1549c5f2d7040dbe0bb6955f3c2"); + FeedZipHtml(zip_buf, 14450, + "f9266eaf41df29af87c206fc0fc3269f4967683fe7b217c409"); + FeedZipHtml(zip_buf, 14475, + "d3b2da30d9096426392e85249e12757914e7bafe72fdf9faf3"); + FeedZipHtml(zip_buf, 14500, + "1c62cd72bd2adad34824c05169b91bd378d50138c348a5b350"); + FeedZipHtml(zip_buf, 14525, + "392c806ad9cb3c9b9c9631d42a2627bf14beef8de3d0ebe553"); + FeedZipHtml(zip_buf, 14550, + "4fd5ddd11b1ffd2191d5698d64f66df4aec2515544b17c7a97"); + FeedZipHtml(zip_buf, 14575, + "e6b8ca2cb42ccf95f95011bfe3250ba7854215fbe1b58856d4"); + FeedZipHtml(zip_buf, 14600, + "cc699cf5683ce130632e9ca726314bdd96753e88849b38bb5e"); + FeedZipHtml(zip_buf, 14625, + "975e2e8ec75178e38d284e9805b90f3a0be6e46719d9107a72"); + FeedZipHtml(zip_buf, 14650, + "76ca82f1b1731406838d2337310a1dc4fc62f1da8827266b47"); + FeedZipHtml(zip_buf, 14675, + "f9fac7be1bb811d5f07cb07291d7c76722f288c04595ac9b5a"); + FeedZipHtml(zip_buf, 14700, + "0e15c8bb98447db75b532d8388dce5fbfb1484b1821b6521be"); + FeedZipHtml(zip_buf, 14725, + "2329f53b504d47f54b8e8859ebb4106262537155086e48cd2d"); + FeedZipHtml(zip_buf, 14750, + "668a0746e225abbb74f2278db70c31e1f7453d117b5da7d4fc"); + FeedZipHtml(zip_buf, 14775, + "941d6637c71a761203c3e10d28a241beb2a1eb4ecee88e99e5"); + FeedZipHtml(zip_buf, 14800, + "dd380ebb1ebd8d213b149fde108c9ebc7f1de812dff2958be0"); + FeedZipHtml(zip_buf, 14825, + "3b557cb4897fb0cf19ab4d7b09d60be3cc4a89fa63e08b986f"); + FeedZipHtml(zip_buf, 14850, + "580926cafa6326734bcd043db3969e3cfb72dded4977a8be4a"); + FeedZipHtml(zip_buf, 14875, + "ab89891b1591af458e66d5be8453cdf8d6a49569fdd3cc7b88"); + FeedZipHtml(zip_buf, 14900, + "57f820420244cba479e32264f2301d9338f9e2062f009845ba"); + FeedZipHtml(zip_buf, 14925, + "aedf9df8fc8079553edf9bc4047a4033c27907c68e31ed2f3e"); + FeedZipHtml(zip_buf, 14950, + "929d6ca3607347906be2e9c988b8114049dcf85b395b4ad18d"); + FeedZipHtml(zip_buf, 14975, + "50764b59133b719f27ee6c803b3348bf2706556c59091b3e8c"); + FeedZipHtml(zip_buf, 15000, + "a377893faa6d84ea73957d9bf236e3b0c0d83f9a9cfd9a60c3"); + FeedZipHtml(zip_buf, 15025, + "fd413fe2ebdcc25e11392017dd6fa050713f937b4d29031fc6"); + FeedZipHtml(zip_buf, 15050, + "bbf2817831cf30b794316b79d6f5fadf2ddb8078f839d75fa7"); + FeedZipHtml(zip_buf, 15075, + "b834728de053cd2e42cbaff957e901ff2afe6a38ebba2bce5b"); + FeedZipHtml(zip_buf, 15100, + "477ba2bae515c60fe3736bd033ff3e3bbdeb7ef544ed8a1a0c"); + FeedZipHtml(zip_buf, 15125, + "366a037c309e416d83070822aecbb0eeecc87f49473965bbc7"); + FeedZipHtml(zip_buf, 15150, + "678163976a0246e1643094c5fff41b6476fb51381d570de4f7"); + FeedZipHtml(zip_buf, 15175, + "c6253c43bd4f037d7a281c3533edd9b3c6464d2feabc63dcd3"); + FeedZipHtml(zip_buf, 15200, + "3144f95407133772e16b8ed8f53da1f4b904dd6901bb10f8e5"); + FeedZipHtml(zip_buf, 15225, + "2249e54cbcbe2d618d6cb138aa2c191aec5982f547b5b2d6e1"); + FeedZipHtml(zip_buf, 15250, + "1540e3934a121f8800bef6bd3f453343cf631cd520ac8c814b"); + FeedZipHtml(zip_buf, 15275, + "f37eeb32cf9c752066fc789c624215e8d4060b0670df2a1f3b"); + FeedZipHtml(zip_buf, 15300, + "2c64e0bbf1da99987c8373d28fae3f80c350321cb10ee2fab3"); + FeedZipHtml(zip_buf, 15325, + "f0a99103c12b0f28559439933eeb3657b0a8609c7ccf7b61a4"); + FeedZipHtml(zip_buf, 15350, + "c500f1e8a85f8ff89912d2b49f281a2fe2d2f5bfcb2e5df154"); + FeedZipHtml(zip_buf, 15375, + "ae8a857cd797ac27935159861eddd402c51f08955e26adb132"); + FeedZipHtml(zip_buf, 15400, + "cd7a9a6b807b8c2e28642d9759a94ca0ab4c889312d3e1a474"); + FeedZipHtml(zip_buf, 15425, + "fdab4e905b7f0d2be26ec33d9c4b5afe81f40bada7655e71e7"); + FeedZipHtml(zip_buf, 15450, + "4ab2056f37cb0d8c9d5ed98db76aa9c018e579c906bf7ca19f"); + FeedZipHtml(zip_buf, 15475, + "638fecda1c3e75a9a16caa9a0c959637eba24240312d95e1cb"); + FeedZipHtml(zip_buf, 15500, + "c452063d4e01444d4c229dbf93b33a19fdbdd148f4d0cfe2df"); + FeedZipHtml(zip_buf, 15525, + "3a1dd147331cc8a416c7b92fff1451b8863070169d9b8ae499"); + FeedZipHtml(zip_buf, 15550, + "e67f3b8eca26541c5266355a41e74340852165e222126e0db7"); + FeedZipHtml(zip_buf, 15575, + "aaf0876ea2be7501f54031b3f5145e2d789cd88a0a6f51a188"); + FeedZipHtml(zip_buf, 15600, + "40a61a15bdf283c885288d7711c97496b2f38e95d9a633f172"); + FeedZipHtml(zip_buf, 15625, + "665c1e03839de3bb5dc50dcc096ed2185f2e84192a23a0cce6"); + FeedZipHtml(zip_buf, 15650, + "d9344d2de2373bf87dd0d9831d3c5dc53d92b13c22cb685c00"); + FeedZipHtml(zip_buf, 15675, + "0961e8c74f41859ffba21fe7952ca19fd138879e9c4ec4458c"); + FeedZipHtml(zip_buf, 15700, + "bf4c4202f48f44e3def9a8f973d9515379cabe1881304fe1bd"); + FeedZipHtml(zip_buf, 15725, + "9ded5dc06e14daeae6aa96f2c81cfbe96896efee31bca32bc1"); + FeedZipHtml(zip_buf, 15750, + "a4e88e55e77ae87587cec8bd65f7ea24c19803c79eef2e1f1f"); + FeedZipHtml(zip_buf, 15775, + "b51309d772ea815f678b6aca1e5f66fffc1eb1e902b41c0a65"); + FeedZipHtml(zip_buf, 15800, + "d5e0258b692800a9f1d1171d7bd487fee7edf6e9d9e974842e"); + FeedZipHtml(zip_buf, 15825, + "39f088e66d24e6e8620c3dee35dca88eeca62915bd082fbe23"); + FeedZipHtml(zip_buf, 15850, + "2fb97db6bd9bfec1fb434139a61d1eb8904ab270e88301b673"); + FeedZipHtml(zip_buf, 15875, + "88bb7c9ae59a1dc5fad5293a1b4c2f733ff48143e8a17c188d"); + FeedZipHtml(zip_buf, 15900, + "608c5734039900d92ccc18a94143bf755ace4be77f3b6787f0"); + FeedZipHtml(zip_buf, 15925, + "3fb00fb590b75600391bd0807feb20b715d9c1f8618591a512"); + FeedZipHtml(zip_buf, 15950, + "04d03c1b6a22cbac5e221311a4798f69a7e10031a20ae731ce"); + FeedZipHtml(zip_buf, 15975, + "048ed1efe427cfaed1cb94357ba5e649a7e49576b637394973"); + FeedZipHtml(zip_buf, 16000, + "de51e662005f9f33e42bc672e2a13bcee65b56a35c09c0384c"); + FeedZipHtml(zip_buf, 16025, + "4d43d14d31887d20e01bb4ca568cd179f0640898ec511de0f2"); + FeedZipHtml(zip_buf, 16050, + "41690dd203640e9c1f8cee6701371446d2f7b11008da6e34f0"); + FeedZipHtml(zip_buf, 16075, + "6bc721bdc026a11a413a76b0f636c827b4caaf10738292c966"); + FeedZipHtml(zip_buf, 16100, + "333b736e876caa6799ab3bc775fa5a3953433d2524d10b3548"); + FeedZipHtml(zip_buf, 16125, + "da9e3818389360e4502173357b957aaa14a08cda71e3788219"); + FeedZipHtml(zip_buf, 16150, + "b28d24dbbcb2423e6a3b90c4671a0033698cb26de29ab36bcb"); + FeedZipHtml(zip_buf, 16175, + "393fbd85ddadfb6ab51abac3f6bafcbd8fb396b39a723b70de"); + FeedZipHtml(zip_buf, 16200, + "7294a12d5fd7041c234a85a65193701ca856196945b1e27eb9"); + FeedZipHtml(zip_buf, 16225, + "b8ed524ac44c1b260653fdf4a8f6ccbb9ecafe559e45408af5"); + FeedZipHtml(zip_buf, 16250, + "233c8339cd1cc054d52c7bc094d9da72c688aebc3a34fc0b17"); + FeedZipHtml(zip_buf, 16275, + "76ffc5dc83dce32da03060463b785cea1a3a998c546d308d43"); + FeedZipHtml(zip_buf, 16300, + "a066b1c57eb96af6a8468ef582353fc71c43f01ded7c703c88"); + FeedZipHtml(zip_buf, 16325, + "7b5a2f8be4123a990bb4dcd1669a4b10507eb35ac1fd8d0e7c"); + FeedZipHtml(zip_buf, 16350, + "9ff8c6d063632d5c109d2b28ebfad61e9b4f3abe84c2cf6398"); + FeedZipHtml(zip_buf, 16375, + "d6ebc31f6585cdeface0379f976978b49acc249d8f50d1371a"); + FeedZipHtml(zip_buf, 16400, + "e671a0abee58b551da9ccd4364a2b0963a997fa007a2527ade"); + FeedZipHtml(zip_buf, 16425, + "95d7c3423b26c64a548b32cd2d6a453755a2a15cfe4b139536"); + FeedZipHtml(zip_buf, 16450, + "3af03dab9542389a0cb9e9eac5c8824b198d43db3467f68b8b"); + FeedZipHtml(zip_buf, 16475, + "5fdc9b2adaccaba26408c67082af1552b35a60fa2c2c6a2e4b"); + FeedZipHtml(zip_buf, 16500, + "0441bf2158eace95e73ac7efcebff72480c79d681fab5c5912"); + FeedZipHtml(zip_buf, 16525, + "dcc816e6facd3c2703c3e3ef5b85dfa7289abb5f8135198acf"); + FeedZipHtml(zip_buf, 16550, + "cc5e1690ef34108baf82f0079b74321b6cc93289545a8c19b0"); + FeedZipHtml(zip_buf, 16575, + "44d70101f6bcf80ffb4da8d1f844a04608c44e1c742248b516"); + FeedZipHtml(zip_buf, 16600, + "9a44434ae14248158ec6c92d3a0faa48d70e27dda16def4fdb"); + FeedZipHtml(zip_buf, 16625, + "9e08d718e1c83192469176c3d128c4fce7c9b510419e8c78ef"); + FeedZipHtml(zip_buf, 16650, + "2777b14920298d7f74b0d8a2abea24ea8faaa8fc3bd552b512"); + FeedZipHtml(zip_buf, 16675, + "999b9e68dc94f604d2d18b257ac848a18ed233cbfe3f266e15"); + FeedZipHtml(zip_buf, 16700, + "ad4eaf44e4bb63bb48aac6277a2d4b99c254139fc5d54d6157"); + FeedZipHtml(zip_buf, 16725, + "4fca78389df314fdc5e9f764e761654fafdf17546a9a2eb73a"); + FeedZipHtml(zip_buf, 16750, + "215ab875c4f65081666786b4f9891de67976aa330052caf6c0"); + FeedZipHtml(zip_buf, 16775, + "c3aaa5e855efc1712011af9cd9b65c3c5bd0965b4ad17d98c5"); + FeedZipHtml(zip_buf, 16800, + "0fc722aea22ba556bb6a94b4663d641e3e0fc64226a933fccd"); + FeedZipHtml(zip_buf, 16825, + "66e9d3a755e7b6aaf166abeacbf2c686f1f32016d0bcecf29b"); + FeedZipHtml(zip_buf, 16850, + "0bbc5957594f289504268e80115d4e45475901fab2ce485e5b"); + FeedZipHtml(zip_buf, 16875, + "71e95f4eb74fe3b878974d97d17c8a641d2aba78ef8b9b66e7"); + FeedZipHtml(zip_buf, 16900, + "d649ae43f4b347708457857631c5f4cd26a292934ca3d0d16f"); + FeedZipHtml(zip_buf, 16925, + "5b8824faad5e5ca0faef416aa64249dfbb2927da61eaeb25a0"); + FeedZipHtml(zip_buf, 16950, + "ddaebc3db6ee33aaf16997b95372832984e4ada4d276dc2cb5"); + FeedZipHtml(zip_buf, 16975, + "1defeea5da2af752593d53dfb9438a7c4e1671e1df1bdc4fe9"); + FeedZipHtml(zip_buf, 17000, + "beb4a941971debf50804b4d20786196604fb1d4b7467b9ebab"); + FeedZipHtml(zip_buf, 17025, + "41bf97c90b0b72a73d71c37c67c4dabeb652475b735e36934d"); + FeedZipHtml(zip_buf, 17050, + "16e3bb7be29226bc7b4d39f6cabc7a8db9f44c865a889ff089"); + FeedZipHtml(zip_buf, 17075, + "9f2af6a04a2f62295394bb0f1bf41d9a8cb12097e4136bccb7"); + FeedZipHtml(zip_buf, 17100, + "21dd9bbf72370ae3d8b6c1c98686d9aeb9519fb86e215c773d"); + FeedZipHtml(zip_buf, 17125, + "0c63a31c182e931343d2b0947f8d6ab7b837de6832323a6606"); + FeedZipHtml(zip_buf, 17150, + "e654a6b9a979022fe8fa931e6c9672cbe58155441aae36cbb9"); + FeedZipHtml(zip_buf, 17175, + "ab9583494709dd77c3a7c223cf157c0c4355707d952b7721fe"); + FeedZipHtml(zip_buf, 17200, + "551d41b808c7ff13fb377a3550cbfb56ee7a6bd0ef96d19c8b"); + FeedZipHtml(zip_buf, 17225, + "71e73df1ceec0ebf4a675f05c75c5162df22bfe0ef8d734b43"); + FeedZipHtml(zip_buf, 17250, + "83cee3fafd5e386133cb0688f14a530b7b88de3b4b0a44ddb4"); + FeedZipHtml(zip_buf, 17275, + "08366868dc274ea8e284bc4e20bce3ed580943e41f109fa397"); + FeedZipHtml(zip_buf, 17300, + "de92ae16fdfda707bb4ed70dc200a35f29f6d505cc08f2e3eb"); + FeedZipHtml(zip_buf, 17325, + "2b501e60563aaf3a637c731905c76e127937d85e3f25606353"); + FeedZipHtml(zip_buf, 17350, + "b6c54df210362bc2f87bf50cd30bf00694ef4ef02de124c941"); + FeedZipHtml(zip_buf, 17375, + "9e7ddeeb8c39f53abea98555b8ce3012fdb7cf8649328e5f6d"); + FeedZipHtml(zip_buf, 17400, + "6c8860fddafbe68df125ed7a180d36f0af8dbdfdb57f1d1e3f"); + FeedZipHtml(zip_buf, 17425, + "dbe6ff4bb733f4e848dbf18f4a4c54fe18d3ceb25d43399831"); + FeedZipHtml(zip_buf, 17450, + "94f392e2fd31be8acc207618fabdb82c8b0f303d88c29a4520"); + FeedZipHtml(zip_buf, 17475, + "9cd65918270787176bf8a679a509f9900ca918b401f62f1bf1"); + FeedZipHtml(zip_buf, 17500, + "2e32dc09a292e7010d025e6b9a856f1238d3aa7cc29b67580e"); + FeedZipHtml(zip_buf, 17525, + "4d883c4adbdc4b93e1bacac68f613918f6f085c5ed2b3dcacd"); + FeedZipHtml(zip_buf, 17550, + "1c0446c480eb59010cc7d8069ca69ff7c292011984811e3e0d"); + FeedZipHtml(zip_buf, 17575, + "1ee183719aff1d7b836f9d93b0279cf3892fe8482bf0d180e7"); + FeedZipHtml(zip_buf, 17600, + "63467c14c0a17ca13c2555403e2542679be2295e39b0236c1c"); + FeedZipHtml(zip_buf, 17625, + "9fee6d392dc284bcce902913e96db3f1541727371f8df7f483"); + FeedZipHtml(zip_buf, 17650, + "dd49f02d08afa5ee58c93f5b87e9b678bafda037e6ebb2428f"); + FeedZipHtml(zip_buf, 17675, + "17dc83d221c030889c8ade2f65ef3008cb3ba72fd67fd8c929"); + FeedZipHtml(zip_buf, 17700, + "069d128ad446ae9a2255e81037988c98339cc3c2052e8d6a84"); + FeedZipHtml(zip_buf, 17725, + "20cb47f81da671533200c376872d2abe98a3f9c845a748efca"); + FeedZipHtml(zip_buf, 17750, + "05f61990e35f1550f7627e00e276873c2b5eb8e3af8062d099"); + FeedZipHtml(zip_buf, 17775, + "68054462885e912b213d2c48a6bc8ef39258f8fd955cca6620"); + FeedZipHtml(zip_buf, 17800, + "d7388c630f0388328cc9908db0be86be9bc0c09b8150cf9a34"); + FeedZipHtml(zip_buf, 17825, + "b1cd07e17f4ce28412e6e757ce8b2626e98613bfc7d8c367ef"); + FeedZipHtml(zip_buf, 17850, + "b8f5c947ea60c9a067456b6a80552032d1c2015011e2126cbe"); + FeedZipHtml(zip_buf, 17875, + "56fe221594148e45e42a4a31782e4b150c3614eed5ad232b84"); + FeedZipHtml(zip_buf, 17900, + "a8e8220fa338a919dfacaf82f06228131a56842511d1ee4c4b"); + FeedZipHtml(zip_buf, 17925, + "0b43f2804ee209f5d73c708d6b4a0b0760426c2ceb62b89cb4"); + FeedZipHtml(zip_buf, 17950, + "dca3b4d2db09e69bee5074bf61ed82443b61a9e4ce2afa5ec5"); + FeedZipHtml(zip_buf, 17975, + "fa601d55c0e96ffbe7473b6717cee9b9d33efdb0fbcb3efdf3"); + FeedZipHtml(zip_buf, 18000, + "f0a4bd7f7eb1bfdbbe40056138e57e371ece9b691bd4968ad9"); + FeedZipHtml(zip_buf, 18025, + "cd6448514ad675251425a70a03f5d6b0446eef316da47ecbd8"); + FeedZipHtml(zip_buf, 18050, + "5cda1e9bc512bbbb6edf979219737a379b1a2ea8ea185826ee"); + FeedZipHtml(zip_buf, 18075, + "23afe73f904b303da00fd67232c86cb86e17131ff4221f1f84"); + FeedZipHtml(zip_buf, 18100, + "70f7bc3821c1790a0db21fc6f62482ace121d432a7d5373507"); + FeedZipHtml(zip_buf, 18125, + "d922c65fb6bbcf7815aa394d5fa7d3aac8d14aeb6849cbc44c"); + FeedZipHtml(zip_buf, 18150, + "b6b27b7e8137ec09e627b36abd7991d4509eb87b98fe419370"); + FeedZipHtml(zip_buf, 18175, + "a989e534387fa58296657bfb5982bc56163062b6cec88bab4e"); + FeedZipHtml(zip_buf, 18200, + "e40683f202265f985763cc232459d53cf561067b1687864285"); + FeedZipHtml(zip_buf, 18225, + "399fd3d9f9e9bfd75f5a39913c0aadcd15e555287025804118"); + FeedZipHtml(zip_buf, 18250, + "20f810eff2872dfac1e34aea327c871371110652abff83341e"); + FeedZipHtml(zip_buf, 18275, + "d5c83187119aa5f98caa7fa89fec07509c3476f05485550af9"); + FeedZipHtml(zip_buf, 18300, + "204789a7648037b7e3d8b212d6d929188cb1bae5f422ae6e08"); + FeedZipHtml(zip_buf, 18325, + "10bf7cb1f54fa745e50a7f3fb8f8f9e5ca2a1be9190869fc0c"); + FeedZipHtml(zip_buf, 18350, + "94c037aa86a079aa399489aff81c44e9af92dcd9167166929d"); + FeedZipHtml(zip_buf, 18375, + "50d775e9583089f94c0587027cd96fd280864febc5b0018dfd"); + FeedZipHtml(zip_buf, 18400, + "5f518dfbec98ce5b87694466350a351c0e103fa3105fd677bb"); + FeedZipHtml(zip_buf, 18425, + "93089fd573f9462e26d83376639a4b49b33edcbda21b6c9029"); + FeedZipHtml(zip_buf, 18450, + "7eb8a017c7188e294df18044bdcbf50ecd21b57298300241e2"); + FeedZipHtml(zip_buf, 18475, + "ddde82ccb197d6706d829294a17296f169298cbe67a32c734f"); + FeedZipHtml(zip_buf, 18500, + "2ff34b97dcd443eb9c0693f99bfdb2bea1b1ef6907b7d48852"); + FeedZipHtml(zip_buf, 18525, + "f142d64bf05ce738bfdb57445473f491dd68566d4d53a9d991"); + FeedZipHtml(zip_buf, 18550, + "1f268db08a223ab7553c18184b3dbd6c45b43a243af81058c5"); + FeedZipHtml(zip_buf, 18575, + "887f6f0081ea0ec505830226ed84bddb6da53a4dfcfdfcbcdf"); + FeedZipHtml(zip_buf, 18600, + "7fa63c83a763111c78fc348d6ca3825f0f406708c9b324d338"); + FeedZipHtml(zip_buf, 18625, + "52eecebeef218ff2711e36dcff39f212f2b96105b79ef34ddc"); + FeedZipHtml(zip_buf, 18650, + "5e83359677a0c0ff30681b125293a31ac5c503e52864211dc2"); + FeedZipHtml(zip_buf, 18675, + "dc24f7cc2cbfb37efb08f0c9e58738a1278f03189b6cbb0330"); + FeedZipHtml(zip_buf, 18700, + "400668daf4f50e3dd9d6e8b461fce27654a55533cd4d2bd6c6"); + FeedZipHtml(zip_buf, 18725, + "077f9894b3e8d6f87624fb576a5979fe69f9e1802e213f9e9e"); + FeedZipHtml(zip_buf, 18750, + "d30dd3d8ed56544f7d37c1218bb4e4df4b046195ccd5f2b31a"); + FeedZipHtml(zip_buf, 18775, + "74f8cfc4ed6169d7580c388f96e5c0564df0fb81e0e1708534"); + FeedZipHtml(zip_buf, 18800, + "71f196a343a8e00269fa9c89be5abcdaa32f9547f89ad2ec12"); + FeedZipHtml(zip_buf, 18825, + "6e3c9dbb4c7f423e2cb9a5614e5e36edcf458ea90c9f75e640"); + FeedZipHtml(zip_buf, 18850, + "06ec92476ad673a22ed1e35cd23b4d02756633f395b948a988"); + FeedZipHtml(zip_buf, 18875, + "8e807c145285d670052f9e97b9dc38e2f14adcfc32f12de9bc"); + FeedZipHtml(zip_buf, 18900, + "d2b6393782b9067838dc93d129b41467086b51245ed469b233"); + FeedZipHtml(zip_buf, 18925, + "f371124e665f70618a79ba4e5f50ec445c5dc18638e0177712"); + FeedZipHtml(zip_buf, 18950, + "f7c2a8df2ff78f17ba2cca51bed0899abde9329ca91aeaa96e"); + FeedZipHtml(zip_buf, 18975, + "55edb7c9041295c611e9812fd5c0cfb67de1467cfdc9a42da1"); + FeedZipHtml(zip_buf, 19000, + "ea2968bb3891b58a0baf8ffa7dd814a931154cb31872e4f6bc"); + FeedZipHtml(zip_buf, 19025, + "495cba359496d8a637484d0fbe10ba4d2bb3cc326f7a020126"); + FeedZipHtml(zip_buf, 19050, + "5ff49335acfdc34eb496ae93853101b42ac4b5f2a2724989c8"); + FeedZipHtml(zip_buf, 19075, + "1b0cf31fe9fa98e64721e1cde9d2ba75d4023997e9d25cc648"); + FeedZipHtml(zip_buf, 19100, + "e0edb7b812910a68d781053dd8dda89417dea71b63a5553c42"); + FeedZipHtml(zip_buf, 19125, + "80c5c34d68a044464ff345dda2e3986b6840c154478727fb17"); + FeedZipHtml(zip_buf, 19150, + "edf3c39303aacfa5eedfdd98cde1afe5362e0d75816b2eb38d"); + FeedZipHtml(zip_buf, 19175, + "0a5de6e2955507497219469784e69238263b9fde0f040f8c99"); + FeedZipHtml(zip_buf, 19200, + "9925ad9cba2239827f91f6d3dd18d336e27db0e7d08d44efcc"); + FeedZipHtml(zip_buf, 19225, + "4d86b69c4f6963edcda7e6e9abd19197c5482d798a3afe70d4"); + FeedZipHtml(zip_buf, 19250, + "3e34508ee117f938272ec722df5a632d44ae7512d3c2c90857"); + FeedZipHtml(zip_buf, 19275, + "77251c0553c14dc4448e31141018f6c0f2d4a7988b9dfdbbe3"); + FeedZipHtml(zip_buf, 19300, + "106f432e4bea41dafba5a51b4dd9ef476e57556dacdaabecb5"); + FeedZipHtml(zip_buf, 19325, + "ee163bd382e83f5675a315d4385c48c28b701bf174171cd0a5"); + FeedZipHtml(zip_buf, 19350, + "0f2e2d7d699756cea12b3b5d0829c72e7acdc8616102822faf"); + FeedZipHtml(zip_buf, 19375, + "e164b57159a5323d44316c146549b7513ec6e060b5c87236ea"); + FeedZipHtml(zip_buf, 19400, + "dbc272eaf3d0fe7f261e9b5ec9a52ade3395a18a1fd969ae8d"); + FeedZipHtml(zip_buf, 19425, + "c5129a4b92cb9a54b538aca9a91dfbdc0be239345580e62205"); + FeedZipHtml(zip_buf, 19450, + "5e651c2be543ce68a6c9ac760cc68c8c3e2994dd22154617b3"); + FeedZipHtml(zip_buf, 19475, + "ea8a5f6d8ec7c60dbfd3caef9db5f399c1817c8057b668da69"); + FeedZipHtml(zip_buf, 19500, + "14230b0a0a2b351743485da910270d442c973aa03a61851346"); + FeedZipHtml(zip_buf, 19525, + "6654465bc30271446256a94fcd2e768e2b2f623cf550b89819"); + FeedZipHtml(zip_buf, 19550, + "16c4cbd26133b332a428041d53d8d77e4cbce7664cf0faa035"); + FeedZipHtml(zip_buf, 19575, + "ad3aa2a31328f481d64da1acae45b76ef5186bac631b66918b"); + FeedZipHtml(zip_buf, 19600, + "49475556b3f2876eb7932ec612e09753f740e5a013416f7ae7"); + FeedZipHtml(zip_buf, 19625, + "4adbffc100d52c179e2b2e348b3c0b697aabd52aeee22b0dac"); + FeedZipHtml(zip_buf, 19650, + "50472b6503aee7083e20c81069e62cb5ae38cb4e794e522a8c"); + FeedZipHtml(zip_buf, 19675, + "625ebcc8e01e15756306f14bc72a872c4d1597e6187697a5aa"); + FeedZipHtml(zip_buf, 19700, + "449d99ad733a9f4a2a1f3739f022d886f79933a5651842e502"); + FeedZipHtml(zip_buf, 19725, + "55aa28e1b7095b3393830e999ee121832f3eef9f9f96dfaa5c"); + FeedZipHtml(zip_buf, 19750, + "0c6183863991976dc7b4b4754e7496b8059a1c7871748a2598"); + FeedZipHtml(zip_buf, 19775, + "acbaec6f479641a4c01d5b8803bfce1e479b84be88ea58a5e5"); + FeedZipHtml(zip_buf, 19800, + "27ec25cebb18d2820121aed36aa2d9e335be67e1573b1c4837"); + FeedZipHtml(zip_buf, 19825, + "dae4d0893844b97c16c3ea9f3957027439851182fed497461c"); + FeedZipHtml(zip_buf, 19850, + "882b6301b0a6a8ec255ff4c0f6001fa7744f51e2a5174e9812"); + FeedZipHtml(zip_buf, 19875, + "210a7d87efc7f08331bd718bd5b39d268f62b25492ed528a1a"); + FeedZipHtml(zip_buf, 19900, + "9abe1a6f70d86639035d328140878ce68a9674ade1c334f8e0"); + FeedZipHtml(zip_buf, 19925, + "78bf7dfe69f7f4e8687fb77d787ab2a2431f35ea47221ac867"); + FeedZipHtml(zip_buf, 19950, + "5d9a6dd4feaa7942a38328571883def3dc3a228a4272f189a0"); + FeedZipHtml(zip_buf, 19975, + "1b4e7019c21e56599f8877a3d52327095b61075a67d363c124"); + FeedZipHtml(zip_buf, 20000, + "1c088c794daf8ba6459b344f3bdcff8e0148cbdeab9be6a4df"); + FeedZipHtml(zip_buf, 20025, + "3cdf374dc1947260da728cb8e5c1174091ba3c09367695e79c"); + FeedZipHtml(zip_buf, 20050, + "a1ecadc9a33d55866d6d6eeb694d8f354ca5157dd9a46ec9b4"); + FeedZipHtml(zip_buf, 20075, + "348953368b0cf3c6579251c74b227cc26c5461e3d09628166c"); + FeedZipHtml(zip_buf, 20100, + "458099cfdbc52b0ad7a34175c81ead8e22d571600059b33c9e"); + FeedZipHtml(zip_buf, 20125, + "64dd381623dc38a1c7087d12219d2c5a32ebc28a712269c52b"); + FeedZipHtml(zip_buf, 20150, + "eb0be0d77713cfefed0024b6381cd93427bfcef3fdbdf1ebd9"); + FeedZipHtml(zip_buf, 20175, + "e9d1a783d3933cb31a3f3f6e4e4d1969116c3ae6baaf0be251"); + FeedZipHtml(zip_buf, 20200, + "5955d6fbd3a254d3b639b974ae019a65d3fd1b604eff367d5c"); + FeedZipHtml(zip_buf, 20225, + "edc6f22979463a65b0af0a68e13b3b970eff95bbdc224872ec"); + FeedZipHtml(zip_buf, 20250, + "7e13bad86fa1de42da5866187e29350da747e72d60f8f91e6a"); + FeedZipHtml(zip_buf, 20275, + "95d574f8d5031b916e6306433860e2ff6ed0eb1b7d0ac993f6"); + FeedZipHtml(zip_buf, 20300, + "9593260728ea11e9982f5327f25eb7a85554860be8eff5f034"); + FeedZipHtml(zip_buf, 20325, + "d4671e0b27094e2185f6a7d851c5cca9e071bd5a246d233741"); + FeedZipHtml(zip_buf, 20350, + "16e016f3d34a5e03a29a9ac532d030ab3bd214dec3c0801754"); + FeedZipHtml(zip_buf, 20375, + "3b7acf587f8d6c2e33d2f824618caa957a4b64b93ae3444641"); + FeedZipHtml(zip_buf, 20400, + "0892752d30de8fa5ea552e36bf178a38f82951873a82982e19"); + FeedZipHtml(zip_buf, 20425, + "02cac609c087835b4ea540474f0adac75c13da0456cef0b496"); + FeedZipHtml(zip_buf, 20450, + "8a5cb1595e8590bd0889fe10c0de5112d69eb6cd1dda3ec700"); + FeedZipHtml(zip_buf, 20475, + "0b50b2a2a86581c42af65e9196152d9cd37d4fc68caa300a05"); + FeedZipHtml(zip_buf, 20500, + "9f71606f01d899987759be177762e37c225f5ccadbb43564fb"); + FeedZipHtml(zip_buf, 20525, + "e28147664dbb714c3cac2c80d87b913b16251ec2f6a56e6dfc"); + FeedZipHtml(zip_buf, 20550, + "85d2bc035bbd4d4b621c33510929b0177b86354540746e9d1e"); + FeedZipHtml(zip_buf, 20575, + "2c4d4608495f01ea368ceb7963bcbde517b0692623990928f5"); + FeedZipHtml(zip_buf, 20600, + "2e94e8ccadc294c8761f3f191af4e3a763fa4b2721a68c0169"); + FeedZipHtml(zip_buf, 20625, + "1ea174a6adaa998a8be3993e67a6fa3c752e0a59a9749c3823"); + FeedZipHtml(zip_buf, 20650, + "4cc743412ea94ce2de787eb8c7664b76c4341e1c7b697e508b"); + FeedZipHtml(zip_buf, 20675, + "c9449bcbe833e5dfcd9afc804c84e585e5de17d5febb5b9d3b"); + FeedZipHtml(zip_buf, 20700, + "ca352f5632ce3dd4ec410f335825439888ea8bc92042818a06"); + FeedZipHtml(zip_buf, 20725, + "a6f4822eee601cdb0ee37c34b1f089fe30dec71bab4d533e81"); + FeedZipHtml(zip_buf, 20750, + "6e3a09132a52f6caa8fa85415ce94d152904997795b6c1df94"); + FeedZipHtml(zip_buf, 20775, + "2bd308e3cfb065df0565d49fe06168ccefc3e455aa179500ca"); + FeedZipHtml(zip_buf, 20800, + "2f785e3bcaabf2d9ec726c7431d4934afba803d5b254004643"); + FeedZipHtml(zip_buf, 20825, + "4041d95107534a5691cfe44034236f919e7f9bbdb607cd1784"); + FeedZipHtml(zip_buf, 20850, + "4074dcdc314b4e7728a39d8c87ded045e6c176b33d03f2abaa"); + FeedZipHtml(zip_buf, 20875, + "d190abd4594ae9fd215fac59d64ab0b1754549ae301f66fa50"); + FeedZipHtml(zip_buf, 20900, + "41310c6164da566dab9ce6f0754299562f7f95a0f5ebfe4d57"); + FeedZipHtml(zip_buf, 20925, + "90a8d8ab335afa2d4cd5cf3fc56c4a7f6993af6699f00d272e"); + FeedZipHtml(zip_buf, 20950, + "b9c7cd281b6da45481caa03609706b0240b55a3058899382dd"); + FeedZipHtml(zip_buf, 20975, + "61ef32be58cdf45669270c3d0d3f0a79d2e5e4624ae9e75287"); + FeedZipHtml(zip_buf, 21000, + "5224aa3c25a516c3caf43dc1a44bf67550798a4133c3a09962"); + FeedZipHtml(zip_buf, 21025, + "90860721842550de2b5e13e0736b2fc5a4ef76bfc92b26d429"); + FeedZipHtml(zip_buf, 21050, + "59b5a644dd0b62fca1c77e934cfc554ab9554760c4c0755ee7"); + FeedZipHtml(zip_buf, 21075, + "6c84515ec52a0009871ddcdee24917a061856ee2c0c496b920"); + FeedZipHtml(zip_buf, 21100, + "4e2c8334c6b42de6828cacbd6a6d53a0d14fa6a4332dd57f2b"); + FeedZipHtml(zip_buf, 21125, + "b361c00a2c0644a7e95159231bf07b6916c78edeb5330319e9"); + FeedZipHtml(zip_buf, 21150, + "136d1b6c7d9dbc3a4529cbe6842ef9c0a4c1a36041f42a34b7"); + FeedZipHtml(zip_buf, 21175, + "17c7a17f252e8cc76d59c9cff798f3247687619a7592cc7d97"); + FeedZipHtml(zip_buf, 21200, + "b05ae62f60e3b478aa62e72d4d3cab07573b555fa9286d8a83"); + FeedZipHtml(zip_buf, 21225, + "a4e9642e23ca8d3909dc7e9f6c697976e4ce5900691e0652c3"); + FeedZipHtml(zip_buf, 21250, + "ac00ea49b2481931ce90ea2e7a11677ec50c6531bad9f63b72"); + FeedZipHtml(zip_buf, 21275, + "dccc83dc1bbfa534cedc04c81f1f2f2bc92233854553982def"); + FeedZipHtml(zip_buf, 21300, + "5a8be0323aabbc07231fbd752591e069fb1d2e47e71ae48168"); + FeedZipHtml(zip_buf, 21325, + "b5aa1bd2b9f8cd76b89f7ec9c5812d92e7b2aca572e2021307"); + FeedZipHtml(zip_buf, 21350, + "31c7ada41b7ae19954fe126b416cb53b497612cc2e5dc65769"); + FeedZipHtml(zip_buf, 21375, + "87a64f380b18feafc18b65d71877ba0c68298a9369c96c9a94"); + FeedZipHtml(zip_buf, 21400, + "de4194f27f9562a739342f198f0c940a267f695e1cb4fb3e1e"); + FeedZipHtml(zip_buf, 21425, + "fb5e42e1b9d7211c384003c72ae60ba0a2d0313815a81310d9"); + FeedZipHtml(zip_buf, 21450, + "e978388d19349c775192422ab14a52721de654c1f38ff2d7e0"); + FeedZipHtml(zip_buf, 21475, + "fba67430f1a1de2b5752958c39d2d7b259caa26cd632e5f0a4"); + FeedZipHtml(zip_buf, 21500, + "afcde3513e02a12319ce8c10575a5f397e1f1b9befeab887fd"); + FeedZipHtml(zip_buf, 21525, + "9b0443ef4b03e8d22ea5395e284df61bebabe45201687ef466"); + FeedZipHtml(zip_buf, 21550, + "05e3805e25205ed36011755ccaa46675f9f1b1f1420cbd4ab1"); + FeedZipHtml(zip_buf, 21575, + "17d3299fbc062a49507a388725717af68b49676d90de7c512c"); + FeedZipHtml(zip_buf, 21600, + "3c3af9f1305ffc869a60296164ca53e18a84ef10de7282d035"); + FeedZipHtml(zip_buf, 21625, + "fcb078b9b125fba4b25bd2f1851e8c842ed76b9a7ba0ca0b80"); + FeedZipHtml(zip_buf, 21650, + "2131e4c409f086578c104f2a13a44ebddec7dc392b19ddd1c6"); + FeedZipHtml(zip_buf, 21675, + "2689533d511ae54317c598e49392ed77d446d66115d2c96c64"); + FeedZipHtml(zip_buf, 21700, + "1d2cc33196ef51d09d462a90a041db7f42ae961211927c6b7a"); + FeedZipHtml(zip_buf, 21725, + "14f32254e8726f7a7e0e762ea24a31b895759163f92150a8b3"); + FeedZipHtml(zip_buf, 21750, + "37a79f1239b58f2bcfc177e31d7e6ea979a51ec5cc8bbb2ab2"); + FeedZipHtml(zip_buf, 21775, + "1941858f9076e6ce3c0f0173df2f928ad9540bb390b234b6ca"); + FeedZipHtml(zip_buf, 21800, + "d2e93112519b3bf38960faf1628590e6a9433b7e67bb834fad"); + FeedZipHtml(zip_buf, 21825, + "8f3903bcf5e24d3ec7a57e97b263a99130bae4621c6fe678d6"); + FeedZipHtml(zip_buf, 21850, + "8317d97a3e9aaed1699ae5a3f30aab4387b2ca8acc98dd54ba"); + FeedZipHtml(zip_buf, 21875, + "b4a469c1d7b959c34266e16f8a11e4842539ce490ae48c26af"); + FeedZipHtml(zip_buf, 21900, + "d48a31cb0498f1457f29ac44401567a66efc8fd7741486baa3"); + FeedZipHtml(zip_buf, 21925, + "a07eb21ded6ea92732cd7836d006466ab84ee3f0777cc090ac"); + FeedZipHtml(zip_buf, 21950, + "6bbf5d964c2ebb2a362f3b0f2203d24bda5206c41e826f13ef"); + FeedZipHtml(zip_buf, 21975, + "260712a2a502f2d02585df11836e950c1c2f51660a73ff35a5"); + FeedZipHtml(zip_buf, 22000, + "a781dc86ddf9731b52d9b62ec6e1d4ca6df8d74fa3bf277c77"); + FeedZipHtml(zip_buf, 22025, + "12b8b7edc803fe9b70f08fe5eecbd6ad447560b8b9e80d447c"); + FeedZipHtml(zip_buf, 22050, + "4967e337d95a365f6a3d96fd5a23f2fda1c0346f4c4b47c6b4"); + FeedZipHtml(zip_buf, 22075, + "ac29a6cc8e34435a36850927830abbb2c9fae5b245d1f2cf69"); + FeedZipHtml(zip_buf, 22100, + "e8a04d911559b316cdccd714a321fd89180a929ea37e8a9d0d"); + FeedZipHtml(zip_buf, 22125, + "a528e0dffa3171c99d1c5fc4a917c8f432a0eb25342a45fa0f"); + FeedZipHtml(zip_buf, 22150, + "043ae9ccd8084b0d5cd34140f3a88a7f1d61d8caf9d3041bcc"); + FeedZipHtml(zip_buf, 22175, + "2d37f74a88d1e88b78856f1d75ad4c3d46f670a94acf98097a"); + FeedZipHtml(zip_buf, 22200, + "536eab51d4a8967e57ff95d41db54481aab84c9c2dc0928858"); + FeedZipHtml(zip_buf, 22225, + "fdd4c205ab94ca88920e01a3a8528eb4812561c8ef0456249d"); + FeedZipHtml(zip_buf, 22250, + "aa5e6703f6faaee793ad596639fd16466110feb1e7b983c81d"); + FeedZipHtml(zip_buf, 22275, + "15354db67d6e71eec3c7e252e0f9f032c6559749757dd99fae"); + FeedZipHtml(zip_buf, 22300, + "911a807db9c0dfbfea92287324ce9e74563d9df5a8f4123332"); + FeedZipHtml(zip_buf, 22325, + "33752cdf2d22fac36bcea926698411cd04c29058798c572532"); + FeedZipHtml(zip_buf, 22350, + "8a134660b354e1a58376b1ccff3712af32358ed9e2e7ea20ff"); + FeedZipHtml(zip_buf, 22375, + "f85fe9adcef7a15f77c3a00bdc5f9a8c5d355668a7bedb4df8"); + FeedZipHtml(zip_buf, 22400, + "32ae54e910f52e878090787e636aba427d0cf0debf0e35b0f4"); + FeedZipHtml(zip_buf, 22425, + "7deb4ff971467d9a9a535e0fd914eaec2a42a91b18911990d5"); + FeedZipHtml(zip_buf, 22450, + "1abd97885925bff85bec0d46ee6b6ae97b7e42b5235e73786e"); + FeedZipHtml(zip_buf, 22475, + "d777e9c50a579ef7b6a98a25f19ae4e7db7042af30181754ab"); + FeedZipHtml(zip_buf, 22500, + "9a9e35736a483d9c2328426eb605bc2355ab39c8dc200c51c9"); + FeedZipHtml(zip_buf, 22525, + "ee10b93a9c487f00db53af4fe51746ecdd58955bfa5ef46f03"); + FeedZipHtml(zip_buf, 22550, + "be8dde5cbe8df376fbf4ecf4c9a961bcc7ff0d23d6edaff1a9"); + FeedZipHtml(zip_buf, 22575, + "69ceb09e79be9f7787c0c2a74cd9b9b70600057e7309bd081e"); + FeedZipHtml(zip_buf, 22600, + "e865d38cca8ac96c627a681bc2b9c62c0c7e24dcdead438f06"); + FeedZipHtml(zip_buf, 22625, + "6465522f29ba2155580c3e7149f0cbbbda3e9a387b5edc75a3"); + FeedZipHtml(zip_buf, 22650, + "9ea86200dde7ae9c30cf40cb6389dc03a8ac0ffc5a8752a4fb"); + FeedZipHtml(zip_buf, 22675, + "3a80da4bd1c7ef79338cbfe25c0f3d309088bcae6635f978a9"); + FeedZipHtml(zip_buf, 22700, + "c850d3e8a97cc941589c9ba246d433c632b2cbd71bd68c2869"); + FeedZipHtml(zip_buf, 22725, + "9b9d3a53ea574dcf163865fc6905b296ca1c99b480352cc5d7"); + FeedZipHtml(zip_buf, 22750, + "289aa3497768beb0dde03c13dac2abad30dc380dfe49ebf46a"); + FeedZipHtml(zip_buf, 22775, + "becbbc2364bb10ce7c137a0f0dac1a84eaf187fe182f720596"); + FeedZipHtml(zip_buf, 22800, + "d07203c9390947d3dd4d8b5c604c9f8593f0e73226eaf86e4f"); + FeedZipHtml(zip_buf, 22825, + "14683f9d7bcac774ca06bd4f8e6127a954251c43053c24dfbb"); + FeedZipHtml(zip_buf, 22850, + "756438a4d608b9ada173abb6245a5863a43a12fd327261d322"); + FeedZipHtml(zip_buf, 22875, + "48563eee7741367aceda87c164509d6cc762300e966549495b"); + FeedZipHtml(zip_buf, 22900, + "5737ec68c030c445bdf9517373942d9bbc68bd70e573ec99c6"); + FeedZipHtml(zip_buf, 22925, + "fba6068f06d39231513fd190e0d26abac6956503fc788e298e"); + FeedZipHtml(zip_buf, 22950, + "4a1892da16c19115037fcf2cc9f594b23c398dbc2a81b17508"); + FeedZipHtml(zip_buf, 22975, + "bae41f8d93db8af0a79d3fbdd1241916594036b49c7152781a"); + FeedZipHtml(zip_buf, 23000, + "b30a3f16dfc5d4ae6f5035b4631f7b11850da6b001a2946ed6"); + FeedZipHtml(zip_buf, 23025, + "408403ca4be206f14a9a14631846de9f68b0faea847225c817"); + FeedZipHtml(zip_buf, 23050, + "6226efe86cc31acd3414b0b8d9bdbcef644a16fb58b6c45994"); + FeedZipHtml(zip_buf, 23075, + "b44c14dd04172af37dec910771b2fd729d12ce4fc8014fb95f"); + FeedZipHtml(zip_buf, 23100, + "642912593124c64e68bd6c80b543fd28f7892ad221395292d4"); + FeedZipHtml(zip_buf, 23125, + "74a70085043ddf18813c30d3e22702d87e1c875e65ea64537f"); + FeedZipHtml(zip_buf, 23150, + "0d6740d469a0ea4874bfbd7236b7de3e7fedbc787b76b8b1f5"); + FeedZipHtml(zip_buf, 23175, + "daf927fcdfd7cebfdebec03f4be5e12c0affb066f0950d2d59"); + FeedZipHtml(zip_buf, 23200, + "264117df281ae855bed955c795989adb8abf574016aa723915"); + FeedZipHtml(zip_buf, 23225, + "ff98d7a7f2cfb8bc4e59ed641273d6868e6087244a825aea6c"); + FeedZipHtml(zip_buf, 23250, + "3205b43610589258498a515e02f26e5e18ab67d412b50c24e3"); + FeedZipHtml(zip_buf, 23275, + "a47a941f63b20d08055300c77a4d6ecc54093b2df79b8b5de4"); + FeedZipHtml(zip_buf, 23300, + "0a693ef4054fb687c2edc95f56745e0c3ec952be3dacdf0cf3"); + FeedZipHtml(zip_buf, 23325, + "f0f1d9c8c4a1d4edcab4b212c6b60233da7229545813813b6e"); + FeedZipHtml(zip_buf, 23350, + "870791cd8f95b6956efa9537c7564e54cb50f4ac39c9e54d45"); + FeedZipHtml(zip_buf, 23375, + "902075b89de9fc3b07185cf6af1210d9a51c94c52da6aefcd4"); + FeedZipHtml(zip_buf, 23400, + "5ee80208213bfc39adc368aec853555861612c3bc30477a3f0"); + FeedZipHtml(zip_buf, 23425, + "dd895c0bd087c2d04b5deea361eb66e398efe29f03d350da96"); + FeedZipHtml(zip_buf, 23450, + "b86d17ae5da9c006ef9814690c34306d698fd2ab11eaa9d207"); + FeedZipHtml(zip_buf, 23475, + "ba31e39ae1c6eabf73310aaf64cd017c1729ba132a4b2cc1ca"); + FeedZipHtml(zip_buf, 23500, + "9dc9686fed82c13abb7f000f8dee384ee3bc3d73a1f027ad54"); + FeedZipHtml(zip_buf, 23525, + "9f250a77c4773ddcc338bfb8b1e558271b2a2214344761abf9"); + FeedZipHtml(zip_buf, 23550, + "cc5587145ce81493199dd9f0d04d9b9a3a025fc2995e404947"); + FeedZipHtml(zip_buf, 23575, + "0d800d56d510ab91afa823dd60e6eba61d3d3ec6d7f7e87a5d"); + FeedZipHtml(zip_buf, 23600, + "d718c5c7eb89b8491c4a34ac6a4dc570cc725198b9828d1b75"); + FeedZipHtml(zip_buf, 23625, + "87f4274a1f911be0ec7b37b5333ce37f6642b41ff8f9eca1ba"); + FeedZipHtml(zip_buf, 23650, + "b6c8ea0c04006cd5be27df15a494942c171b38d32061ce3283"); + FeedZipHtml(zip_buf, 23675, + "9e993b3a85b439821564a29b284f2b7a13b1f5dc01cce0233a"); + FeedZipHtml(zip_buf, 23700, + "309e71ca74fe96db096166118493c11035c830f47b9c380e01"); + FeedZipHtml(zip_buf, 23725, + "ede59465065e9501b52e8c88cb534a4c89eb2b03d675aec080"); + FeedZipHtml(zip_buf, 23750, + "67b28ef09d4506e0d51493a469d0969030c98bf1f5daf01c81"); + FeedZipHtml(zip_buf, 23775, + "798e65a5e5853ab903346fd3fd0580e38b3836a78f47a0ebcc"); + FeedZipHtml(zip_buf, 23800, + "afa817056ee85ef541a0e09c9e70399dab2ca5d7096f385a26"); + FeedZipHtml(zip_buf, 23825, + "758ea6184a2360d4838e947f14066627cbef787d0b472f15a1"); + FeedZipHtml(zip_buf, 23850, + "6386e865985e876a10243d3c8e8db022c830bc7646184c6430"); + FeedZipHtml(zip_buf, 23875, + "5a3ce49bc75b2e0c259762aa6c5cd30cd0d233f5da7e0d431e"); + FeedZipHtml(zip_buf, 23900, + "095874255f87d137a698b1bd649eeb7b54d06e10b9e3a1d775"); + FeedZipHtml(zip_buf, 23925, + "5a707cc5d3eb8a99b8b6dc27187f7cb167f108e2cfd5f7c686"); + FeedZipHtml(zip_buf, 23950, + "fa56fb57d557153b42e303aeca389df8fe665a75508ff7b2b3"); + FeedZipHtml(zip_buf, 23975, + "556caa78769f0be7533e9c0bedf38f3907e61730594de4ffb8"); + FeedZipHtml(zip_buf, 24000, + "20bb234ee31d6e65f50f589ff3f1f8886c0137414d1d80bda0"); + FeedZipHtml(zip_buf, 24025, + "a21eaa22476ef60c6f533e644437ce99d76aaafb7e41532cd0"); + FeedZipHtml(zip_buf, 24050, + "8d3f726f8a75a4197234b908d65274bfd82bc73660236d7e24"); + FeedZipHtml(zip_buf, 24075, + "c878b1b7360d174eebb3b951e8830ba592e9e183d1f202992f"); + FeedZipHtml(zip_buf, 24100, + "f62af99330f6383968d188eb1d517d613bce6463f556b06cac"); + FeedZipHtml(zip_buf, 24125, + "c8cac87be82e06ec707d644a9acf39d78c5a04326156fedd87"); + FeedZipHtml(zip_buf, 24150, + "b79d3b62e12c591c7a7d33f24665c22a62164c5c374d1106ba"); + FeedZipHtml(zip_buf, 24175, + "55fbdc19aed74e8846fbb517e32314005a829b8ec41755153e"); + FeedZipHtml(zip_buf, 24200, + "eef6a5cabd55201036dc634cdd7b4a211dc8f3269abd54c548"); + FeedZipHtml(zip_buf, 24225, + "570e93172748347c769da8ac6042d56f0ffbf26b8e9733aa0b"); + FeedZipHtml(zip_buf, 24250, + "a0af245f413bae5d8707bd1769e6fddcc36ecb75b9478fbcad"); + FeedZipHtml(zip_buf, 24275, + "4b48d3381321e543f6b0db9d449501777effd0c8b466cb7c90"); + FeedZipHtml(zip_buf, 24300, + "ef326394e5343470ecddfc732cce22491f2d9495e0b526afa3"); + FeedZipHtml(zip_buf, 24325, + "97feaa304ef1dccf96c297dc1598e421233a0fa897530874a2"); + FeedZipHtml(zip_buf, 24350, + "feda0073596bef72750a99e5a0b02a607dcc85476b5b54c8fc"); + FeedZipHtml(zip_buf, 24375, + "3ff211f30867aaecd20cadae64d5ef3a34beadb0511459dd54"); + FeedZipHtml(zip_buf, 24400, + "7a4208c435d6a3293973945efc343af07cae7716dcb3f3d37f"); + FeedZipHtml(zip_buf, 24425, + "afbfac1b391d76d087c2de091460ba424781caeca42aa0ec5c"); + FeedZipHtml(zip_buf, 24450, + "f481d5d18eb9b88d316a59166c939e1ab9c25295aa7184658c"); + FeedZipHtml(zip_buf, 24475, + "4a29f3f1d3c268d3ccd04d5387aaca79325d26e56901e3a8ef"); + FeedZipHtml(zip_buf, 24500, + "bb5721c3c0c584323c4657f2af9d3fb09ed2d442435acb1979"); + FeedZipHtml(zip_buf, 24525, + "9c5779f6aaba3e2dab0195c61b5224e4045863d21d661239b2"); + FeedZipHtml(zip_buf, 24550, + "4fda506cfdcef39f61ed8a13a8d731b09d0c88a6d74d78b425"); + FeedZipHtml(zip_buf, 24575, + "f7941bd126810acea848ea8d646410e2e8cd64fbef49781d0f"); + FeedZipHtml(zip_buf, 24600, + "7e7ee92884621d376f9bef7d3c5282af95032e1058d8042026"); + FeedZipHtml(zip_buf, 24625, + "371c4e8427f71c3a6526489001dfed0ae9e24b86e81c76f1ca"); + FeedZipHtml(zip_buf, 24650, + "090baf46a23ff10127801f3797fc05fe07572d31506a53445e"); + FeedZipHtml(zip_buf, 24675, + "0f3396ef4c92e1eef985c5a2c87668392efce33270f9f59ce1"); + FeedZipHtml(zip_buf, 24700, + "7f58e5960a96357e5acc551eefdfb2dc210152b8cdc31015b5"); + FeedZipHtml(zip_buf, 24725, + "0093cf34ecfafdb5e4c6b5cd529b0fb75e8cd207b4a0b0a80b"); + FeedZipHtml(zip_buf, 24750, + "be725c0fbd7eb24b21676a96ccafca97592041fa5df90d3bf6"); + FeedZipHtml(zip_buf, 24775, + "f95875dd8a1d3ecd1945900371a9502ce8d2b772df21b5e4bb"); + FeedZipHtml(zip_buf, 24800, + "856dc7ed76e90f6225b958bae9e265b19aaa3a74b5e5c0f693"); + FeedZipHtml(zip_buf, 24825, + "976e5d18826587cf7f250ae8456b4a7cae4109e2e9cba33018"); + FeedZipHtml(zip_buf, 24850, + "78c9a4e4249ceb736f392e6747191e7602acc48c2101be5a00"); + FeedZipHtml(zip_buf, 24875, + "f67af1cfe769deeb53dcf064a01d6e24b8c5e5ee5af84bbc71"); + FeedZipHtml(zip_buf, 24900, + "a17f64ae5dea9d6e4e0a70c04ebeb6f9f3f38de7e9d64d74e3"); + FeedZipHtml(zip_buf, 24925, + "750084b2a2a1ab0a656532871bc3c833dbf30df84666724326"); + FeedZipHtml(zip_buf, 24950, + "e0a7d9302506ed4661ac1d0687bc39c847ce7b784ec113db7a"); + FeedZipHtml(zip_buf, 24975, + "b9ce3e51ef9b810b8e5c4b306daec303e711f55c5bf148ca1a"); + FeedZipHtml(zip_buf, 25000, + "129584c4a924fd82e473369cbfc3fff94a28a7c1248f64c682"); + FeedZipHtml(zip_buf, 25025, + "beffa2aecebf9e7f6d90f34a45bbebfaa2b8c9ea5f4b37d9f4"); + FeedZipHtml(zip_buf, 25050, + "bb72ed8b7dcab5ef17d5a55cff4ecbbd910373e990dc074f22"); + FeedZipHtml(zip_buf, 25075, + "a0d56a9e174bea9d1725d5bbc61b18639c103e10dc45257390"); + FeedZipHtml(zip_buf, 25100, + "1121741e944fa2f9d5a2178749148ebd2e214381c01e38477a"); + FeedZipHtml(zip_buf, 25125, + "7de8b9938e9eca8f6b9466a6b706ee8d177f4d639d0c0f2d4d"); + FeedZipHtml(zip_buf, 25150, + "089c5e35254f4645907020021c27ec6551419163d7410698af"); + FeedZipHtml(zip_buf, 25175, + "a5b2701e2680cd8230183f974983f9652913d29392c3604f0c"); + FeedZipHtml(zip_buf, 25200, + "22c1095e66372d0bb02c62b6fbe0ea081756c9d6b90519955a"); + FeedZipHtml(zip_buf, 25225, + "cfc2d8a31d931fedbce55720c44c3cac7a32a7b756dd91d3a0"); + FeedZipHtml(zip_buf, 25250, + "dafa973289e8e3a3b0229718bf97b289f96d29e56e7690a30b"); + FeedZipHtml(zip_buf, 25275, + "97d8b7b69fab99a500d2c2e6bc1796e1e555320daf0b55212f"); + FeedZipHtml(zip_buf, 25300, + "25bef692ee30a30b51918042e49ef0ff3f775a543d74452ac0"); + FeedZipHtml(zip_buf, 25325, + "9b357374aef816a76e13f37229db353d03139c1555502eaedd"); + FeedZipHtml(zip_buf, 25350, + "71710f563f966ec1faabb9724364877fe086580cd052bddb9b"); + FeedZipHtml(zip_buf, 25375, + "35a6a689e9065cf63f587df6637f12e7fdf6f2711cc2b2d347"); + FeedZipHtml(zip_buf, 25400, + "0f86d3cebaee09be03f681ed8601ec61bea38a357ed74efd9d"); + FeedZipHtml(zip_buf, 25425, + "f6f1e52e56efb59c1ed3b616f2db55e8f54cfe634c1fbbc01e"); + FeedZipHtml(zip_buf, 25450, + "37193636bf738bfaab53fca957fca950d607f461d8ef5bd4a1"); + FeedZipHtml(zip_buf, 25475, + "e5d7af0b80b13b1fd89864aed88d6018147f1f167ff2ee8288"); + FeedZipHtml(zip_buf, 25500, + "55e7cf99d0b32035f2eee8f4dd1a0760f7ec128a39d501082e"); + FeedZipHtml(zip_buf, 25525, + "5d912d5a94e8527814a6dd0ac2f40e71255b1e83ded81dd2ed"); + FeedZipHtml(zip_buf, 25550, + "49c2492ae5b09672d7b2e01d2a8664e845e41b1fc56a3cb4b8"); + FeedZipHtml(zip_buf, 25575, + "e5e95baf421586f6308d169c96c9e9bab567e487e338cdea15"); + FeedZipHtml(zip_buf, 25600, + "e6ea23698e3417625ea6cef6f02fe5eb0a379da553cb49aa9e"); + FeedZipHtml(zip_buf, 25625, + "ca24e5cf646691b506a683c6f217390f97b173f7f816ce7132"); + FeedZipHtml(zip_buf, 25650, + "04cbdd3daf2f8c4de8b85ec522d4a1e5c4952fa99a618f3b4e"); + FeedZipHtml(zip_buf, 25675, + "058d7f51d6d0445a1a5bf099b68a2fb847abee9976163ef87c"); + FeedZipHtml(zip_buf, 25700, + "1e62d6d63b8ffc00299be235474aa7e5a2bf50e51efd4c2e14"); + FeedZipHtml(zip_buf, 25725, + "593f750e22d7a1f147447315893f3ed1e1e312e8f0691a1d3e"); + FeedZipHtml(zip_buf, 25750, + "3dd1e1d342e940716f63ce6b5e24826a6dc965ecd8908b458d"); + FeedZipHtml(zip_buf, 25775, + "e88f77d6d6c741127e4985b994a89a905c375522ef6ccbc513"); + FeedZipHtml(zip_buf, 25800, + "8639998e5c3027b2687e279a62c11ac6a45c8b9d2c4b366c17"); + FeedZipHtml(zip_buf, 25825, + "02cb63b57a3bf4744fe61085035444a1c2d38d5f8c1987455e"); + FeedZipHtml(zip_buf, 25850, + "79e124ce2b06758e6a9ee12a6c61699a561277b126f2222178"); + FeedZipHtml(zip_buf, 25875, + "ac96736df6320ce8fb61ad2a7b5a59d295a46dd4cc9606f662"); + FeedZipHtml(zip_buf, 25900, + "277cb8dc61181da556f7c218a59a4f2a6cf28f4f44b312ede3"); + FeedZipHtml(zip_buf, 25925, + "bd13adc280fff444342bd13edd3bd1f6649601d7569c3dd7a1"); + FeedZipHtml(zip_buf, 25950, + "92809a2e8dbdf7ab15246c802753f305531ccf25287c8e0927"); + FeedZipHtml(zip_buf, 25975, + "e7c1e0617c1850daa04e99d564f6a887c385c75703ec9b6681"); + FeedZipHtml(zip_buf, 26000, + "ab4abec61a2a580e9b1681d137882ef5751026a5389511d7b3"); + FeedZipHtml(zip_buf, 26025, + "a394662a4126b5d543e3925444a051331febcd2fbd87714995"); + FeedZipHtml(zip_buf, 26050, + "0ea3f181721caad534e3091c1f7dcacbaaebe4321aaaf0b978"); + FeedZipHtml(zip_buf, 26075, + "3edc89dbe2a6840fb9ad1e727994c56d51b188d45d1c257292"); + FeedZipHtml(zip_buf, 26100, + "ef160b4f26e6d58df33368c56bb94c737911ed72f47e297f59"); + FeedZipHtml(zip_buf, 26125, + "f570422231b6f0966374edb87f5da8310898d5eb321ea350c4"); + FeedZipHtml(zip_buf, 26150, + "8f352f9bcc5c14c740104e359c213c419c7f5db76ac406a9d2"); + FeedZipHtml(zip_buf, 26175, + "32aadc541a295978935752f6a6d993e2c1eed9e52e3f7cb7e4"); + FeedZipHtml(zip_buf, 26200, + "8a4b1b5b9cc36cc7c236d4f0aed0f005cec23d11e5d845730b"); + FeedZipHtml(zip_buf, 26225, + "d6340bc211c8d26e28fafd786eaef997e49a8308a872e0613e"); + FeedZipHtml(zip_buf, 26250, + "a99ec0709583b3a3abadbf5b192963673227e93c5448c61438"); + FeedZipHtml(zip_buf, 26275, + "f815a0f3ba1ed5a1d1b9ac5566627ea44ed5d9a5cfb224e407"); + FeedZipHtml(zip_buf, 26300, + "0883958d625bb80166f226e4ca077f8aa162950951663dcc73"); + FeedZipHtml(zip_buf, 26325, + "08a50e66ec977dd91371e271e8be93609ab0c41698906131cc"); + FeedZipHtml(zip_buf, 26350, + "2435c2f788b9ca742a49325521c61806ea44c5f7340feb8aec"); + FeedZipHtml(zip_buf, 26375, + "716e16297732cd227d84e7a84f9f0da709fcc5ef16d3515810"); + FeedZipHtml(zip_buf, 26400, + "d9a1d2956c627956660a58ea8ae10f729d6dcb370bca11cf66"); + FeedZipHtml(zip_buf, 26425, + "4bc9a14966087c3f54ef2b389efa951c2ccdb727694adbe5ab"); + FeedZipHtml(zip_buf, 26450, + "944b08b2aa65647498c47b1b5fd89fa19bd2c1d209019f6c80"); + FeedZipHtml(zip_buf, 26475, + "4ec3b067ae454dbac993b640c254cd3f593b0f056c25074d31"); + FeedZipHtml(zip_buf, 26500, + "9024cff9b1c1039b40ef143f79e86dd06cd95030dba45bc069"); + FeedZipHtml(zip_buf, 26525, + "b34dfae2ee93be88ea4eca11350d04d8e88fde4c7011543cd1"); + FeedZipHtml(zip_buf, 26550, + "1d20ddfb3afc0ff5f3c41a36a87579a9956a349a86944d0d37"); + FeedZipHtml(zip_buf, 26575, + "67a9cea39b67335e198b055a2ed65e455c96d9ab695b7d34df"); + FeedZipHtml(zip_buf, 26600, + "c9669d07c7f5cd58a44001bb0d1baf80b22db050adb8c486fa"); + FeedZipHtml(zip_buf, 26625, + "886ce4103a1742abadfdda78550f61e8a197d660f595b2741f"); + FeedZipHtml(zip_buf, 26650, + "8078c843f2d24f22c8ff1527914c73e94944aeb28cde4b398d"); + FeedZipHtml(zip_buf, 26675, + "cc2757350f287952e864b065966786e088d655b9399a1b9bb9"); + FeedZipHtml(zip_buf, 26700, + "6b3d9d751a4eddf34f5bea9e0bae70bb762c1277cf4d5c328c"); + FeedZipHtml(zip_buf, 26725, + "d58f87414fdc80b11bf47cb2bfbeebb0ffc3c04b246214b28a"); + FeedZipHtml(zip_buf, 26750, + "dac1d2a9e5e02b009b41a2dfb058bf22a7becbe9aaec2f97ea"); + FeedZipHtml(zip_buf, 26775, + "8f350a7bf9bc1d4dc2b35a7382667d2a1c46122bb5a272775d"); + FeedZipHtml(zip_buf, 26800, + "c2979351109b693e641de7cb48f42fe3db581d41dc1e723ce5"); + FeedZipHtml(zip_buf, 26825, + "4ba1cace3fa65a844f89a06524fcab2a27b66ca6a3134afd26"); + FeedZipHtml(zip_buf, 26850, + "8911d6e94625f69cfea277573ff281ca383c0236942e230c65"); + FeedZipHtml(zip_buf, 26875, + "aa6da7d865a32fe6d4cfd92ae038ca3596fe36caf329e39ec4"); + FeedZipHtml(zip_buf, 26900, + "54e5afc1a7ef3ecdd8360786495b7d171456b4f24a1eaf3347"); + FeedZipHtml(zip_buf, 26925, + "2c9c360bcc5b5a0bdf46c554347dd5e9808a8b5d50802aef78"); + FeedZipHtml(zip_buf, 26950, + "dd458e64ee419c06533ceb37baea89ee6d9ad56fffe2ec8093"); + FeedZipHtml(zip_buf, 26975, + "b9a49974f45ac17066eb20ad30682732d1d606a5010c6e2bf0"); + FeedZipHtml(zip_buf, 27000, + "f74fbf1f5cfcfcf22775f1e6b971faebe5e9c9d1a79ff8eacd"); + FeedZipHtml(zip_buf, 27025, + "f2b6981e2153c7b5487049d5fdb30b063f2e005d0f9a93d393"); + FeedZipHtml(zip_buf, 27050, + "fd0230fbc7676d3b1c41984e594413a6d5c6eb569fd203d381"); + FeedZipHtml(zip_buf, 27075, + "afc4fab1883e6666aca5e9b0e37cda8ebf6c4ee3f17877d77a"); + FeedZipHtml(zip_buf, 27100, + "53e1ba1fcdd7c63c5df4e81db3d3dfea945d6435071ed925e9"); + FeedZipHtml(zip_buf, 27125, + "a11b85b0db15e36ced686d6e480f834de7af30ff91e62b54e8"); + FeedZipHtml(zip_buf, 27150, + "5a498dfdb64cc044f9b3e26ec89a132433fffc87527102a079"); + FeedZipHtml(zip_buf, 27175, + "dd8b30ea6ac51d0abaf2bd8e14682f11cecbf57fe0952bea2f"); + FeedZipHtml(zip_buf, 27200, + "2a3d99bab0b8c47abcb22e218189d5d2590e5466283c7453f9"); + FeedZipHtml(zip_buf, 27225, + "cb20d58f63b00d5fd91c9a5e193ebced9cff0dbacae07ed2ab"); + FeedZipHtml(zip_buf, 27250, + "bb2140e40e44dcc695557ff11b555bcc7e11577f7291dca229"); + FeedZipHtml(zip_buf, 27275, + "66ef4a92dde41656a12550b1ec8fe3c185b55e5ab6bde5c491"); + FeedZipHtml(zip_buf, 27300, + "5778f8b77029d94912ac1d4a8cc89a90b78bb2ad0210472ad4"); + FeedZipHtml(zip_buf, 27325, + "d86f2681f79f093e68cba617c411d4ba950c7c299e2f52856c"); + FeedZipHtml(zip_buf, 27350, + "d9c2404a3cb3808e17f8749a41b1c09d5f9d6eb8085e461a70"); + FeedZipHtml(zip_buf, 27375, + "deafa4b7e626763c018d10c729bd653d9ef2fbb95e4f9d6a76"); + FeedZipHtml(zip_buf, 27400, + "c9beb2dcd1e5bbb458bc73da110fc7d85af8d9c624ab3fa259"); + FeedZipHtml(zip_buf, 27425, + "77498bcbf6ff42b5dea59fddd206f6c565306175933d5f4f75"); + FeedZipHtml(zip_buf, 27450, + "0e4e67b68f8d19af5c86eacd449baf123b54357132eeb95a6b"); + FeedZipHtml(zip_buf, 27475, + "4b65e41c67752799b85d1c4d26f7f9512b5218157032a02562"); + FeedZipHtml(zip_buf, 27500, + "75d4405e6851ad77207a97934fc3f6e665fcb76c4b13d24932"); + FeedZipHtml(zip_buf, 27525, + "a8522367c00dd2222f4a05c7afb4ee4455f5d3d9e9e149fba7"); + FeedZipHtml(zip_buf, 27550, + "5587fff159ffeb38fdedf8274369e137478727fb17edf3c393"); + FeedZipHtml(zip_buf, 27575, + "03ec94fef539fbe771aeb530ced9e9d1a783d3139e89fef9d9"); + FeedZipHtml(zip_buf, 27600, + "f8f7b1f97be1dbe30f47ed430d7cfad7e7ec9fc7b956fb38d9"); + FeedZipHtml(zip_buf, 27625, + "05e57efa6cf9edd8d6af0c46bd48f3efcff91f8e0b3d0ae31d"); + FeedZipHtml(zip_buf, 27650, + "ec9f1eefb7cf3fed9e1e1dedefb60f79d4e2af9f4b7e3e2efd"); + FeedZipHtml(zip_buf, 27675, + "bd6422b37f66d0cc48d9efc95ec5faa452d86bf16476539717"); + FeedZipHtml(zip_buf, 27700, + "2b3f7d64e359ba9be4e5ced69ebcd65b2daaf9ea7ca6d945f2"); + FeedZipHtml(zip_buf, 27725, + "04c73fdd75d475764ced635220aebb1583994092ae53a3aeb1"); + FeedZipHtml(zip_buf, 27750, + "3e6f912d4549e2e5ed18e68056967e16b0cfe6d2e515d38b69"); + FeedZipHtml(zip_buf, 27775, + "40aea6104a703fd741c2e76373b297cd4dd62c6e90b3a6263d"); + FeedZipHtml(zip_buf, 27800, + "3bc374f3549248bc52a7b52c2fea232e5ae5f2ecfb1a55f1b5"); + FeedZipHtml(zip_buf, 27825, + "7bbb8a5e4ce39ce6ddfe5428ad4b1500c07894995ee5c1bceb"); + FeedZipHtml(zip_buf, 27850, + "bb11bf97cf68e3bbedfb36234f0da8fdacffc401e018fa05e6"); + FeedZipHtml(zip_buf, 27875, + "56db28d91c7cd008c2600d8b48f4dca8074b49e4166cdaef74"); + FeedZipHtml(zip_buf, 27900, + "552eba1338b846cec5ff1ca1098f45e1b25b056246fb38f8ae"); + FeedZipHtml(zip_buf, 27925, + "eb0b10adeffa3191eceb6aeadb3dc86e8fd2b34bc71a87ea0b"); + FeedZipHtml(zip_buf, 27950, + "ca5cc192c87c1ae0e380275d441375a14cbb61470c5d8c9e8d"); + FeedZipHtml(zip_buf, 27975, + "b2fc9bc284de0880eb6f7ef2fa6f83e435a08ca6d06026d1a4"); + FeedZipHtml(zip_buf, 28000, + "1c4a65e5292b4e557d46dfef69dbd1fe5f20f204179b557665"); + FeedZipHtml(zip_buf, 28025, + "46d8b9e8e261619a2166edb65c63cc7aa3b138539f6e85d99e"); + FeedZipHtml(zip_buf, 28050, + "c2ea695e9c70767ed41a29cf9806904ae89cc64ea3b79fce86"); + FeedZipHtml(zip_buf, 28075, + "78435b6291adfe48092ae7b2cb9cbbd8654b39d5ed79711764"); + FeedZipHtml(zip_buf, 28100, + "7a1a7b59bbcdc45e0be7075d25b5ccb2a6639749b9bd1ce57a"); + FeedZipHtml(zip_buf, 28125, + "51388e25d9d8a397a59a76172bde4ab01c03ec461e176605aa"); + FeedZipHtml(zip_buf, 28150, + "a33a4292223ba679b664e92cc59babd0a2892d7a0ac6a5d1fc"); + FeedZipHtml(zip_buf, 28175, + "5c0c70eb897ef3224caf9e5e3a16958ab5a39dee4b20304323"); + FeedZipHtml(zip_buf, 28200, + "492c81ba18bab8494ea4df978ffb25547e4dc26b7e283f52c5"); + FeedZipHtml(zip_buf, 28225, + "12857e5f41e964852bf3d47ac155f84dc6caed9eefefb4f79d"); + FeedZipHtml(zip_buf, 28250, + "df0ecfdb1f768e9cf6cebba37d677d7dddf97001f67b66f416"); + FeedZipHtml(zip_buf, 28275, + "fcbcb2980dbc549e8187a7d2d5d2e9de686a086d0945abe476"); + FeedZipHtml(zip_buf, 28300, + "958476acf4b285b4ca38581e09a4d78e01a6ebd422058a7d1e"); + FeedZipHtml(zip_buf, 28325, + "96327d37f1fc1e29adf37624c8fe5514d02bc28bec3265bb5a"); + FeedZipHtml(zip_buf, 28350, + "6b1b4cdd16b6fd906be022adbbe1906ede6f750533ae6e86c9"); + FeedZipHtml(zip_buf, 28375, + "877509e22c7c0bb198d736adc501e80e6b781b93a75cd20b2f"); + FeedZipHtml(zip_buf, 28400, + "e07bceb3088ea6bd674eab0b18c662b62ba06adc9ecc744de0"); + FeedZipHtml(zip_buf, 28425, + "c127e7a7bfabe88684ce08e5812acc37c79d68174e4396e0e7"); + FeedZipHtml(zip_buf, 28450, + "6cfb43e5293cb5194b78608c843f69f09669882104d56ac3d2"); + FeedZipHtml(zip_buf, 28475, + "e961d1580238557344791ec042a7b015a474b61a600ba58629"); + FeedZipHtml(zip_buf, 28500, + "6643d1fd7641922a7ae728c316512bf4b9a73d9400a18a8371"); + FeedZipHtml(zip_buf, 28525, + "3852dbde904202eeac9516b06d5232633cbd97d5d643591631"); + FeedZipHtml(zip_buf, 28550, + "b94a6829bd5050793d32aad72b49f63b17cda9a298d9e52111"); + FeedZipHtml(zip_buf, 28575, + "ec1a0866589cec3ebad51e84df0fdbbf9c7e6833550c37c223"); + FeedZipHtml(zip_buf, 28600, + "23d014ab28dfa5466481e59b87a41025adabd521e29e0202bd"); + FeedZipHtml(zip_buf, 28625, + "e4967d08ca3bd8fdffd97bf3e7b6b12441f8e79abf02e18d9d"); + FeedZipHtml(zip_buf, 28650, + "a2762995edeaeee9965d8e9025d9ad2959f64a725d1d1d0a90"); + FeedZipHtml(zip_buf, 28675, + "042994498005809258317ffce6f14ee0e120c553e6ccf7cd96"); + FeedZipHtml(zip_buf, 28700, + "85c777e4cbcc97774e1d9e6aee47a49df9d83d1dbdda46ddfb"); + FeedZipHtml(zip_buf, 28725, + "a9584e7b14d9e2e60c9852ee49dcab8a5591abe9d0480a79a1"); + FeedZipHtml(zip_buf, 28750, + "4e6c34b7abe11281deb4e6769541a17c199d7fb02e3c16c032"); + FeedZipHtml(zip_buf, 28775, + "f1788d025fd1fa574d368e412def5f80233704ea028abbad73"); + FeedZipHtml(zip_buf, 28800, + "46e975c77433d0147b62675a7bd14a251d001f40740828b35f"); + FeedZipHtml(zip_buf, 28825, + "2789bf04113b06caa971850497f046974f72650bd505efc96b"); + FeedZipHtml(zip_buf, 28850, + "b426a3e09a31d0031bb6d8012733cacc9432093b6322ef07cf"); + FeedZipHtml(zip_buf, 28875, + "082ed4f95e7c29faa0395ec1858de512df7c832725d0f83a96"); + FeedZipHtml(zip_buf, 28900, + "dafe215f4b57b40f4c820e281f999977e5de9c157569cf4836"); + FeedZipHtml(zip_buf, 28925, + "bb5ec890d273b27922ed26984e692576952559ed985c8ec99d"); + FeedZipHtml(zip_buf, 28950, + "f10d82e873ee4f81f1601b8b340bbb8ebe01a54391e1358842"); + FeedZipHtml(zip_buf, 28975, + "2cfdb58bbffdab8cc3ad80879d8d00d221ec74c812411efb42"); + FeedZipHtml(zip_buf, 29000, + "7594d4ee854827f30c18cec6c9d43ca99ac1207cb9664ff4cd"); + FeedZipHtml(zip_buf, 29025, + "f90611d10ae155de30761198214d64399f000303de72f2b694"); + FeedZipHtml(zip_buf, 29050, + "e5391626df4b20481e97ccad928add38139606e15d20d4fb42"); + FeedZipHtml(zip_buf, 29075, + "0ae452ac44cc05df183e64d45d0ff93466bf326c382a9b1991"); + FeedZipHtml(zip_buf, 29100, + "6f72d807c0ecf74354a08d5e0d64a3881362e3083c8ca4146e"); + FeedZipHtml(zip_buf, 29125, + "8ba13fc526a121e66df7265d79310043fe691a625ca8089824"); + FeedZipHtml(zip_buf, 29150, + "bffcc18348b4898ca6e448c8c2bd3abcf7a7a951299efb9523"); + FeedZipHtml(zip_buf, 29175, + "0a22e2183196b7fe781c44a544fd79dc88a09dc31a1173c92f"); + FeedZipHtml(zip_buf, 29200, + "378d90799b3544eafdeb1d687e13b8e263ecea43e0be8e3318"); + FeedZipHtml(zip_buf, 29225, + "798abef6ecdf0ba462494c3b0a9ec522f43ec8e8d2f83e1c29"); + FeedZipHtml(zip_buf, 29250, + "82d6f719d1f05f464cf9db3806c61171d989559429b9d4b5b2"); + FeedZipHtml(zip_buf, 29275, + "4e23e04b18c9edbc0613214976eb60d1081cd0891f78bfb130"); + FeedZipHtml(zip_buf, 29300, + "6910285ed586d9e0ff083185a29bbf63ba2024312afd88c0ed"); + FeedZipHtml(zip_buf, 29325, + "7c380862bc648f867c02d78ff20de60677b3a1361937eb6089"); + FeedZipHtml(zip_buf, 29350, + "ff736de615060f22484749484918dc9951bc061933573e2c50"); + FeedZipHtml(zip_buf, 29375, + "2b0ee3ee1965a9312200053192ec3d9f4eafaece3e9c5d5d9f"); + FeedZipHtml(zip_buf, 29400, + "1d9352d264dff27fd0b10ce8af235244ffbab6470da3b03204"); + FeedZipHtml(zip_buf, 29425, + "8749ab01239f5b392ad339d3abfb78f0833ebf460822790312"); + FeedZipHtml(zip_buf, 29450, + "77f2b52a345bb0d23515aad116444e83e83665f11911e34321"); + FeedZipHtml(zip_buf, 29475, + "5f46ee0fed4a6fc927063b254ed802f07dfc746d404f41a4ed"); + FeedZipHtml(zip_buf, 29500, + "81983a162636a17aec1d38994a5360970adfc854f9f1147dff"); + FeedZipHtml(zip_buf, 29525, + "b097a096c9c95b215cd684b03e534db9fdac34e3a0cc0de4cc"); + FeedZipHtml(zip_buf, 29550, + "4e406e926f51b4b27cbd847674d3955bd2f95a762a48e70def"); + FeedZipHtml(zip_buf, 29575, + "1d83c8f65f2ec883de1201f07b39968fe9711408bf570d7a67"); + FeedZipHtml(zip_buf, 29600, + "ea4619ecdd791e6b05fe1d6d29077c6133c87fbb91b90e92c0"); + FeedZipHtml(zip_buf, 29625, + "36ee7a6c2b19aae22a3ae99a3d46ce2686ce81e2b976b7bacf"); + FeedZipHtml(zip_buf, 29650, + "59705c83c44d86cb4dfeb2539c92001ec7cc27917da836a972"); + FeedZipHtml(zip_buf, 29675, + "11e5d1088e7831acba8bdcc8b5ded6e7f12081f7a6feb64a06"); + FeedZipHtml(zip_buf, 29700, + "b6bcaaecbcb55cc684775a7315e2e9c2bfa69952ca68de16fe"); + FeedZipHtml(zip_buf, 29725, + "f2e4ada4368e0426e74fe6a11e9951c87b21d4d4276d52c7df"); + FeedZipHtml(zip_buf, 29750, + "8a7d18697a672adb349f6d6c46301bd2870e6ce5a4637934d5"); + FeedZipHtml(zip_buf, 29775, + "bddbef83ee4a73070f41970a8b21ba84a2cea54abc937a03d6"); + FeedZipHtml(zip_buf, 29800, + "1f30d63ea8d49195fa2b5d611c441b7752d84ba634594a6064"); + FeedZipHtml(zip_buf, 29825, + "cb2dc519b75e7b7f39787e209b8c639e71476dbdb7467c5f40"); + FeedZipHtml(zip_buf, 29850, + "0507d4f6bba0ef0fe341453f470a5a8091c73c92f8ba444053"); + FeedZipHtml(zip_buf, 29875, + "fffeaacb3988e8180da6ea37bc3070d674e5e53ce7d4829a12"); + FeedZipHtml(zip_buf, 29900, + "1a3131f0c6c00fbbfc41feeb4d6ad961644c64ada40b87722d"); + FeedZipHtml(zip_buf, 29925, + "156a8fc0381e4f18d5d218f9482f48bb49081f4051026e450b"); + FeedZipHtml(zip_buf, 29950, + "7d27543421d71b0c42700fc4e093b7cdb434214773bbc38596"); + FeedZipHtml(zip_buf, 29975, + "54a85d7a3d25179a006525614a6cce3228a3deb8e71c5c9361"); + FeedZipHtml(zip_buf, 30000, + "5f218fd58a61796b611ddce6dfe588d519b76f745147589e39"); + FeedZipHtml(zip_buf, 30025, + "b23997a0caf5544654d51390a3e01122a6ab044d5bb91564bf"); + FeedZipHtml(zip_buf, 30050, + "236b275937414f0d11eeebca12112623dd264160b96c659f57"); + FeedZipHtml(zip_buf, 30075, + "614e91561edb9ee3be3975e8fafd98dc1cc065e7f5c10a6142"); + FeedZipHtml(zip_buf, 30100, + "c24b8ad52c5591d924be47f0e4b2e0fa5476368ccadf98e630"); + FeedZipHtml(zip_buf, 30125, + "128d6a7340ea53b6970d239f1cd68dc032422b8e79e2b4504b"); + FeedZipHtml(zip_buf, 30150, + "a2216ae30387f5d850dec52c458375d0fe440a8280e6d44a6a"); + FeedZipHtml(zip_buf, 30175, + "a251c4183453e143453dae01a2f88973aeec3ef6e4f63b01f6"); + FeedZipHtml(zip_buf, 30200, + "975066dd509ad09abf316e48159f7a5092828cd25f94a9944f"); + FeedZipHtml(zip_buf, 30225, + "2d23de105549dbd00e82c3da1de0858cc2542196858e4a4911"); + FeedZipHtml(zip_buf, 30250, + "355206519c48f9bfc9d196fa7c2e401748b3e930a8d002aece"); + FeedZipHtml(zip_buf, 30275, + "4fbe039d042b8600d8c99ef835cafcc5640cb3844a6936865d"); + FeedZipHtml(zip_buf, 30300, + "67a52ae6d0319eb4ad87a049c993b9e669af40f7f8c73f7acf"); + FeedZipHtml(zip_buf, 30325, + "fff18f675879e461347ce9563f54814f61ab30d00fc3a99c18"); + FeedZipHtml(zip_buf, 30350, + "d879e32a21dea07a9800867cf4e1f91886dd10b507dc0457c8"); + FeedZipHtml(zip_buf, 30375, + "32dfff8867a7ca48eab730a734b688a201228e01f7acac3346"); + FeedZipHtml(zip_buf, 30400, + "012d34abc1ee5b6847a0c8201c482554c8a98493bf9ebcf9e5"); + FeedZipHtml(zip_buf, 30425, + "eac44be1f3c857f3c511d73a0edfece5fd20f3d583ab3fb0f0"); + FeedZipHtml(zip_buf, 30450, + "e356c83e2007c4238ce261af9aa574c10b1d47f110ffd1cd5b"); + FeedZipHtml(zip_buf, 30475, + "6a161fbb546f4439f47434122dad3c2aeeaa99b82700a96547"); + FeedZipHtml(zip_buf, 30500, + "0a65ac053e02027894c047126f75e126ad3fd7946b42a712e9"); + FeedZipHtml(zip_buf, 30525, + "ba6ca872541a15e4c1959c81e6605c4f29bda55e9eabd31b95"); + FeedZipHtml(zip_buf, 30550, + "7569ad5de45aa5435b9eb4e3bbd58ffe4d856ed2bfc919bc67"); + FeedZipHtml(zip_buf, 30575, + "a8a6b69e1d0167843b2efeceefa0db8fc9953f784fe4046dde"); + FeedZipHtml(zip_buf, 30600, + "6c98defc3101a94baa9f143a203b55c2c7a01766d6370e2b58"); + FeedZipHtml(zip_buf, 30625, + "f16b0148cda0f44c54d6c583d11d2d884309bc322897e8ada4"); + FeedZipHtml(zip_buf, 30650, + "fb84751f925f927c3a1d7580a575391a205fce8b522a02ac25"); + FeedZipHtml(zip_buf, 30675, + "92db1585347c4a4292687f0ca64e2e0eeb9a376d328cc2250b"); + FeedZipHtml(zip_buf, 30700, + "2b7b60293d24b73ab805ec8d9a580843186ca518391ce66a5b"); + FeedZipHtml(zip_buf, 30725, + "ca4d59853c745410be288856e6262546891a2b22e91964f748"); + FeedZipHtml(zip_buf, 30750, + "44caa2f0ac2a742283ee806e0b22fbed0454210cececf99d10"); + FeedZipHtml(zip_buf, 30775, + "de8ba9e37d23c3a47b2326aa9afb31b054816b18f43177de2a"); + FeedZipHtml(zip_buf, 30800, + "145ab82c4b79888290c2d8343544a89188890fb6e121ab7f0e"); + FeedZipHtml(zip_buf, 30825, + "044dfc1406f78dde04c7f83a267607632bbea8f4ccb95e8495"); + FeedZipHtml(zip_buf, 30850, + "ed6749efc1c6eeffab790d10f41bf618a81bb68229cccb7de4"); + FeedZipHtml(zip_buf, 30875, + "2b8073a5f99765f7162ce02d9057781173754d34579a98a6e7"); + FeedZipHtml(zip_buf, 30900, + "5775b9d868a90849f99ab9e4ad5084e93b39ada522964ac3f6"); + FeedZipHtml(zip_buf, 30925, + "24ea05093753b0560acd560908d77d0c8164150f1fa796fadb"); + FeedZipHtml(zip_buf, 30950, + "0faf45a399bd27f2aa99153b9aa93a8e1fd4f3e124abf8f2b8"); + FeedZipHtml(zip_buf, 30975, + "776d751b5a96a2b3b107a87fd936fff1b24ad26ca23ea3aed2"); + FeedZipHtml(zip_buf, 31000, + "7ec28c5b7cf4139664dbf88439f7e17cc0e0a28a0fd5efc1a8"); + FeedZipHtml(zip_buf, 31025, + "fcb512114a6a9aca77c94221658ba21b11e93a38dd135377ae"); + FeedZipHtml(zip_buf, 31050, + "e371fc3e881bbd09b9b175cc2b83e1c378309d218620cf3317"); + FeedZipHtml(zip_buf, 31075, + "b8e292b8fa1a77f8e415926b01ac7dd5f469b3583a5e26f05b"); + FeedZipHtml(zip_buf, 31100, + "6bd9f978b7408b30d8027ebdf92ac7b6f3e38b206bcc8f8db1"); + FeedZipHtml(zip_buf, 31125, + "75bc270a324c857d243b5ecc824be4c6ebd9e0d7c38c2f1868"); + FeedZipHtml(zip_buf, 31150, + "1bc88be13a17c08b0552ec38f157ca893f474973cf70d9e06a"); + FeedZipHtml(zip_buf, 31175, + "ceb3126a8f4763cce5a07c4f51fd35cafbc7cb380105ac8551"); + FeedZipHtml(zip_buf, 31200, + "77382122c160b0fe24c12bef05632c97f5aaccd076ad4d7618"); + FeedZipHtml(zip_buf, 31225, + "1281092513dac4249259348d390735917746eae5f6bce51877"); + FeedZipHtml(zip_buf, 31250, + "156436f69c45fdd8113f553ab456eb68f894d53db518bfb79a"); + FeedZipHtml(zip_buf, 31275, + "4dd06339df4bba7cd23283bb3907638ca546e0d2010cd81337"); + FeedZipHtml(zip_buf, 31300, + "ee86be6cb05c42624b2502f528563e474940cd77a3ace4206c"); + FeedZipHtml(zip_buf, 31325, + "864f83acf9fbd7f4d911ada873615732ab05ee62842da98571"); + FeedZipHtml(zip_buf, 31350, + "28ff1401216bcc8005be7b3a6f4f81b28ee3f1340907b78e52"); + FeedZipHtml(zip_buf, 31375, + "1895c3eb88b12b073e9ef81fbd66db032408a2b4f04aae8e92"); + FeedZipHtml(zip_buf, 31400, + "d5190861cfc576368e9ebb2636e88c00e644fa0cb7f110de65"); + FeedZipHtml(zip_buf, 31425, + "6af2fdda68885d28f7a013cb4413ee5e234ae7a67904227da2"); + FeedZipHtml(zip_buf, 31450, + "4475edc60c5a4a32c34ad0029498d8ce6252aeb12c968bbe11"); + FeedZipHtml(zip_buf, 31475, + "931989306d0cc10c0e06078801c7c7cfbd17a245255634c6bf"); + FeedZipHtml(zip_buf, 31500, + "786f7fc55454fcdb9693bc3b0eceddfbb172781df92db15164"); + FeedZipHtml(zip_buf, 31525, + "258d1df57a42f4a49c657a60f0e897a2c02ef5032a08a67962"); + FeedZipHtml(zip_buf, 31550, + "580579a9620c73ea8e0dfa246f299296a939a5685af5834d45"); + FeedZipHtml(zip_buf, 31575, + "d4cb7235a90c7729e3c69f1b59650eb1c43b1b79a9c493d128"); + FeedZipHtml(zip_buf, 31600, + "c5b519dcc9b6e316bdc1369a9495ffaa1c5e954b2284978a1f"); + FeedZipHtml(zip_buf, 31625, + "cfd922bbc1c4335a021634f3da13597229b0fa4a3d2a6886f6"); + FeedZipHtml(zip_buf, 31650, + "3c23a7a540446d9711c2309c95528383f8f25e663731e60b75"); + FeedZipHtml(zip_buf, 31675, + "a8f6f3d9ad9fc95444a75d4c27d6bd127922ba1c974f456494"); + FeedZipHtml(zip_buf, 31700, + "f093fb7d6ac86031521c5700b4321fbdd6c857f5d5e0132616"); + FeedZipHtml(zip_buf, 31725, + "82363d0aca925fcc73362847524875a94a72d1954778595742"); + FeedZipHtml(zip_buf, 31750, + "2f26b85c9ba548b69a3fb925ae1f83e97d9ccc22a3c99fd491"); + FeedZipHtml(zip_buf, 31775, + "ed171eb60693214b6a880f5ff4e936483e337745f388f08efc"); + FeedZipHtml(zip_buf, 31800, + "de648a7c8ae07d2236c23281aa0a0f6b7eb3b988582189e5d0"); + FeedZipHtml(zip_buf, 31825, + "6031025801b16a6530f18b2d472ac9a8f06d46a6fe3ef1c7b7"); + FeedZipHtml(zip_buf, 31850, + "61b792a9e5c6b6bc8761187db9b90595a78041a02bc5136c0d"); + FeedZipHtml(zip_buf, 31875, + "8536daf38f6f6771e53e7a9d992dce58116b5dde9ab3280d92"); + FeedZipHtml(zip_buf, 31900, + "0c9e7ab86e1625b080422405272a322c20e15d8ad356989d34"); + FeedZipHtml(zip_buf, 31925, + "ac08a7f3de56545ac9d92aa76aea654d8ca51d75267c0fa12f"); + FeedZipHtml(zip_buf, 31950, + "6bcab2d086a0837907c17783b08ff3b6f55fc60c61e32fbf8f"); + FeedZipHtml(zip_buf, 31975, + "838161e8e13fa67783ff0b20a3bf8ffde930f69b19aa6c976c"); + FeedZipHtml(zip_buf, 32000, + "bb6000971965a19966b62827ed36f203fd6034e108a5a32b68"); + FeedZipHtml(zip_buf, 32025, + "7515b47412a0df337546312c869ea810af9c46d110d3408f56"); + FeedZipHtml(zip_buf, 32050, + "7f2a2f033fac5466a081a84be35a1e95cfa8e3f94b63a1be17"); + FeedZipHtml(zip_buf, 32075, + "05f786955e6d9e1f6feaed5072cda91aeae06d91f7cb6858e0"); + FeedZipHtml(zip_buf, 32100, + "6f5c93c0aa0822934cc4fa78d3ba5024568a5469efbd5c2d0c"); + FeedZipHtml(zip_buf, 32125, + "5a1a3b94711e3d970fc0c603469b3211a562565d60c6c7fab2"); + FeedZipHtml(zip_buf, 32150, + "dc63ee00b73ea8c7027f388d860bd9c301b0920fa0f12f1fce"); + FeedZipHtml(zip_buf, 32175, + "bd2b2eb3f0932ab360ec9bab752b3d964faab4425d9c488486"); + FeedZipHtml(zip_buf, 32200, + "60375fb80c7e79c866463f1076b3580d505f2e944c36c9e211"); + FeedZipHtml(zip_buf, 32225, + "569d16ed5fac42e002ceb0d92d27b0bc6c5e4e62ce9182c86e"); + FeedZipHtml(zip_buf, 32250, + "8a96d27f79a2c7637083a687dcd7ea965475ab49e1e83a78c8"); + FeedZipHtml(zip_buf, 32275, + "e65d6c15ca8281a7b3f3816b2a7b8e28c984cfe7eb69c140b9"); + FeedZipHtml(zip_buf, 32300, + "ba6a91bd5787ec067d1d45d37b7f4a562ea3a0182f8e2973f4"); + FeedZipHtml(zip_buf, 32325, + "3bbb08989852518e2e8ffe3b13beb007e1ff731f936c89fd4d"); + FeedZipHtml(zip_buf, 32350, + "f678b214bb092581d694cda9b2db0916d1e2fa5efea8130e26"); + FeedZipHtml(zip_buf, 32375, + "8e18b47b692d7a5d595b46e24749b5154779399bbbc81b4089"); + FeedZipHtml(zip_buf, 32400, + "0c0f1366dfa6c65dabdbe8b0be26f6272f9e6be450891c25f5"); + FeedZipHtml(zip_buf, 32425, + "21b25224135a16533d475a58d3cf3480d0e66672f2426b97dc"); + FeedZipHtml(zip_buf, 32450, + "e54d142da90b74ef1a5da6fa76ec9deb8de7af77cb39e06580"); + FeedZipHtml(zip_buf, 32475, + "827cbd80911b55cef9dacd040f5bd92c99bdc0e91a4ebe342b"); + FeedZipHtml(zip_buf, 32500, + "7a8930bb9371162de3c8163a060b425884d1443e0845262ca3"); + FeedZipHtml(zip_buf, 32525, + "2a4aa41d2c4529bc20395947c5495a328fdc82dfedc6097228"); + FeedZipHtml(zip_buf, 32550, + "f441c44f47f671280d9a3f3751317874ad1fb9844fcc549868"); + FeedZipHtml(zip_buf, 32575, + "e6f50a9c6325967b19a36447f76bb6908b5c32ebc62d367a49"); + FeedZipHtml(zip_buf, 32600, + "3657b1e48423a768c6b42042011b095561890621e9e9152fe9"); + FeedZipHtml(zip_buf, 32625, + "0b51ca084a820b80e117b27227cb72868507915c8a4b17dcdd"); + FeedZipHtml(zip_buf, 32650, + "48883d310842adde04251680efb6d703708af715c457317e49"); + FeedZipHtml(zip_buf, 32675, + "e4f7e815d74280a612226831a46e83d97d801d529d444992e8"); + FeedZipHtml(zip_buf, 32700, + "4650a511e3b8a3caf53d885c2eb1deda668cdb186b1bef697d"); + FeedZipHtml(zip_buf, 32725, + "92a858ff0949a23b6bdb129ebd3a12738e5c81b5cdb1da765a"); + FeedZipHtml(zip_buf, 32750, + "db66e4033b6bdb53b1b61918bc65d63663e74fdcda562f60e4"); + FeedZipHtml(zip_buf, 32775, + "462dc1dad684d36da8b56d27e3ecac6d5b48f90509a381b5ad"); + FeedZipHtml(zip_buf, 32800, + "307a5e75bfa9b96dce050bac632df6b6026390f636f3c36235"); + FeedZipHtml(zip_buf, 32825, + "7b31f3cedeb6d1c4e714f01bd9db164680f3a8204fc2de5620"); + FeedZipHtml(zip_buf, 32850, + "4a656f5b3b55eeec6d1bf42436ceb92d0edfd454c6f9726e05"); + FeedZipHtml(zip_buf, 32875, + "f22e30a7233fe32ee776fea763869cdbed41d4f9736ee745d6"); + FeedZipHtml(zip_buf, 32900, + "5dcead4a2ab5d1a436e7d635bc71ceadf3c78bc8b9754fbc88"); + FeedZipHtml(zip_buf, 32925, + "9cdbd967deba9cdb1c116d68ce6d6e9733e7dce67ebfcbb9dd"); + FeedZipHtml(zip_buf, 32950, + "78fee496b89ae4dc3a7fb1b9998eb3a4dcae433cdba5dcce86"); + FeedZipHtml(zip_buf, 32975, + "8635bfd95c449c39e5f691f2d7d79a727b15646c76789fc493"); + FeedZipHtml(zip_buf, 33000, + "7165a1c7fcb89637c0ff5e4e89c7d564b436ae98284c3374f8"); + FeedZipHtml(zip_buf, 33025, + "0ad38c06888bd379e62c87d2b061fed1ebc5411a7d9b795378"); + FeedZipHtml(zip_buf, 33050, + "96892d82f493e987577736e5fea385bcd3d7cb28b2b88d78ad"); + FeedZipHtml(zip_buf, 33075, + "199f81b6352cd2185981dbeb2a96eb424336214653ea1e4d3e"); + FeedZipHtml(zip_buf, 33100, + "ff2c18cd859bc62b6c2eb2e5587059bc598e40ac94d90aa32b"); + FeedZipHtml(zip_buf, 33125, + "39ddba0b2bcb5d5ba1d674c564f5d52d9fb78b8d2d20aaf489"); + FeedZipHtml(zip_buf, 33150, + "602c4b364d3196476f13c6eaf37d3d185be297d9468cb52543"); + FeedZipHtml(zip_buf, 33175, + "3ad1273f8cb28f49af046b2b7fd1a237cc19e033c64137318e"); + FeedZipHtml(zip_buf, 33200, + "5a8731eb9402d71007404084099459cbd8176b247152c06cac"); + FeedZipHtml(zip_buf, 33225, + "1fb200e6ccb135f905438e7b1eb0058c11425971a2e021f3fc"); + FeedZipHtml(zip_buf, 33250, + "3bb8772a50cde01bc76968d974ec18143e206c06ebb064f1d8"); + FeedZipHtml(zip_buf, 33275, + "1b0677c1505461510133af276f3e0d030c7d8ba869d9e4cd21"); + FeedZipHtml(zip_buf, 33300, + "ad48db432ce7b56809d1b1ac1f0f87f13d8da22b87cfc904eb"); + FeedZipHtml(zip_buf, 33325, + "eb8607c101d9b5ee7177f8699f7f6d5406167374c40a188113"); + FeedZipHtml(zip_buf, 33350, + "00ac8d055114ba0d07b7f277075eb9cf3357390cfe3f9328bd"); + FeedZipHtml(zip_buf, 33375, + "33c0427d3d16afe892522af762f8486dcfa8c0638ef47c4224"); + FeedZipHtml(zip_buf, 33400, + "ce009b89c6f33fc93f4f46a05db54162eb58c08ee23796e20d"); + FeedZipHtml(zip_buf, 33425, + "3a17e10ea9df6795cb0ccfcd45333c2952668e371329e77ff2"); + FeedZipHtml(zip_buf, 33450, + "f590f2a3e5d41d292f9c948b4ff6d743ca4ec3559350befcf0"); + FeedZipHtml(zip_buf, 33475, + "52917ba5867e232ecc8e56ad929fc9f83f2b1dee84c085a15b"); + FeedZipHtml(zip_buf, 33500, + "8535ad62fc9c6fc6bad171d9d8b7e3620d4c5e15e3b714ad0a"); + FeedZipHtml(zip_buf, 33525, + "72c5a2d0ea6b7e1ca58d9160569fc1ae876d4c023b3f33abca"); + FeedZipHtml(zip_buf, 33550, + "ed823fa3cbe981177c22d95c4bc858cf0ff86a13d76b08cb35"); + FeedZipHtml(zip_buf, 33575, + "700569ebc5c5b6336b7d36e2df25adef92d67749ebab4a5aaf"); + FeedZipHtml(zip_buf, 33600, + "1529ec414b48596fc0e53634637d27d4ec52d4b781ce0b1a66"); + FeedZipHtml(zip_buf, 33625, + "bd0a911f5c1982316772ec23d6da883a9079f25f6878657d08"); + FeedZipHtml(zip_buf, 33650, + "db2e197da3c8cc69ca69a252ac82d41eb5dac6e6a0e70950a5"); + FeedZipHtml(zip_buf, 33675, + "a0af89027789e72ba640498270e6613af601cbfefaac1cdffa"); + FeedZipHtml(zip_buf, 33700, + "cffbcfbbcf9f8903de7effe6b5efe1e5fff06cfce26f216a2e"); + FeedZipHtml(zip_buf, 33725, + "99ffec0de67af52711257aa56642dfd9d547ef030cc1aedaaf"); + FeedZipHtml(zip_buf, 33750, + "bff361133885633bb7c69abde7f8bfcfdebc1333c2d05b89e4"); + FeedZipHtml(zip_buf, 33775, + "ae71575310fd1eea467d7c7f8c6294308dd68d1689763dfcc9"); + FeedZipHtml(zip_buf, 33800, + "28ee4d905a6a76311961b32a1ae6e0762c6a9ea5b104074b9b"); + FeedZipHtml(zip_buf, 33825, + "453e5732b02aaff59bb2df78423e5d875b8ff7440981a02f63"); + FeedZipHtml(zip_buf, 33850, + "bd28da93891d00161b41dc5c479061b5be2ee4705613746fac"); + FeedZipHtml(zip_buf, 33875, + "16aab744647b6d72aa0b8e9017deef8224455e29ea5add09d9"); + FeedZipHtml(zip_buf, 33900, + "1b36799d84830186aaeae4c734031eb1ddbaac94230d9c29a2"); + FeedZipHtml(zip_buf, 33925, + "a26310a89bdd785c7cf546e27b5355f6b153b7e1d191805dee"); + FeedZipHtml(zip_buf, 33950, + "3ad88ced4cea53c9a6e42d7127be3cf534d0a6f1e83454bcb3"); + FeedZipHtml(zip_buf, 33975, + "68c689a929da2452bc5174c083030f7b57808ec484c51f61cf"); + FeedZipHtml(zip_buf, 34000, + "c380f8b2f545ac12be81cd86c8d7c470dc1a30003d277005c0"); + FeedZipHtml(zip_buf, 34025, + "e3ebe938c8ff4dfddbcf00c2a092daa3d45f730ba214a00601"); + FeedZipHtml(zip_buf, 34050, + "afe64817de2b2c3e8c0713fd3d25dd5afd13de8d388a4753fd"); + FeedZipHtml(zip_buf, 34075, + "3dee67f7bed88b79a6bbb01b3860f04f3fe9a9f1f8298aa3f7"); + FeedZipHtml(zip_buf, 34100, + "413ce04e6e27b9c3f742a04a849990b2c23779c908ae68645e"); + FeedZipHtml(zip_buf, 34125, + "a8aba521d3b83431a4598ce8c8598a069a573526ec8709886d"); + FeedZipHtml(zip_buf, 34150, + "6872f05a6865d5fd0931d57d4f86358c8304c7a4a269e2d9c5"); + FeedZipHtml(zip_buf, 34175, + "d5e9e535eefa158a468839e55d0e4365477ecd0d0d350d09b9"); + FeedZipHtml(zip_buf, 34200, + "13a7fcfce9e4e8fad410c1ec368762036c15f673855714bd26"); + FeedZipHtml(zip_buf, 34225, + "f13d8967b6f3739bb9f3fb20336ef2cc91d99b1fd15a3f9fba"); + FeedZipHtml(zip_buf, 34250, + "1470450b958e7e6134b06f0e1059189b2a1858ce88e5c4a203"); + FeedZipHtml(zip_buf, 34275, + "c5e7cffa5e14e79631273727e6ec0e515a428aad568c9ac001"); + FeedZipHtml(zip_buf, 34300, + "80d86fa7971f19e3e11ffb2f0898daa62dee161161755277bf"); + FeedZipHtml(zip_buf, 34325, + "17e7256ecc4e0970553cf6bb938fdf7d7c7f49a64f1061b80f"); + FeedZipHtml(zip_buf, 34350, + "e857287c5bd2f76dd0fd72c5759910254e9cf28e6b54cbbb8b"); + FeedZipHtml(zip_buf, 34375, + "e15a6b4ab4b87fd9ebdc8c41e50c1f96438d3dc0123c7c07de"); + FeedZipHtml(zip_buf, 34400, + "18c741389e556c4a1302f23d16850502c3ae0e959c20de20c4"); + FeedZipHtml(zip_buf, 34425, + "74a0c6fd1cdb4a91f185446a47d7d747c7ff3c3dd93f795ba4"); + FeedZipHtml(zip_buf, 34450, + "5475709a85e9cde4c7bcc873b18694ef3b6f06012a94c9f406"); + FeedZipHtml(zip_buf, 34475, + "8e381945a9f1849416d5a2c42daa0221e99af708538689e777"); + FeedZipHtml(zip_buf, 34500, + "f129f186fe140df832c74bf389944b5b4cbd2f517c1f6942f2"); + FeedZipHtml(zip_buf, 34525, + "19f7733b7ea177dc890111854a430bb7c994c2ab8ae542be02"); + FeedZipHtml(zip_buf, 34550, + "7c288df2019354c1892fe73ccc026f180cfcee94e6c7a8dd78"); + FeedZipHtml(zip_buf, 34575, + "48d1b3ac95980570be3f7871f09ccbe0f8c93064f4d92becf4"); + FeedZipHtml(zip_buf, 34600, + "e5dc3b35b6273809134a6e81efe75e40b822ca20a140f09783"); + FeedZipHtml(zip_buf, 34625, + "e770528cbd8eb048502705ae80ea9e008afbdc7fb1710a90b3"); + FeedZipHtml(zip_buf, 34650, + "b801191dd5994abc03f6e4bdfff4e37bfab1501ebb6c3cc39d"); + FeedZipHtml(zip_buf, 34675, + "8040f7c9ef7ef107417e512558e0bfae7355776c2a50eaaa54"); + FeedZipHtml(zip_buf, 34700, + "4e41a30411f1564ae0b81549541e522a9275ea51f5a32c00d9"); + FeedZipHtml(zip_buf, 34725, + "5c0a805d246e2c3204679c445ad5653ab9f87c7eae8bf8d0be"); + FeedZipHtml(zip_buf, 34750, + "c4213f1c9d5df01b2b26d7be9d349d8c1820001b7f32ccdc8f"); + FeedZipHtml(zip_buf, 34775, + "1702f86892c5801757999f384a73995f9b714efb176be398d7"); + FeedZipHtml(zip_buf, 34800, + "45592024d8664e2e2a18a8ed14a3c450d8f1777002602fb7ec"); + FeedZipHtml(zip_buf, 34825, + "8bc4b0d130412e04c74488d19af7a0208c31d20f6e8d1a9fcb"); + FeedZipHtml(zip_buf, 34850, + "575bb240262805aa72c1d5fbd72dc8bf232412bd8e24477238"); + FeedZipHtml(zip_buf, 34875, + "76d0f82bb256ffbd6a6c857b1d04d9fad13576d47e303ece88"); + FeedZipHtml(zip_buf, 34900, + "acf883adc6d55e9066493c95591775483a897a8b4345b1b689"); + FeedZipHtml(zip_buf, 34925, + "8c3bf49e0fbdcf40a54184ac936cdde3ca917ec1e2a8300557"); + FeedZipHtml(zip_buf, 34950, + "4979b20aa643cc538a3edf3a05433c4e91b7d577c2193b1bea"); + FeedZipHtml(zip_buf, 34975, + "10d3a18ab2b3c0328f43cc1cfa232124ee4db273963e582042"); + FeedZipHtml(zip_buf, 35000, + "1995e2b2321f2b1ff63c53fca371e56cacd78319df0bc01d13"); + FeedZipHtml(zip_buf, 35025, + "dc1cfccc31aa25a4e4620908fcdaa8ec6afb3ff0c66e08ce85"); + FeedZipHtml(zip_buf, 35050, + "002665d2ca7d6aab97ec86425bea2b3e794bc23a114f3d5178"); + FeedZipHtml(zip_buf, 35075, + "27ce4e574c065519d0232fada83331e249de2270982042187a"); + FeedZipHtml(zip_buf, 35100, + "ebcbba4906ffe064398cd52ba857ac47c0f13f7d3cbbb8668a"); + FeedZipHtml(zip_buf, 35125, + "730af030e4fcece2f4eafaf2ece2bd73dcf77aaaf35fdf7fbc"); + FeedZipHtml(zip_buf, 35150, + "700efa8b1cf4e1f3f9f559f9a27fb5c6d5acfcb7dca4e5cbff"); + FeedZipHtml(zip_buf, 35175, + "971cf9fef4e387d3ebcb5f8f3f9e9f9f1e5f9f15c6933cddd1"); + FeedZipHtml(zip_buf, 35200, + "7652a67f7f8aa09540697bead8cc64ffc27fcdc522c1457e87"); + FeedZipHtml(zip_buf, 35225, + "4f05b2e454055099ec87f172f60bfcf6e7b7d7dfda87fcf6e7"); + FeedZipHtml(zip_buf, 35250, + "1f0b7f7af7feddb78bb741e6585719c3b80c28e1a501d3281b"); + FeedZipHtml(zip_buf, 35275, + "b978c6618d5f1cdf5830db1061771c46a1a21908b37cc53bb0"); + FeedZipHtml(zip_buf, 35300, + "3c2b27b802d68ce3340d3b887558ee94acea61c6055c81050d"); + FeedZipHtml(zip_buf, 35325, + "4b584ffb3f285e796606b412f43909d32ebc500dd0a76ce44c"); + FeedZipHtml(zip_buf, 35350, + "e8b3f44bd5d95725ef002569b8c07fe2103c240e646930ecc3"); + FeedZipHtml(zip_buf, 35375, + "736e4660121f21b40171308b27a0ad735ddc288f43abb9cd05"); + FeedZipHtml(zip_buf, 35400, + "189c07e32f834a8b33994f948d646778ce1b9e356c6a6ccfc5"); + FeedZipHtml(zip_buf, 35425, + "8133989f8b3ff6365749d5863932672116519244de348b63d1"); + FeedZipHtml(zip_buf, 35450, + "32e7a17536b583b89f94bdedd1cca06d792451dfd87fb158f3"); + FeedZipHtml(zip_buf, 35475, + "7d858905afa8c224a83e3737b3183f59010ef7fbcf2c2bef3c"); + FeedZipHtml(zip_buf, 35500, + "983c974d505a9ddd4641c2fc055804699e9dcd248faf653641"); + FeedZipHtml(zip_buf, 35525, + "f975566c5d91557069c85a6a142cc1d279ad826e74749805bf"); + FeedZipHtml(zip_buf, 35550, + "0e8444f98a8d156f618ab2b850d7281b41f1bf578958cc3f3c"); + FeedZipHtml(zip_buf, 35575, + "3ab7b84d2a951479cf309b70facc100ae94a193fc8594b8c10"); + FeedZipHtml(zip_buf, 35600, + "261211356d2ff1c394fc87dd80f3a830502349b0da4605d838"); + FeedZipHtml(zip_buf, 35625, + "36ee749c0e64379e22d0ec31adaace42ab86a0dfc3e07b61f3"); + FeedZipHtml(zip_buf, 35650, + "34a2d3d3698ac51ab0b5d4547732506879fae9eabd7eb5138e"); + FeedZipHtml(zip_buf, 35675, + "720fc9c7e90ba891ec9490210417c1dff36c2c65599979e992"); + FeedZipHtml(zip_buf, 35700, + "2e87b1f53a04c42074adc2693d0a1447f8ef1b42a8e6ada1da"); + FeedZipHtml(zip_buf, 35725, + "de288c6e88e99ec413543c81517443e928f638960fc74ccbc7"); + FeedZipHtml(zip_buf, 35750, + "00937aa89a83be97ff7ebd64c866ce1651de9e47f0142ab870"); + FeedZipHtml(zip_buf, 35775, + "c6033e884866c628cc12c6ef8c3e67881429618bea65462dcf"); + FeedZipHtml(zip_buf, 35800, + "ec1e67804f786937a8ee52a81f4e4e7fa15b835f24e1c30d55"); + FeedZipHtml(zip_buf, 35825, + "8fd762bab965668ca93749312e833238602e0cf943bdb26d44"); + FeedZipHtml(zip_buf, 35850, + "3af00e71df74164cfb1e637db1fdb8bf9fddc7fb7fc6f1e860"); + FeedZipHtml(zip_buf, 35875, + "f9a8fb1b2c73cef5d36ad0578dac41e1b6875bbfa1a26c453c"); + FeedZipHtml(zip_buf, 35900, + "0ea845d2cd7dd80381bf1a9dc5d0db201cdc669b8696ccdbf0"); + FeedZipHtml(zip_buf, 35925, + "a45c7ecec1c74453bc55200a03ece55ffff600ffbf370e1f82"); + FeedZipHtml(zip_buf, 35950, + "21ccf182e7953f9795f2bc96b1ede77bcb42b2a35e0ff14626"); + FeedZipHtml(zip_buf, 35975, + "18b8f12b37a88e3baef1b261f858588008aacc7c724c2720b3"); + FeedZipHtml(zip_buf, 36000, + "92bafae500f67d905d503a3552a41bacd690fa270794689021"); + FeedZipHtml(zip_buf, 36025, + "82de4d39e5ae4fc04f74e06dc459e4a190bc73d447a6648c17"); + FeedZipHtml(zip_buf, 36050, + "0f7a92c59712e3459c0592b2cc15b9ea5d4a7233c56f6531d3"); + FeedZipHtml(zip_buf, 36075, + "6592c9463c62137a711699a9859404a4b9b57d5e8267219700"); + FeedZipHtml(zip_buf, 36100, + "a6f04c47a8f5865d1de37bc9c8e0536b318d1228d138668539"); + FeedZipHtml(zip_buf, 36125, + "40cf49414ca283267e3440ad80f762bc55b677b9b8f9b4d052"); + FeedZipHtml(zip_buf, 36150, + "4a234b332cbc8cef6b901046d4e320efac02030d344de2fb9b"); + FeedZipHtml(zip_buf, 36175, + "6832ea2cadb2ea42d11403f8c56e4b1e89760952a1f4a12e5f"); + FeedZipHtml(zip_buf, 36200, + "4fb34834d6b3bad0d8d8fae3d1388a4d04c6a9e121c7ee5b48"); + FeedZipHtml(zip_buf, 36225, + "ac0e94ad43bfb311dccbb570523bd14f8d687921fe27e53e0d"); + FeedZipHtml(zip_buf, 36250, + "e38e892a1a09d78029bc2bb228b4b8bb20ed664feaf71dd8ac"); + FeedZipHtml(zip_buf, 36275, + "320450e8efb34944b1bccf00a24a5737a6093958d8b0117cba"); + FeedZipHtml(zip_buf, 36300, + "78dff6fefbd329fcdfebb377ef70929f83ce274ff81ff15729"); + FeedZipHtml(zip_buf, 36325, + "e3108a16227f9159a83ed481325824410aeabeb204f042877c"); + FeedZipHtml(zip_buf, 36350, + "de5c1cc0b3713478460604c4fb4fe868cfb9ce9ffd3e0e8c21"); + FeedZipHtml(zip_buf, 36375, + "b8cbe2185003fb7a0c9ea138e661ff3ee88cf5283c61ce3b2d"); + FeedZipHtml(zip_buf, 36400, + "4f804581448da5513812609384c99014a069c9ca28f8e5197d"); + FeedZipHtml(zip_buf, 36425, + "faee99c7269abd03c38c635e71e99b0ecacbc1e0c0bb4fb0b5"); + FeedZipHtml(zip_buf, 36450, + "a532eee0ea7bd5c6139091eadc94c6b0bc8bd229a1e76294dc"); + FeedZipHtml(zip_buf, 36475, + "1c590d727ab869ed6f1042377f165935fd7d54fc7b9aa4e5a5"); + FeedZipHtml(zip_buf, 36500, + "0a962ad689ce8f39efa874c2e418720e9f557500132232814d"); + FeedZipHtml(zip_buf, 36525, + "b1d29f7fbc26f18f7f6cfe5ce3a90c117966479d1b23287ca5"); + FeedZipHtml(zip_buf, 36550, + "fcb38e5aa99a828255ca07e838999a314d5633e363ca47e1c1"); + FeedZipHtml(zip_buf, 36575, + "755c4c611cc78f14920519bd34a4fb437fe0b5d81384cf097b"); + FeedZipHtml(zip_buf, 36600, + "8a48d5c13f8d30f20c04c0a9f1e5257d516656f961af64b151"); + FeedZipHtml(zip_buf, 36625, + "e962a3d2c546658b8d8a8bd931f54bd1ba24b3a8d5bcf203cb"); + FeedZipHtml(zip_buf, 36650, + "3986d788656c8676663b94d6a2a1016c4590c559d40b1e4a2f"); + FeedZipHtml(zip_buf, 36675, + "c01cf434802f634be84852985825e83ff85f824f71e86aac6e"); + FeedZipHtml(zip_buf, 36700, + "7df65a5596d05a2b28f9785094f42411598eb3852ce5360557"); + FeedZipHtml(zip_buf, 36725, + "6f60d54659232e46d11d3d2cb50ac16cb7f95bcd75fe363f90"); + FeedZipHtml(zip_buf, 36750, + "ff5ce45d2f651f5b8d08de6f0b46850f35a8f061fe2b182d12"); + FeedZipHtml(zip_buf, 36775, + "1596b28fed46850f8be60a75b8f0db232ea18a1e178a28abdf"); + FeedZipHtml(zip_buf, 36800, + "e47663d16f0b40a3b39402a1df7f7aebc82652df5ab4b4cb6a"); + FeedZipHtml(zip_buf, 36825, + "b4c64017dfa3c22814ad918b2ec4786c8ccacae57feb104375"); + FeedZipHtml(zip_buf, 36850, + "a38b8dc72b0f464a9d10a63f1bc0c5f3045137c69895818174"); + FeedZipHtml(zip_buf, 36875, + "1b8292c270ea9b194d0a27c944479e630b678509c91aa6d1f6"); + FeedZipHtml(zip_buf, 36900, + "67c30e88f13754000693dec950845571001a93884a77960217"); + FeedZipHtml(zip_buf, 36925, + "61f12e89474e101b1f35a0dd7094502ebd86d503ba069012de"); + FeedZipHtml(zip_buf, 36950, + "65f7b160401ffb697644a16483b0eb886d363f97b38cb58337"); + FeedZipHtml(zip_buf, 36975, + "8c7a619f6270a82b5c17992587d08e2799cbe2650118d9071d"); + FeedZipHtml(zip_buf, 37000, + "41a38e654031b84cc9306d85b5cb7378ee752488e6bb4c3473"); + FeedZipHtml(zip_buf, 37025, + "1be1c1df79a33055011fd2faaa6ffc9b3c6dc1596eced2236a"); + FeedZipHtml(zip_buf, 37050, + "35e78eee290c69a95a56641f746bf25cb1a374c0fa9e177a4a"); + FeedZipHtml(zip_buf, 37075, + "10a2707aeb1cd220a66aee33ac7dd4ee83649f9e8e987e669c"); + FeedZipHtml(zip_buf, 37100, + "4d9727b51d5321561fe22c0459a042e58bdad549704ec22889"); + FeedZipHtml(zip_buf, 37125, + "48aa6a217c9316ab4507961b0881ff6320c5e3134dfe2b9f64"); + FeedZipHtml(zip_buf, 37150, + "82ab7ee824c73e807e1fc30c7bde1f13515eeeabce2a79170e"); + FeedZipHtml(zip_buf, 37175, + "01ae009a9fa9475491f472035a9ef7f0a24a80aef848733ebc"); + FeedZipHtml(zip_buf, 37200, + "acfa75f9c7bdb989b32c8f8bbbeaa4c2491b29fc603e176561"); + FeedZipHtml(zip_buf, 37225, + "36f5ee6fe334f03ebcbdf4fa20eea598f3051bbc17b0428e31"); + FeedZipHtml(zip_buf, 37250, + "516c165dac405f8342a392e0214b80d8bc316a2054d20e4038"); + FeedZipHtml(zip_buf, 37275, + "7d6126ab0354a62f15f02b2fea98db13384ccd85215fed65f1"); + FeedZipHtml(zip_buf, 37300, + "357515a4d67251c817931496aaba2a3de82bbfacd080d62aaf"); + FeedZipHtml(zip_buf, 37325, + "ebed241cf660837c23c59bb2bf3f994b52250d22ba83470036"); + FeedZipHtml(zip_buf, 37350, + "e79a57b207c5c2d0ad46a429634218dd74a67c657ccf545a5a"); + FeedZipHtml(zip_buf, 37375, + "5425559832f22390a428148366a7f01c8eb75029177d51d18b"); + FeedZipHtml(zip_buf, 37400, + "5b104d52297ae5aff9f1f2c4df5df2c4e5ffb94e829c34e1b5"); + FeedZipHtml(zip_buf, 37425, + "9408750ca7ee8040881ec9af5ac4b844305531c3dc80ada331"); + FeedZipHtml(zip_buf, 37450, + "0603e8505d79e5750c915127e7c16bc21c57cb1be962ca0443"); + FeedZipHtml(zip_buf, 37475, + "e3e393bb31ac5b10e052c497fa8a1c0106aa7fd21525eb8fb0"); + FeedZipHtml(zip_buf, 37500, + "e3b84f419d694c1640caa3c239ef51d1b232d88183a514bb80"); + FeedZipHtml(zip_buf, 37525, + "4d92a2f8de4b510f9b8a6c1ba1df837a3f0cfd743f921d25fa"); + FeedZipHtml(zip_buf, 37550, + "9c3b564646a517572e285a9f7797b789977712a65925e5e901"); + FeedZipHtml(zip_buf, 37575, + "7881f3b93468c6c4ef8593f44931c5f48f09861d76c3a43b19"); + FeedZipHtml(zip_buf, 37600, + "a5dd24ec70d96cfc3608b18d227e82a3b6900d7a5c2b950f41"); + FeedZipHtml(zip_buf, 37625, + "258118247bb95bf28cff599064f1301aa2e9b2a2ed89a8cdfe"); + FeedZipHtml(zip_buf, 37650, + "958b10bfbcbd6181b5480cea1392c168f8894bd54b23b069e8"); + FeedZipHtml(zip_buf, 37675, + "53a0349c830d7edd26369004d45d0f3fc4f130f0a325cfccb4"); + FeedZipHtml(zip_buf, 37700, + "c93d063e5f9ee1e77c03a8a5ad2a85f62b73f59a63cfc324aa"); + FeedZipHtml(zip_buf, 37725, + "9bbe002164c9049d70ba3563dcc1de9f68c664ea90ac03be9f"); + FeedZipHtml(zip_buf, 37750, + "c45db2331f5891d1dc9c511f581a5845e3552a7d835ce11726"); + FeedZipHtml(zip_buf, 37775, + "44b9808cb83620d512c9d7f8535c5bb66bf26afe47ef425da6"); + FeedZipHtml(zip_buf, 37800, + "da840e84959d648d83a84d085b2c16ff19e0839d197c4c3478"); + FeedZipHtml(zip_buf, 37825, + "cc6f8e66ff128ec732011f9b416a9beeec7b2fa08409c84267"); + FeedZipHtml(zip_buf, 37850, + "9ca647115546f90c886786ba28536544effafc8ca262528bdd"); + FeedZipHtml(zip_buf, 37875, + "12e24076c0a7996fef2cb48fcae47d301cee8bce10c6fc5cfb"); + FeedZipHtml(zip_buf, 37900, + "9b1afcdaa0b3adea2009989bc2de0de406c65e9ce68fa4a60a"); + FeedZipHtml(zip_buf, 37925, + "a4996213ceb2a71fc8f77d9009aa75f23afdb98504fe91f1d5"); + FeedZipHtml(zip_buf, 37950, + "26466a4b1d463dea6854d2927a79847b0a9a87dfcd38003c02"); + FeedZipHtml(zip_buf, 37975, + "adb8cb3e2683560d5ac62c55186d79d28dc60e71120e420cef"); + FeedZipHtml(zip_buf, 38000, + "35c18cfa8be8790abfc0862aa2e8991addbdf5710f41c24e40"); + FeedZipHtml(zip_buf, 38025, + "f8aef378cefaee5e238ce6bd80c3190d2641ed500064e3380d"); + FeedZipHtml(zip_buf, 38050, + "33a03a02247b3714b22bbc32f6594b5e1229a3b01b0ca7c2fb"); + FeedZipHtml(zip_buf, 38075, + "4ac401071c27f1384850bea43d691f8ec2be3e9c304ea89d84"); + FeedZipHtml(zip_buf, 38100, + "ec2d21dc4bfe24e5a40b109940caa9dd88095cd9f55b9c8733"); + FeedZipHtml(zip_buf, 38125, + "6542d230874090074e5e035b888281afa0c37b868f808707f0"); + FeedZipHtml(zip_buf, 38150, + "1ba4b4241007249e8439e24323b1a39658917ca48791bca85e"); + FeedZipHtml(zip_buf, 38175, + "0b67cdf7b061acaac8f2601a92c72da331f9fd7144f6c87ca7"); + FeedZipHtml(zip_buf, 38200, + "866416d93cc84966af4ab1d4ea560240ff7cfd6effefca778e"); + FeedZipHtml(zip_buf, 38225, + "02f2f5e92fd7082760ee219128f62bba238cc5b52cc2930c5c"); + FeedZipHtml(zip_buf, 38250, + "d11df0f1ee1088d16e3efcd5d1e08e046d12e4375f16c87452"); + FeedZipHtml(zip_buf, 38275, + "a13d84e5593725b63db79cfcaf4a59f7df3572f42cebd74acc"); + FeedZipHtml(zip_buf, 38300, + "736c65c912b5966a82fcd5ede4eb9d7cfd58f95a744d613621"); + FeedZipHtml(zip_buf, 38325, + "d16b11f2f1b14019b725407cac78b6574169475440c740ee1c"); + FeedZipHtml(zip_buf, 38350, + "7de5a1c50f631db69cb9406a74ab33d6a340204c17a6e02110"); + FeedZipHtml(zip_buf, 38375, + "864743f8006fc07e3c5e0fc3ff1c75ab2e4e7fde88ab9b44ab"); + FeedZipHtml(zip_buf, 38400, + "be3c6bc5cdbb3e11a7edbc3bf1adfee296da33f07a618169dc"); + FeedZipHtml(zip_buf, 38425, + "62e13fffd7df5fbe78f18ac77cbef8f1e2e3cf176ce42f28aa"); + FeedZipHtml(zip_buf, 38450, + "be117317ddc5a2dd532c02276bdaf829001f5b8fa803ca7ac0"); + FeedZipHtml(zip_buf, 38475, + "0ed48f03b52dda95c13b376a07f4c701bdb23f747ec40ed88f"); + FeedZipHtml(zip_buf, 38500, + "c470ecb6fc5380cae91596ba2e43f1dcb01dd81700f64b1fdb"); + FeedZipHtml(zip_buf, 38525, + "84d782dd18b603fb23c17e372883f4dd6007dcc701f7fdd851"); + FeedZipHtml(zip_buf, 38550, + "54417ed901f731c0350ccd57e19f6e6e911bb366809b694114"); + FeedZipHtml(zip_buf, 38575, + "69015bc2ea559d2906938a2a5836acf2ba943624adc9f67f2a"); + FeedZipHtml(zip_buf, 38600, + "4cd365e096dfeb41bd4cfb7e1ed24597966dcd412bbb36509b"); + FeedZipHtml(zip_buf, 38625, + "a61ca763cd5244977615da8b9adf94ec9f1c3c8c876137ccf4"); + FeedZipHtml(zip_buf, 38650, + "195211f323fd76d5976919cc5cb7a9066cd6751a46b9a0df57"); + FeedZipHtml(zip_buf, 38675, + "1e155940501af20c4fceea2e49d826f07a9441b1ee1ece5c06"); + FeedZipHtml(zip_buf, 38700, + "4cd77d1406b66ac276d6742b15c4a568477999703e8a254bc3"); + FeedZipHtml(zip_buf, 38725, + "c328bef047e4250b78ba73f138187de6705c5af8b83c5f4c3d"); + FeedZipHtml(zip_buf, 38750, + "1d5ac427c0c01ea2ba9b7f170e83b3d26005feba59b4c77b92"); + FeedZipHtml(zip_buf, 38775, + "35ef4b2ce1043e6dfe5efac544717e5fa1aa174bcb5fa96a91"); + FeedZipHtml(zip_buf, 38800, + "7104480992c6d9d547ddd70d3d102a7aa5daf7567967570dee"); + FeedZipHtml(zip_buf, 38825, + "acedf569883ba176a9f659f32eb94ebd846807dd07e3a1df55"); + FeedZipHtml(zip_buf, 38850, + "2df06c70920468b77c2a58636532aeece0c8f2ccebc91b13d4"); + FeedZipHtml(zip_buf, 38875, + "94b342e2268a8ca3499a7922d38c3c6bd2a22bd10a7e6def04"); + FeedZipHtml(zip_buf, 38900, + "7fff1884aabc5c6cdc5a7eb9eaebec97dbf6ce7ac8d8aec67e"); + FeedZipHtml(zip_buf, 38925, + "37f8e4ea4b638d103e50ebf3715a378131a238c1dad12ba4f6"); + FeedZipHtml(zip_buf, 38950, + "1f9c45bf42e442f6f138042bdc9c9906625f9a68871358bb4d"); + FeedZipHtml(zip_buf, 38975, + "020ab412fe44582fa2170e7e41db955cd22d69c212ff39cc5e"); + FeedZipHtml(zip_buf, 39000, + "f5ad2dfee7207bc58d70b0ee63379e0c7b0893008bf24fe8d1"); + FeedZipHtml(zip_buf, 39025, + "35e862efc06cba5ac022f33036022ded30c7521867f49cf534"); + FeedZipHtml(zip_buf, 39050, + "4ba27d8a0dc49213e5cfb1fcbe590fb2dcd5e63dc9859d2df1"); + FeedZipHtml(zip_buf, 39075, + "51aebcbbab4677d7f6c662d0a6f14efb692e80758d8f737e2f"); + FeedZipHtml(zip_buf, 39100, + "cb7e9e2bafd9f83ecf35ef1e69eb915e299a3578a66b516d13"); + FeedZipHtml(zip_buf, 39125, + "1eea716e93bba77a394ff57598953888e4c7cd7aa4694b9bf3"); + FeedZipHtml(zip_buf, 39150, + "32f376667b8e11f3aece4fbebb3af5c8ef566b9d3feaa41465"); + FeedZipHtml(zip_buf, 39175, + "5d764df2fb66dd94dcd5e65c96dad192ef4b174273df97fc5e"); + FeedZipHtml(zip_buf, 39200, + "7f5f8f2e7e38d38da9a211adb7d80a15b9d8dbf8616f732ed0"); + FeedZipHtml(zip_buf, 39225, + "dcd6d264e00fe730271752fcc57983e6804dba425f5fa01417"); + FeedZipHtml(zip_buf, 39250, + "3a6f724d1dbc5f7ee512ba2c3680a4020f6dcaf1c30af40e2f"); + FeedZipHtml(zip_buf, 39275, + "231cd5eb2ddb65a6ef3a3f00edc3a66893e6b654fc257ca52d"); + FeedZipHtml(zip_buf, 39300, + "3a7ec99d80f155ce922fe64b5c47d7e77e8aea4f1a9c72a559"); + FeedZipHtml(zip_buf, 39325, + "3775dba35a8803b244ff3ad8f0284e31e50267212290f72d3a"); + FeedZipHtml(zip_buf, 39350, + "d4cc46bf1c4f9d88a643de386014b1e66c024519ce560b486b"); + FeedZipHtml(zip_buf, 39375, + "e0c6c152c68e2f189cf9699bc4c4fef2c9cf6e4f1fc8c32deb"); + FeedZipHtml(zip_buf, 39400, + "4c9484c8e6865211cbc495dabd0b9aa8456486651d16eb519b"); + FeedZipHtml(zip_buf, 39425, + "85c2b8ad8562ae316375fa0456d77a379ca4b7ee040af5d909"); + FeedZipHtml(zip_buf, 39450, + "2f236969f100bb0c286b887472914588a42e9c915d2a0b0638"); + FeedZipHtml(zip_buf, 39475, + "1466d83d38a41a21d4a218d395b2a0f2d4e7b1df83b99c4716"); + FeedZipHtml(zip_buf, 39500, + "df5ae4f6180314f7e364fff3e5b9dbb0b13cab062602856f72"); + FeedZipHtml(zip_buf, 39525, + "9ba0a57335c6291792dfda215657f1703c6ac66dd59fd9263c"); + FeedZipHtml(zip_buf, 39550, + "9cd36b998ab57892811eadfc774352db13140cc209f6a0ef0a"); + FeedZipHtml(zip_buf, 39575, + "e5d8a78631dcb10ecd1b80d5bdc0484ae284e3be68b19b99b9"); + FeedZipHtml(zip_buf, 39600, + "49563e23cf4e1246ce26936bf18606194cc4e2fe42316f8038"); + FeedZipHtml(zip_buf, 39625, + "d408fb319a5bce55c0829dc3e5130c3b6f8cf93f22f9dc8769"); + FeedZipHtml(zip_buf, 39650, + "c04cc79dce4123d16203e89e6297c92c38249bc3d5ffa3cac9"); + FeedZipHtml(zip_buf, 39675, + "d26d2ebbeee893a45e87cadb619bbf08879f5d9fde7c38fae5"); + FeedZipHtml(zip_buf, 39700, + "e6fcf4e2fdf53fbd1675211e4eb1b5d5fbb782ea9dc961d6ea"); + FeedZipHtml(zip_buf, 39725, + "7451b88343ce0e310bc678f15880bf17c709e1c80865ad718c"); + FeedZipHtml(zip_buf, 39750, + "1780749206dd4962d630624499a49c8242b9bf807cbd304538"); + FeedZipHtml(zip_buf, 39775, + "13f844c61b22607986cba98ede91997119f587bf0b9338a24b"); + FeedZipHtml(zip_buf, 39800, + "b9f393902e0f2ee3ead3d1f5d91141e4eaf4f8f3e5d9f5af3f"); + FeedZipHtml(zip_buf, 39825, + "60f1bf079d38e877d27838c930164625d902aec5492fa04ef4"); + FeedZipHtml(zip_buf, 39850, + "66b04c1031569808635c9f805e1a0487646fc272d59fa3d4ef"); + FeedZipHtml(zip_buf, 39875, + "eb16c8f9123f05c671852d6ecb3887fcd84269b9ca998a04ea"); + FeedZipHtml(zip_buf, 39900, + "6627e6436fe69e3e62e6b2acf4558816ccc3d49e391159c505"); + FeedZipHtml(zip_buf, 39925, + "8aed53196b46c1d0e27935cc4eb239516babc5bc284414000c"); + FeedZipHtml(zip_buf, 39950, + "b907fc0ebe132d2d902b99b9920e7ea85250e917bdefe23be0"); + FeedZipHtml(zip_buf, 39975, + "0a3007900c170393220c73cae22c16eb69cd5a8f62ef2b4e86"); + FeedZipHtml(zip_buf, 40000, + "df8a8214dfcc2d26abae6a2c2963d2eb246147c13e8f908ab9"); + FeedZipHtml(zip_buf, 40025, + "21f0ee5e814d7c059ad6770b4aeabb61eb9f8ae26e57976727"); + FeedZipHtml(zip_buf, 40050, + "b2d70ca98eeb2cf2a6cffa7d7d41b62b38d859fa3e8807893f"); + FeedZipHtml(zip_buf, 40075, + "be7575eac88f68f169677b94ac3dfd6c76e6a1684d9c902c91"); + FeedZipHtml(zip_buf, 40100, + "2183d66cd1a306e8f787fbb8183b26c27ea571c56c190d83b9"); + FeedZipHtml(zip_buf, 40125, + "5a6a8b1806d64101f597bc422288f3b9fd593435b07c60d5aa"); + FeedZipHtml(zip_buf, 40150, + "9cd13343f17ce40ef6e6279132b696092a0ceb4f49fc3b49f8"); + FeedZipHtml(zip_buf, 40175, + "6597a1066cc65d58fb7d4a57f14f3f7d370cc7e3a077f41038"); + FeedZipHtml(zip_buf, 40200, + "f2dd8b63d6762182bb720b5eda8e87fb41e5ad1f0e265cb7e7"); + FeedZipHtml(zip_buf, 40225, + "d09380fdb5fd0bb3e828cd50fb139749a60dd26b70d02fed5f"); + FeedZipHtml(zip_buf, 40250, + "71d013b94c4c211883c618bbb2df73032aaf51daf8b484217e"); + FeedZipHtml(zip_buf, 40275, + "7d3a04c8a78d7ffe0814c8ec5e4038c61fa35c078f73c66fb3"); + FeedZipHtml(zip_buf, 40300, + "71547ac3d605f34f49380a3e04f08fd077d8545da336007cb4"); + FeedZipHtml(zip_buf, 40325, + "1fcfdcf65a8178e267935129f0e8eb06004ded72adb0fa0c1b"); + FeedZipHtml(zip_buf, 40350, + "2e05157edc0048c93dae9932e9d976ba3a0a43360068f67ed7"); + FeedZipHtml(zip_buf, 40375, + "0abaa38730bd79717341c5c14b60678cd900e0c9adb2daca8d"); + FeedZipHtml(zip_buf, 40400, + "04fa6192321afab0d735c3f2631206a28b591d488da11b00d9"); + FeedZipHtml(zip_buf, 40425, + "dcc63714c02f1b20ebcb4d46d6340051b6b729c06c8cad2fb7"); + FeedZipHtml(zip_buf, 40450, + "075bd709e1c7da67b2780c6306d30a1bcdb518b2afc389d65a"); + FeedZipHtml(zip_buf, 40475, + "8a1f63ab5e7cfff22fffd8ff7e9925f967b2060967bb04d5a9"); + FeedZipHtml(zip_buf, 40500, + "ec0d5dc4f1b2912d0faf4236e9cc8743b871bcb6eb55c3e138"); + FeedZipHtml(zip_buf, 40525, + "b80fc32fafaf3f7efa584347250e7ddd0e3bc12ed9c2360e08"); + FeedZipHtml(zip_buf, 40550, + "8c2745d4690be5561104207a141bbf83b1dd49221ac60aaf7e"); + FeedZipHtml(zip_buf, 40575, + "395be122ff38f9355a3f1d4686fc8856ad39612df0140e9b4e"); + FeedZipHtml(zip_buf, 40600, + "8c7eacce1b4190219f48868a4741761f275ff86f4084fe7e46"); + FeedZipHtml(zip_buf, 40625, + "6732acf5e6e5c0215f10fa005885319e6d0b21da16f8efd22a"); + FeedZipHtml(zip_buf, 40650, + "df0aa3ee70420e1d19b01f00176323362d52514fe20c182842"); + FeedZipHtml(zip_buf, 40675, + "18eed7c1ceaf6f8cefd5083eff9dfcb2e04bb92eb815382542"); + FeedZipHtml(zip_buf, 40700, + "1af8cd8eb20801831b0104d0a530bdf7a7f0367c9baa0639b2"); + FeedZipHtml(zip_buf, 40725, + "d7acf0ded005b9dbe468a445eee01940db632ffe63ef9ba0bd"); + FeedZipHtml(zip_buf, 40750, + "ff42bba66a9ea48a50247baf550488df9bdfbf3c227a561acd"); + FeedZipHtml(zip_buf, 40775, + "d1f6d0cdd0c078b8a099e1cfb77e7af3672e20680d2bb66192"); + FeedZipHtml(zip_buf, 40800, + "6190f851976671f72fda60aee7c37f9ebcfd7025c27053afc5"); + FeedZipHtml(zip_buf, 40825, + "2c07ce257c53e4cc0f29e425a2c5bf047b6e97588a2103e81a"); + FeedZipHtml(zip_buf, 40850, + "0dc6586e3d502fcf016fc3ea360e0091e047881c8aa8ab5e78"); + FeedZipHtml(zip_buf, 40875, + "17f6d08a3b89c23f260109496ce3355eb243da763ae9c0d261"); + FeedZipHtml(zip_buf, 40900, + "c48d1b69d74c50e8e90d3376d38e29e9e720d7bd1c16c74bd6"); + FeedZipHtml(zip_buf, 40925, + "0bcb8e4f9701754c87cbbc9aa6593032c5306b0b54967e9fcd"); + FeedZipHtml(zip_buf, 40950, + "c8da49b9e75888d08657820757f8cf0d9b736e5e3a818ce981"); + FeedZipHtml(zip_buf, 40975, + "61df9f78fb18b84d43bbb13c714a1b5086e99a3d108ee2b1f4"); + FeedZipHtml(zip_buf, 41000, + "89551f6e8dbfece606b17b18728c96b5b3035af1f9c1f3dc7a"); + FeedZipHtml(zip_buf, 41025, + "ca9d6dcca45cd98e6ef0b57cb3ede29a6d836bda4c323d447e"); + FeedZipHtml(zip_buf, 41050, + "aea518c553590ababfc5500bacf6cc097979b7bcdeb488022b"); + FeedZipHtml(zip_buf, 41075, + "63b627a08c94b35af3ebb21eda05b3012ce63a0c84877b14df"); + FeedZipHtml(zip_buf, 41100, + "910b46e33753fbd0a30c8a50c7d0efe99e0bc8380e05da6030"); + FeedZipHtml(zip_buf, 41125, + "ed1780f75d904c31da02ee629262b85e24923200f9a7f18412"); + FeedZipHtml(zip_buf, 41150, + "ec0cdf7a8a1210d0f7fd2de08cfcde8b49f2dca097f6a8d73b"); + FeedZipHtml(zip_buf, 41175, + "4be38bb8e732445cdfe8cfa58f4adfef06fbc577a5cded31f3"); + FeedZipHtml(zip_buf, 41200, + "c9229b2795d11df8bd9e48770de10689f1e2a129de461c5006"); + FeedZipHtml(zip_buf, 41225, + "5c99b19eb2bfcec8cfbab78439a05a0bc7dd3bf899c42da450"); + FeedZipHtml(zip_buf, 41250, + "0a2a0a2302db2bce5191a46ba9f49e5a8f586860488b5c379e"); + FeedZipHtml(zip_buf, 41275, + "6e3cf3bfc0ec885318b6cbc199d3827501f750826ec2517c76"); + FeedZipHtml(zip_buf, 41300, + "c2a59364096d4cf015873710f1552527d288598e671f800cab"); + FeedZipHtml(zip_buf, 41325, + "10cdf85e8a69117c9c1dd3e65470978266c88c10941692894e"); + FeedZipHtml(zip_buf, 41350, + "10e21418871b51d7e5928bf34997834381b696725fe6ce9b85"); + FeedZipHtml(zip_buf, 41375, + "ded56530aaba2afd79d69bdac01be107a270276b833d33dcd3"); + FeedZipHtml(zip_buf, 41400, + "dea08a1fe3e772211f1b8c94924a10f54abf61c85f4ac1aedb"); + FeedZipHtml(zip_buf, 41425, + "cbb51134c87523744ba16c7b1fdb375b66d8a8e68734ed22ef"); + FeedZipHtml(zip_buf, 41450, + "f9f8d68f06014e8b7076deb53da4f4be031830e7756e122176"); + FeedZipHtml(zip_buf, 41475, + "e9b404f58191f0097026d86354683c01e99ba3130de3b1472d"); + FeedZipHtml(zip_buf, 41500, + "eed1b47c1b8ecb6e77554cb39470f5e7592f7203efcac134f1"); + FeedZipHtml(zip_buf, 41525, + "646b83fd45708feba757a0e0b9020dae6fac11b393d23689b2"); + FeedZipHtml(zip_buf, 41550, + "291e51d10dc89964106141935825ce3e0a7a2420d25be75d9b"); + FeedZipHtml(zip_buf, 41575, + "f1f482dcf8127a012a521ca4ae350d2c3724ecf0c05e715202"); + FeedZipHtml(zip_buf, 41600, + "eea6489a3ddc4d392e980376a8d0181546718ff3bf487f56b7"); + FeedZipHtml(zip_buf, 41625, + "aebecb1bdd0c2c1004ffcfc01f563104fc5e89032fdc52147c"); + FeedZipHtml(zip_buf, 41650, + "7959ceab370c0d6ee19044a944a56ce102b296ee6882bd2932"); + FeedZipHtml(zip_buf, 41675, + "dd06a303ef2d7a8db23c36a44d390323808126b9f49d94cc9f"); + FeedZipHtml(zip_buf, 41700, + "daf32d3182e233e42fe23bd06c6742287e9996c7554af1c9f8"); + FeedZipHtml(zip_buf, 41725, + "bec327173e5dbb2fd7cd5e084328f641e2d9462001685fb879"); + FeedZipHtml(zip_buf, 41750, + "e01d685871459f9386668ed9a969a69ae6d2ce5829e3266e98"); + FeedZipHtml(zip_buf, 41775, + "772f87d1e385965b32a4599c88fee262442ed184ae6133943e"); + FeedZipHtml(zip_buf, 41800, + "811bc02bde519db572f4114376d8b36cec714835d6f7474935"); + FeedZipHtml(zip_buf, 41825, + "0b4720d0220de652a6681a43e65436370c05b4be496aa66cf8"); + FeedZipHtml(zip_buf, 41850, + "28f93c5fb8f0cdf6082d88e88bd7ee165f4caea15160ae1b27"); + FeedZipHtml(zip_buf, 41875, + "dc59c28d57b10c7bc8d77de3d8d893ef242a972cc8ba3e8f60"); + FeedZipHtml(zip_buf, 41900, + "914e4080251176e1f78ced1c60cef2227b70d1b931b37ae4ea"); + FeedZipHtml(zip_buf, 41925, + "4ab7adedaa15c0c99d66d57bf3ab48910c4b9fe2e174201b80"); + FeedZipHtml(zip_buf, 41950, + "2cfe4248c4adba0d1a30e7559cbce560bb4db98ac998fbe278"); + FeedZipHtml(zip_buf, 41975, + "b0318a6c34fd97cc4c7b0106c70c4390e3f17a86522d046a0a"); + FeedZipHtml(zip_buf, 42000, + "47a1d201b8c337dd9df06e0ac382d2f7e84a44623c752b9fe0"); + FeedZipHtml(zip_buf, 42025, + "d6bbc3b8fb050bc8b43de9a6e7f9b3c4bf0b12511d874b3a50"); + FeedZipHtml(zip_buf, 42050, + "8906e0e461c2292822ad91bc69af276f020c9cc64ac231fe8b"); + FeedZipHtml(zip_buf, 42075, + "0426fcf79ee60b7ef245327d0a84e4e0092f05505645c41981"); + FeedZipHtml(zip_buf, 42100, + "a68b44385914ae2ae83137a63a1e63d3b04b066639b1cb375b"); + FeedZipHtml(zip_buf, 42125, + "96c3838c414218b8a891499cf95086b1c7930c4b2fd211c92f"); + FeedZipHtml(zip_buf, 42150, + "4ff5aa106bacd8df7b3f15b7c057893f55ae032c8790a69391"); + FeedZipHtml(zip_buf, 42175, + "aa48cda546682b6d7e27a89a91ef25f17d412644fb19d743e6"); + FeedZipHtml(zip_buf, 42200, + "4de07e03bf7b0bc4907188805e882332c26c6ac4f08b470d04"); + FeedZipHtml(zip_buf, 42225, + "d80c439f70b73c91152d9b628c8a125b92981289f198a2ba8a"); + FeedZipHtml(zip_buf, 42250, + "370d326e49bf6284d5418765e86a8d28e591caddf3da6c50b5"); + FeedZipHtml(zip_buf, 42275, + "09183b8ec79321e32c2286bece0e45dec6b2163afc70287810"); + FeedZipHtml(zip_buf, 42300, + "32c5a41302bb820389972c0c52ab06977de56a52aa749ebb7a"); + FeedZipHtml(zip_buf, 42325, + "55011deb682382bfe2706ecae1c08fbd701444292556c0d25c"); + FeedZipHtml(zip_buf, 42350, + "8d542fcbbfe5e814d74fccee5b721f2bc622784651877b3bfd"); + FeedZipHtml(zip_buf, 42375, + "c4c1318eac06e37b29123536cb9b61b38f9a7b6b0364b1ec10"); + FeedZipHtml(zip_buf, 42400, + "a01272bc7e2844620e5bf2d9648695ef4837ca3c02cc810218"); + FeedZipHtml(zip_buf, 42425, + "46ba62e4e575594d2505129987118f42aa72c4cf3df15a47bd"); + FeedZipHtml(zip_buf, 42450, + "27aef2a3b0916ade2a5f0533d864006c4ee328c65f52e865b9"); + FeedZipHtml(zip_buf, 42475, + "f8ae43b1166e08c4ca0220965421adf17de1483bffdc4f1169"); + FeedZipHtml(zip_buf, 42500, + "857b8b9c59a9b6390bb1e16960f0c22d49427ba9c260e3fbc2"); + FeedZipHtml(zip_buf, 42525, + "3178feb99f2206b339e14923f0c20d2642aaa4ae3e6e14ce8f"); + FeedZipHtml(zip_buf, 42550, + "980f890ba565f0121e39f50c38bc41e9990602b34d9eac2f02"); + FeedZipHtml(zip_buf, 42575, + "f45e0b951faa264b05fa27c32c541ff738aab5980528910901"); + FeedZipHtml(zip_buf, 42600, + "45e526a76cb8e72ae1721407976c1f05a062301af986a1d2b4"); + FeedZipHtml(zip_buf, 42625, + "9b9c9d90c86eef81dc19cba213ecf0208b9956108b1e568ad6"); + FeedZipHtml(zip_buf, 42650, + "b339914a28e771eb3c1d1a3a57872c23247bc422a8e93bf68a"); + FeedZipHtml(zip_buf, 42675, + "3e519a2aee838d884ba7ab8bd8eda5a918bc2a1a9b7fb5ada3"); + FeedZipHtml(zip_buf, 42700, + "b49f30532b0d4721209dcc49b44162901b2301f77511395e49"); + FeedZipHtml(zip_buf, 42725, + "988558fbbd17f645d224134aa17a3a4c134703eccb0368340a"); + FeedZipHtml(zip_buf, 42750, + "ff14fd6146fe43389a8c80f882a0d7d61152bfa33146d8d899"); + FeedZipHtml(zip_buf, 42775, + "d1e32746cdf12401a2c5c431387c9c481f9361383a8ea334f8"); + FeedZipHtml(zip_buf, 42800, + "63c2450ca4495018d087817f17b8e809ade59c141e465d9800"); + FeedZipHtml(zip_buf, 42825, + "6805099aaafa732212a5b0f97daa9ffc107427449906c4847f"); + FeedZipHtml(zip_buf, 42850, + "050ed7dae3ba01c39c2f9576a72a1803d161b6acf6b6e57744"); + FeedZipHtml(zip_buf, 42875, + "bfea87dcfe1d4623e340aab637b7634d8f674df8ff5e45feb8"); + FeedZipHtml(zip_buf, 42900, + "9c1fc911a56c810d8a458e1002be50f99a7a17a38b33cdbdae"); + FeedZipHtml(zip_buf, 42925, + "baeb9b147e5eca8eac91e434c6f2992583673acd4689100403"); + FeedZipHtml(zip_buf, 42950, + "f67a019bc2baececb7466a07f8d12174fb332c588d9560f7d8"); + FeedZipHtml(zip_buf, 42975, + "5b9072c122cd29ac0e0fafed2c76264723d39d12b029dd50e6"); + FeedZipHtml(zip_buf, 43000, + "9852497506a42c358d1a6dd453ce15515e80d3ad69cc0f5611"); + FeedZipHtml(zip_buf, 43025, + "52aa7021bcf34c9d3f58354c5f89a5a99c3a92ab33e73cb0ad"); + FeedZipHtml(zip_buf, 43050, + "e053edb6a1cd71616b6057a2d9c6040e3d4497d10873fc11a2"); + FeedZipHtml(zip_buf, 43075, + "29a5eaf6b12b9b9971fe4d33264488b90a4e34dbae0411e437"); + FeedZipHtml(zip_buf, 43100, + "86c2a686a2eacda993f5b19d920ebdc08628b77e1a5899f855"); + FeedZipHtml(zip_buf, 43125, + "1c118181fe2aedd35f029fbbe245e03fafd9df59c6ee72034b"); + FeedZipHtml(zip_buf, 43150, + "b94fafb33f56fd798dbf93776edff10320d2c928727d612f25"); + FeedZipHtml(zip_buf, 43175, + "3b62ed4f8a2956739f3a216f33cfd4904f2f924d6facb54ffa"); + FeedZipHtml(zip_buf, 43200, + "bdb1cf837228924c6602928e028c972886dc8a33336992330c"); + FeedZipHtml(zip_buf, 43225, + "e79fba0d4e308e346364f77b61328523381b15a6d0d8c10b44"); + FeedZipHtml(zip_buf, 43250, + "14ca62a046f9e3909fcf13fd8e0c3e231a95441cbbd9f54523"); + FeedZipHtml(zip_buf, 43275, + "8bfc360b7da3a583ca68dd09b33efb707476f18c381c9676e8"); + FeedZipHtml(zip_buf, 43300, + "e4f894dc546ef33065dc7c6bba6a4b2008c40c6230602fd999"); + FeedZipHtml(zip_buf, 43325, + "3fc9e2914ffa0489bbf8f52ee8c9a70c9bb4c0ce7b9d6707cf"); + FeedZipHtml(zip_buf, 43350, + "08d662ffcefe8e8a89f2ca6d51d3cf2861419170a881e05b66"); + FeedZipHtml(zip_buf, 43375, + "eca682d31640e4b801e9813684fc010aeb52cc37bcccb2d818"); + FeedZipHtml(zip_buf, 43400, + "7a9bcd3263dae9cc07341ccf4d5e38ab030535aa1a53abb29c"); + FeedZipHtml(zip_buf, 43425, + "bb9bdc41009f21bcb587967db25db44ab68bc6977689c9a52d"); + FeedZipHtml(zip_buf, 43450, + "b762c59b9973da7f943775ac02034c5898417e85935a1d6ab4"); + FeedZipHtml(zip_buf, 43475, + "38d52e1132c494ee875e07acc04440894833b26485a01bcac3"); + FeedZipHtml(zip_buf, 43500, + "c1aa627e0f2408557bac20a8efe5375bf1ecbf9665e897f2d8"); + FeedZipHtml(zip_buf, 43525, + "4f3a544a29a01baa78ebad71ad528d020d1f37a0b1df90a93e"); + FeedZipHtml(zip_buf, 43550, + "2d795c0a3851f61a2f665563c0308806dc87aacaf0e2dadf46"); + FeedZipHtml(zip_buf, 43575, + "3d822215713e7b27c5595961368c7440eee92db6474e3c6de8"); + FeedZipHtml(zip_buf, 43600, + "4a4510170ad8f954716565e84edd8f16f68b540418bec95d13"); + FeedZipHtml(zip_buf, 43625, + "415cf78af231b050378a9ac84651a8df6007de1fbc97c25e4b"); + FeedZipHtml(zip_buf, 43650, + "3d7c8743810efa78fa9d60f8d041b1b390d8923c1d59e7bc5b"); + FeedZipHtml(zip_buf, 43675, + "9f628fa5ae424df058341735cba2c9a803a3012cbcdf027329"); + FeedZipHtml(zip_buf, 43700, + "3b1e2359b3e3a1728e45cc3265cf405e2f1a821935d2447c1e"); + FeedZipHtml(zip_buf, 43725, + "ae913b654066b60c5e04b1b50c6b2485f8c474814a5278df23"); + FeedZipHtml(zip_buf, 43750, + "d5e58f74cce130be277b0aa82d85430521698c85eb322516d7"); + FeedZipHtml(zip_buf, 43775, + "49f1d1173a996f85378963d29bc32a2cd9c4266fc83447a070"); + FeedZipHtml(zip_buf, 43800, + "41969fbe59774165a3a8df12c6db28968cd06190eaac483a3e"); + FeedZipHtml(zip_buf, 43825, + "7539a35859a5578ec7c3e28b49863fa94d93fc5283805c50b2"); + FeedZipHtml(zip_buf, 43850, + "1b8f4333b251dca2417af201f1492f9ce2011aab836e025fae"); + FeedZipHtml(zip_buf, 43875, + "76483dcd6b554373d4f275a886badd6a37d5f42ddcb25db7b5"); + FeedZipHtml(zip_buf, 43900, + "1e34e3a3faf40ffa148269381037affb2e59e5152249851356"); + FeedZipHtml(zip_buf, 43925, + "d534df69c73bed78a71d2f483b765abad33251bd42ec72a9c6"); + FeedZipHtml(zip_buf, 43950, + "cd54e29c8ac74e51b145d52e15ddc078d98736d5d0458d023f"); + FeedZipHtml(zip_buf, 43975, + "2a0894664959d59fb4dcb41f9a5ecf7045be8675a9fce63b5b"); + FeedZipHtml(zip_buf, 44000, + "1761511cbb91d2dcaab6b60c996e63f6be1ac96e9b8fbb8df2"); + FeedZipHtml(zip_buf, 44025, + "5d45f44e5e95db05ef6c68f0ce9a1f89d3878a70f0dcc05510"); + FeedZipHtml(zip_buf, 44050, + "760f70a713462e8fa9a66939e82e0cee1ffbbc6cc5b996f136"); + FeedZipHtml(zip_buf, 44075, + "3d8d83cf6cfedf81e869bd81db69e3c01bfd99e2b2e0affacd"); + FeedZipHtml(zip_buf, 44100, + "60f3846c7724add73dcfd65a89f547e81ac0762b63eee5813d"); + FeedZipHtml(zip_buf, 44125, + "7f3191fac7609ad36384791a9f07fc671f34186cb8a0acd9fe"); + FeedZipHtml(zip_buf, 44150, + "9d69c5462098f84880507b968fdd30f6696e111cc693e193e8"); + FeedZipHtml(zip_buf, 44175, + "633102d91b22c24ab6723d8e1ed39675f1776de1c0a711eb0b"); + FeedZipHtml(zip_buf, 44200, + "c832183b33d0ce0cb43c33900b2d8c9e24ca51081822261769"); + FeedZipHtml(zip_buf, 44225, + "5c9ace9c6697afc7c0e4e21408c53c5e8bb22346802b3789fa"); + FeedZipHtml(zip_buf, 44250, + "f4239b58d222bf52bc41322dd15f86783b603b53114f9cdec6"); + FeedZipHtml(zip_buf, 44275, + "93618fb0dbe2be62a766d1559b786451108132b9de2155c7c5"); + FeedZipHtml(zip_buf, 44300, + "37b8ecb4b28bd44ff84e5b9da3b0e70d56eaa26d8b23d06bbe"); + FeedZipHtml(zip_buf, 44325, + "b413a8421ac04bdf5cc41999cf0e99a6ca78bd62f1aef3aa6d"); + FeedZipHtml(zip_buf, 44350, + "b03a26d78f0d6be0c9db7c25249bce7676caedb1533e972a28"); + FeedZipHtml(zip_buf, 44375, + "9574117aa8471604f8aae31d3a2400a13ce8163db23883a392"); + FeedZipHtml(zip_buf, 44400, + "348364929344525851d81f142a6be4e337953147e1f351a526"); + FeedZipHtml(zip_buf, 44425, + "3c24eff83dda2c9af4752ab76435568ed5f0cd5717e636eb6d"); + FeedZipHtml(zip_buf, 44450, + "c5e99667c47d1ac75faabafc75026a1b95e6868663c1ff76b6"); + FeedZipHtml(zip_buf, 44475, + "e36db31d7f5d0fb7067ff96b6d5c51492548277babfd591bb1"); + FeedZipHtml(zip_buf, 44500, + "9962c93b937048b2a9d58c78038c63b24030fca7324b31728a"); + FeedZipHtml(zip_buf, 44525, + "6e7a0aed2888529c845b910ff16f234ab6e926a890bbdaf88a"); + FeedZipHtml(zip_buf, 44550, + "e28c6a1aa9c4504ca82808382d60afc8c6d4754b552aa16c42"); + FeedZipHtml(zip_buf, 44575, + "9b6279d14074a10dc23c8ed219f66ccd87502a1c89462d6c21"); + FeedZipHtml(zip_buf, 44600, + "419ae0cddedf8ad65899ff85ce071ab84f3fccf7cbcd1f491c"); + FeedZipHtml(zip_buf, 44625, + "050d8825e720435efe2043bffb4548e1eeed7b2d78287ca06f"); + FeedZipHtml(zip_buf, 44650, + "1f4b50f426d4a312fe74879d533dd4f2d292b4fc7c1505a1f8"); + FeedZipHtml(zip_buf, 44675, + "d7c60220cff98edb9cd70abe2ee006dc55ec8e81cb48afd91d"); + FeedZipHtml(zip_buf, 44700, + "61944415374c9daa8f454452b576e4acb65049960c6eafc867"); + FeedZipHtml(zip_buf, 44725, + "bd09de4f2fe425d416cd4868dd8518d63d8637c1274a3ee49a"); + FeedZipHtml(zip_buf, 44750, + "a4fd7ed80d31e8fd3b7a993cbc1d2cff689b758475088be6a7"); + FeedZipHtml(zip_buf, 44775, + "930eb651269ddf1f494ee9df01ab24c9e4f2e8c321239ab651"); + FeedZipHtml(zip_buf, 44800, + "4bab293fa6b497dbc9c04037b41c79e3a19fc19eacfed3e2f9"); + FeedZipHtml(zip_buf, 44825, + "a5f0667c3fd482b00cc300e6ee103221b39618850932513a11"); + FeedZipHtml(zip_buf, 44850, + "87c3ee62a398ad3a5e90247152d6f42157c9d27c4d16e78ebc"); + FeedZipHtml(zip_buf, 44875, + "24fe743582fb2ae9155236b294278f40e6eb86497702f24d98"); + FeedZipHtml(zip_buf, 44900, + "4d1f2be42e7c5d1e097cc2df1a91d17c4a94815f971b168c5f"); + FeedZipHtml(zip_buf, 44925, + "9223b5308aa49c846613e63ddeb1019d30ea050f5e8a609529"); + FeedZipHtml(zip_buf, 44950, + "0c70e21c0c091830871ff504fbf2086eae9fe1071c6f57c430"); + FeedZipHtml(zip_buf, 44975, + "6c4d2cc12251a1e80a8a48149a1d958a9b1bc34b9e62fd7cb8"); + FeedZipHtml(zip_buf, 45000, + "69dfbb0579074066eceed91be33728fcf96f5ca6e6e2c409b6"); + FeedZipHtml(zip_buf, 45025, + "70c472ded97d107047eb83e7a685eb39ffb30d0f0b324209ca"); + FeedZipHtml(zip_buf, 45050, + "02743a6f380185ad40c097e06470ca0199e63478e4ece2811c"); + FeedZipHtml(zip_buf, 45075, + "0f8113a090dc0b536253b04bb167049bfd52756f83ee17a709"); + FeedZipHtml(zip_buf, 45100, + "1d2696ec9cf76e64e4e90be13c7ae4dc9866c4ee36d3a4e51b"); + FeedZipHtml(zip_buf, 45125, + "e715e7c86ee1f92b6c531ab4aab747f7de2cfe6e990ced046e"); + FeedZipHtml(zip_buf, 45150, + "18775c5216bf62f096f48e6fca117ae26c959d0f577d2ba45b"); + FeedZipHtml(zip_buf, 45175, + "36bd151afc546fa5aad3eff26fa5b2f9a063d013bb85097668"); + FeedZipHtml(zip_buf, 45200, + "c256af20d4898be81802c8515418818231b66e11cd9d583d92"); + FeedZipHtml(zip_buf, 45225, + "8966bad31ca83a4374b2a2ab87ff92defa496064cdc94630af"); + FeedZipHtml(zip_buf, 45250, + "bc30fb16e6ecb0ce41098670cdb7b2c475979c531428d067a1"); + FeedZipHtml(zip_buf, 45275, + "9f1bcb0cb8bd4b274cd09b844f500aff1eb212a44ea09a110f"); + FeedZipHtml(zip_buf, 45300, + "0192385e24dba133c6d0b0c896844eab7d33efd486850b5cb9"); + FeedZipHtml(zip_buf, 45325, + "080e479c4447b7c2e152f4f24941e54a3caab9269764c35917"); + FeedZipHtml(zip_buf, 45350, + "4154764f740cda11c48e20964110268aad95206a3a563b8755"); + FeedZipHtml(zip_buf, 45375, + "d66e7cbc7768216b3dca15b37e5a2e162c1852412221eeaa98"); + FeedZipHtml(zip_buf, 45400, + "b85cc70f99a6cf24d8acfc80dd1044b9f755335c409642a880"); + FeedZipHtml(zip_buf, 45425, + "8e61b1a07ccb0e0d1d662022388803340f0eb0e85018fda29e"); + FeedZipHtml(zip_buf, 45450, + "a04089eba079f586cd9e1d81499bf0f0d49059a38ee08ba1b2"); + FeedZipHtml(zip_buf, 45475, + "452cb523b21d91d988b4561a3b1e82a4524e5cf4b914d5a3e0"); + FeedZipHtml(zip_buf, 45500, + "7e7f7b64bd2e9e8501970b8596c1d2546fe315610635798af3"); + FeedZipHtml(zip_buf, 45525, + "5d9e4040c340e738e339bcda40b87524d3881e335741d02bbf"); + FeedZipHtml(zip_buf, 45550, + "5863d09c4d47dfcf5f597599ad287deeb9a143892751f8c784"); + FeedZipHtml(zip_buf, 45575, + "5cf42c874ed9cfc65d5984a78c2324a9b056ae8d078edaab6e"); + FeedZipHtml(zip_buf, 45600, + "61299b282ce92e5103a8bd4b39e869b5156d7897dc9fa4f62a"); + FeedZipHtml(zip_buf, 45625, + "71d41aaf122bb1d10ad771f575e606b62afa90b8439a4274ff"); + FeedZipHtml(zip_buf, 45650, + "99b13f9b7cd5aadb81ba09ece16cdd068b4578edb222ad0806"); + FeedZipHtml(zip_buf, 45675, + "89023f4945940a29c246ba046bf21497cfe0c0a95eb1d99f95"); + FeedZipHtml(zip_buf, 45700, + "67f52bd1aecf742d6abd1437857c5c3efdd5f122b257e42cc1"); + FeedZipHtml(zip_buf, 45725, + "2278df286434c10b3daec5c5b9be36acc8159faa450de2f208"); + FeedZipHtml(zip_buf, 45750, + "4184d9ecf841bf5a337e9c8420a676c2c104048aab6080bfaa"); + FeedZipHtml(zip_buf, 45775, + "f1e094fd625996b945a3c0699452301719ba74380ec52014d2"); + FeedZipHtml(zip_buf, 45800, + "d718c8b7184a8782d9906b5e53f1b92408303a016432d92e25"); + FeedZipHtml(zip_buf, 45825, + "9fc2a527e7f0181928c49e58913080d3c89423399dbada61d0"); + FeedZipHtml(zip_buf, 45850, + "cf30932c0694c1f807776135e762a26a5b27e0572cbb8ff785"); + FeedZipHtml(zip_buf, 45875, + "ce98f2a5e944b45b74ceb24e417a503cf445f4052074d2e3bf"); + FeedZipHtml(zip_buf, 45900, + "8a1823da63f0509307146249c26444e06a613656f46d66868e"); + FeedZipHtml(zip_buf, 45925, + "607c211a04d35cd891b20dee91f41be4af0a151c209a549349"); + FeedZipHtml(zip_buf, 45950, + "17b6e387119d94534a0837e38955e25007c1141a9171cc9fae"); + FeedZipHtml(zip_buf, 45975, + "8f28a1b1bce60b9f29dc539dc34d65c6a0e684e5322bd44f84"); + FeedZipHtml(zip_buf, 46000, + "651b41a3409cf087fb237cb46a2d18de26f071d9941c593ae0"); + FeedZipHtml(zip_buf, 46025, + "928852c38bdb27f441996c9f4e8e5105586f1b1de964284f02"); + FeedZipHtml(zip_buf, 46050, + "11b2c10ef609fc5d05b889e80820228c5e3555b9d2caa0a581"); + FeedZipHtml(zip_buf, 46075, + "5e79c8e662bd30d04b84d9c961f254adbe8f2982ba29391673"); + FeedZipHtml(zip_buf, 46100, + "0c839ecc78335a50dbe7e703eb378402c2ac4835af9562d5cc"); + FeedZipHtml(zip_buf, 46125, + "64af40226b502831e494fc10e7b0ffea8056356ce6807bf8db"); + FeedZipHtml(zip_buf, 46150, + "7e69d03d7e2c09bca78af68e98fb8d344118d6b3e081b2c265"); + FeedZipHtml(zip_buf, 46175, + "9ab628d5792d5a88e3c50ec9f890de86631d9523f5184ad7b4"); + FeedZipHtml(zip_buf, 46200, + "32b5f57b887425a284d3ef28c5722cfe25de1d2105f92c0329"); + FeedZipHtml(zip_buf, 46225, + "76742943a7f75566dca2f39e5574f6d2729f7398b2cb7f2ec9"); + FeedZipHtml(zip_buf, 46250, + "7f76dcc426e44037cb54a6b0fcbec40c2381d8e330e27c5e31"); + FeedZipHtml(zip_buf, 46275, + "75ce291654364ae4320472c9a412116317129ebcd540510641"); + FeedZipHtml(zip_buf, 46300, + "f2d4d65904d7cfd0518922e1a99aa15bc3760c7d690c5dc8b1"); + FeedZipHtml(zip_buf, 46325, + "950cdda8facc3c5df7fcdbb1f51d5b7f826c3d67e931387bee"); + FeedZipHtml(zip_buf, 46350, + "cb8eb9e71a079a55f6dc9c5d8fd944b6ee6e3ab8313b6e130b"); + FeedZipHtml(zip_buf, 46375, + "db179e867d8e9e97597691bf1dcefbdc6bf5912945318d5cb1"); + FeedZipHtml(zip_buf, 46400, + "2a0c0fcba5e6e9e789780772d1d65de8936ebb8f6cbca79951"); + FeedZipHtml(zip_buf, 46425, + "bad7e05532f97118514604f38b0cf6d0996440e3bb776bf76e"); + FeedZipHtml(zip_buf, 46450, + "6de0bbb5fd85938cc752c17f15ef2511958ec461af2e8c105b"); + FeedZipHtml(zip_buf, 46475, + "a3fa6e8afc25191471c5696917fcd9a8dc4452b22a2be74039"); + FeedZipHtml(zip_buf, 46500, + "5df7cdd94745cbcf18e8eae6516a0e325e264079c6591cdd57"); + FeedZipHtml(zip_buf, 46525, + "da2ae35eecf3dbb4d8fc94ed8380b5fe600054204cfff04da7"); + FeedZipHtml(zip_buf, 46550, + "67767e872b4f352f2e9c90678439c8a5a5f395883f9b859970"); + FeedZipHtml(zip_buf, 46575, + "a367e4055393e596b133a369a114eb11a9abb6b33415f0b8da"); + FeedZipHtml(zip_buf, 46600, + "a0834bbe9ebcf9c4696d912809c5f9af8e58611b8dc2e82efe"); + FeedZipHtml(zip_buf, 46625, + "1298615ba62d9d2b1fb46c1baf276dbc1b615ad562cdfb200a"); + FeedZipHtml(zip_buf, 46650, + "1278e6ab4a06b8466f80383457b5916a216fcbce5729126ea8"); + FeedZipHtml(zip_buf, 46675, + "44782a1312541c64ea393153d09128b942128af0f5b1108989"); + FeedZipHtml(zip_buf, 46700, + "064539849c9b1cf5ff1d7c97d7d9f3d20c478c407a90520c45"); + FeedZipHtml(zip_buf, 46725, + "366646968119055a2af3d9b5c994b788fd95fe18c4868750b0"); + FeedZipHtml(zip_buf, 46750, + "e7c4ef859354575014ef3f5ce5001eedfd4fc1e40b562e153b"); + FeedZipHtml(zip_buf, 46775, + "ee0a9e3e1cc409dceac8608eeb6213c7f45ce2bfcefd29224f"); + FeedZipHtml(zip_buf, 46800, + "69bca63d7085c443f7876bcedd626123f7de068d40156bda64"); + FeedZipHtml(zip_buf, 46825, + "72e61057d1ad584458531403b616e4d8190b7f3caa8c4be4c7"); + FeedZipHtml(zip_buf, 46850, + "8a5d511e3adca95b3b756ba76e2d5eddca87237498af58c50a"); + FeedZipHtml(zip_buf, 46875, + "04dbe15a05eeca33ba45a428b8292a9f095bcd9f4112cbf6a5"); + FeedZipHtml(zip_buf, 46900, + "5cfc956a4d148c2dbe37898ccbce6121a193a11a20ced3d5c0"); + FeedZipHtml(zip_buf, 46925, + "50ec95faeee8fc8af7d32186839549f70afa844967f0234da7"); + FeedZipHtml(zip_buf, 46950, + "f44b897b42d5048ea0aa2c30076b6b14141bcf5ba894aeb278"); + FeedZipHtml(zip_buf, 46975, + "e45cd7a37f1685598327df1ab6d84773b6377dfdcf1f154f21"); + FeedZipHtml(zip_buf, 47000, + "31138b15e1f3e6cfff0a8e8788664c2d40384840cb7b10ad65"); + FeedZipHtml(zip_buf, 47025, + "16f52aae0b71b9544503d4cd0d2c45de6dc3c36e0c9a4490e9"); + FeedZipHtml(zip_buf, 47050, + "546c2beb288f83ebc8113a25cdadc115e506ce73458ff4fc2c"); + FeedZipHtml(zip_buf, 47075, + "710773aaed1bb8cbb610fdf7c989ba4daa0af0c5713c9e0c59"); + FeedZipHtml(zip_buf, 47100, + "6f319c41b9e29f7e916e1a857aba64ab223c172566a1e021ec"); + FeedZipHtml(zip_buf, 47125, + "ce676a5e5d2d4fecb3d2dceeb49357485a73c89606ae2ce6e0"); + FeedZipHtml(zip_buf, 47150, + "55079247107bec4c84a118d51fd437c4e5f7b8c216f04b2196"); + FeedZipHtml(zip_buf, 47175, + "1a4c149d96d36630589fb0960649f68e6df858beb291e496fb"); + FeedZipHtml(zip_buf, 47200, + "cd62b946bf34dd6fb338414860604d44d427410809b8e4ca87"); + FeedZipHtml(zip_buf, 47225, + "8464a484a331e272aef9e3b9860b8149ddd079be45a1cc6876"); + FeedZipHtml(zip_buf, 47250, + "e1db2552731552f38fc35ea913aefce0c6a9731bf373c74ee2"); + FeedZipHtml(zip_buf, 47275, + "7bed8923ad4a14bf253857f9b5d644471a25fefaac0aa782e7"); + FeedZipHtml(zip_buf, 47300, + "5dc02946a4dbefdfbcf6c95cf3c3b328c8eee3e4cbb33757ff"); + FeedZipHtml(zip_buf, 47325, + "ef5c191052b348a90a5ab8e0a15c1511e770ece7d6c2fb1ee1"); + FeedZipHtml(zip_buf, 47350, + "fd3b312b0cbd95a8ec1a773505edf4a16ed4d9d547efc5f72f"); + FeedZipHtml(zip_buf, 47375, + "fff28ffdef5151160a4addafa4f91a7f328a7b130cf0a9fc85"); + FeedZipHtml(zip_buf, 47400, + "456a5793117609a29fb818d9fb203bf7d34c00e854de65917b"); + FeedZipHtml(zip_buf, 47425, + "950c6c817e959589e7f2df1bc06d8cbca2510c44920438a181"); + FeedZipHtml(zip_buf, 47450, + "bc026965a922441d449bb68840537e4dce14d4bf43c58e9354"); + FeedZipHtml(zip_buf, 47475, + "e0c51a07448be5ef86d4da61e62288afae6f8cef9590dd9ca4"); + FeedZipHtml(zip_buf, 47500, + "3daab36f52a0e098d294637a5f1000060d080d798a15a7a8d2"); + FeedZipHtml(zip_buf, 47525, + "95c88cc3ff4b6e5b4eace3baa1b0513fd5e6dd3e5f0b3b0f04"); + FeedZipHtml(zip_buf, 47550, + "527a1a647b551a56888c2c3419d91edd72f8e6b9fcbb605c04"); + FeedZipHtml(zip_buf, 47575, + "eb7d1e9dcffd9c31add3da69f1eeadcf8dafde54491accd056"); + FeedZipHtml(zip_buf, 47600, + "d111b3693b8f991a3e248d2492e52ed8f66efdf4e6cfb51fbc"); + FeedZipHtml(zip_buf, 47625, + "641f6d346cc6f737dd388cba24016c953607ff79f2f6c3958a"); + FeedZipHtml(zip_buf, 47650, + "476991609a82049b8403d86e8a998c3d4aa025d165187e09f6"); + FeedZipHtml(zip_buf, 47675, + "346b0823a0bf5e90e8966c201206633fc1c925277615fc0780"); + FeedZipHtml(zip_buf, 47700, + "883b919123012d7417f6b0fc30d78d30bc3b06633fa45da793"); + FeedZipHtml(zip_buf, 47725, + "0eac1c46ac89d0a699d02769801e18643f1edbf8f255e4616d"); + FeedZipHtml(zip_buf, 47750, + "71f3bc363c0c0e6dca5ad3ea3009b74c4e164379dc37d843db"); + FeedZipHtml(zip_buf, 47775, + "33f208c99dc15e72738cd61ea97e71437d516e3e097b1a6a52"); + FeedZipHtml(zip_buf, 47800, + "7d55019aded534cd02abe6bb7d165c6bff45838508e1678491"); + FeedZipHtml(zip_buf, 47825, + "5815877d7fe2ed7bbffcfa1b0dedc6f2bad2990e9ba72ec776"); + FeedZipHtml(zip_buf, 47850, + "f45494cf8c7dea7aa82cef5f50e4d004dd3f13742a7d31ff48"); + FeedZipHtml(zip_buf, 47875, + "0f871e8b9fe9cfaaf8bf6c49ead3459ae272cb84817bfb25d9"); + FeedZipHtml(zip_buf, 47900, + "d1ae17aced7abfdac6fb35db737592c4e3d2c7caf8b8242965"); + FeedZipHtml(zip_buf, 47925, + "c1ccea386f994d4548336332f3a42159d34dbfeb9eae108aec"); + FeedZipHtml(zip_buf, 47950, + "ed50767fa4f0b39e6840e44f325400879cb0438638c0ab693c"); + FeedZipHtml(zip_buf, 47975, + "a16839a3932766cc231bbac7381af9bd1793bcb84182ca51af"); + FeedZipHtml(zip_buf, 48000, + "7796a200ca28ee1052ad1165afa2bb7acdc689af1c20dfeb89"); + FeedZipHtml(zip_buf, 48025, + "5223611ab3554a9caee466842346b81a45e08052b4c56f176a"); + FeedZipHtml(zip_buf, 48050, + "70fa00485b732df690b27b899053b9e492ca0b9b53935bca6d"); + FeedZipHtml(zip_buf, 48075, + "49cf4afeaea42f8f0fa22bbb55d57ecab031f408ebd60e8285"); + FeedZipHtml(zip_buf, 48100, + "1b092f8351cd95592366bcb10dbc19edf56a4847cbbf03ee52"); + FeedZipHtml(zip_buf, 48125, + "e478c3988fe1b752b91e7dc4a5e4029a7ee9379da4b9750c10"); + FeedZipHtml(zip_buf, 48150, + "01222b5893cc771fcb3b2cabcd5fcd0c69c245dee8319581c1"); + FeedZipHtml(zip_buf, 48175, + "6911b0ce8bb58794ddef1045b9f9ae6f93888ecbe270712b19"); + FeedZipHtml(zip_buf, 48200, + "c383c1520c7955e59bbb659951fd5666f23a9924f08c521ad5"); + FeedZipHtml(zip_buf, 48225, + "9f67bcc60dbc29c91ee966d606f08be01e5449dc42498565ae"); + FeedZipHtml(zip_buf, 48250, + "066d8e990ff41bc6e344dd62268b964c389e48bd9ab436cc29"); + FeedZipHtml(zip_buf, 48275, + "de435d4cb5ad1662a159674b3e691ef5cf4ec201b6c794d4c6"); + FeedZipHtml(zip_buf, 48300, + "d7d10b86d4f5db2c149b04e3a12f1b54025795dc763eb6ba04"); + FeedZipHtml(zip_buf, 48325, + "01b3578b166acc608716f3a0c528eeb1638ffd77eabd95dfe5"); + FeedZipHtml(zip_buf, 48350, + "ed6e0646001380b7af965198630823667869b749492c43942b"); + FeedZipHtml(zip_buf, 48375, + "6904dc2efeb1141db5578b306acc6087305bc35996802b2861"); + FeedZipHtml(zip_buf, 48400, + "c006dddd85840422be573d332fca04f82f2fb7e605ba853312"); + FeedZipHtml(zip_buf, 48425, + "451335b32518c85fa6f34ae89b4ad96d303af0dec62289da42"); + FeedZipHtml(zip_buf, 48450, + "89b42913612c307045a42ecb75293910a6c6f459b337653f4c"); + FeedZipHtml(zip_buf, 48475, + "d24cfe22c656093361956cf9b32406548954c6f71d52b991ea"); + FeedZipHtml(zip_buf, 48500, + "da7dc36e46436812a0ab4322dba660024a6f302f45e4c153e1"); + FeedZipHtml(zip_buf, 48525, + "c486dc98328cd88edac9761ea076173a62a0e006d8525a0c4e"); + FeedZipHtml(zip_buf, 48550, + "b72abc700885d58d85da6388ee18080e19c912bec9c7c9e938"); + FeedZipHtml(zip_buf, 48575, + "351134970beb5c46f4bbdaeab1e8ba62a796c5989e71eb0ffb"); + FeedZipHtml(zip_buf, 48600, + "aae69a8c1b1108297da0f8289779edca510e7f5d8772b9314f"); + FeedZipHtml(zip_buf, 48625, + "0ce524fc7628d718e5249556a1dc2b4e6ecbb8cdb10100f182"); + FeedZipHtml(zip_buf, 48650, + "0b462cbe11ea856fc8b968424765be15cbae34c89bc36a1a2f"); + FeedZipHtml(zip_buf, 48675, + "4fd8e9480ec8efe91f7b227bd20855a84c49ad279d529b6e6e"); + FeedZipHtml(zip_buf, 48700, + "4c19e928132886cf9c7f7ccba4b3099462a43b50e5038909dc"); + FeedZipHtml(zip_buf, 48725, + "302a96a1d05dab81969f74c22cc1a68a3ae9b18240e49c1407"); + FeedZipHtml(zip_buf, 48750, + "2c0380451f03954a091742f420f00a6f9e3eea2bc7950b09b8"); + FeedZipHtml(zip_buf, 48775, + "4626b0eb276666a5d8c66ac8a394aa75299a050a163fa11b5d"); + FeedZipHtml(zip_buf, 48800, + "6cab2c883337a63244e2e42d07f16f1c3f878d395286298a40"); + FeedZipHtml(zip_buf, 48825, + "54d708284207033175630dc19d5cf747e13646f879a62a0150"); + FeedZipHtml(zip_buf, 48850, + "9a07a29315587befa7e262f87685d84ae801bf92214fccebb9"); + FeedZipHtml(zip_buf, 48875, + "f001edce0e9cc2a8f8bc12ac23e1790f7884c007bceec16b41"); + FeedZipHtml(zip_buf, 48900, + "fcd2e87b40738699d997ee8ccf61125e26cae759146794c1ea"); + FeedZipHtml(zip_buf, 48925, + "2531b529c153cafc8129c0c91f0068cb1fa647a1f07ac52122"); + FeedZipHtml(zip_buf, 48950, + "02314525a1e8315f31a198b0de11ca96114a9357aa9c50de07"); + FeedZipHtml(zip_buf, 48975, + "99d080df4e55018b42ee853de4d141576690f323679fb310d8"); + FeedZipHtml(zip_buf, 49000, + "fa83978db2a8fd5008d120d790ef5cda246402be9f714fba03"); + FeedZipHtml(zip_buf, 49025, + "05350c44c6e0d2ebb2062376a12a20e97814669934a570a603"); + FeedZipHtml(zip_buf, 49050, + "6188dfc5884311998a1ded00299e1f3c778785562468e9fd9b"); + FeedZipHtml(zip_buf, 49075, + "169e471104521695e6eb14caf275fd48269a71fb139177172a"); + FeedZipHtml(zip_buf, 49100, + "cb83d2fe4267be954a3f0aa32f55986f7c5f34dacf3df593c4"); + FeedZipHtml(zip_buf, 49125, + "7932f815da27f273b565c83f77d0d1ea305f08003742a1ada8"); + FeedZipHtml(zip_buf, 49150, + "dc9d1f3573b197d2422f2595d1361e75595fced702921626a5"); + FeedZipHtml(zip_buf, 49175, + "b98a5a63763e6dae6a0b45c86b00b1e92422237fbea2982c9a"); + FeedZipHtml(zip_buf, 49200, + "6d092fae345377ae717ee5e6f562f2075a6cf1b45de1b4fac2"); + FeedZipHtml(zip_buf, 49225, + "69b91bd8b4a26994745055396dd6de0a54652d2836ea5b7185"); + FeedZipHtml(zip_buf, 49250, + "05e47c159dcad5e7d2c8e9e07e7f1bd25358a12cf429574a5c"); + FeedZipHtml(zip_buf, 49275, + "759b72396ce3bb94e37d09a9abbce56d6ed07c3166a6b0b601"); + FeedZipHtml(zip_buf, 49300, + "573b635f6b0e18a9eb6b8da3d6d4d71aefc8d16c965ccde5b7"); + FeedZipHtml(zip_buf, 49325, + "5af68bad6d4fcbaef5d86a4f2b899120fb88eeb43cf78abad3"); + FeedZipHtml(zip_buf, 49350, + "9a8b6d51775acd1f37a739adc28985135c6d73dadca0b98a08"); + FeedZipHtml(zip_buf, 49375, + "349e6715ad69e7a2df0f35bcd8dd9a96d27a17d190b65205d8"); + FeedZipHtml(zip_buf, 49400, + "f5a37d0c01a08c4ae455debeb030ac0c7977dd0b1fdbbd5030"); + FeedZipHtml(zip_buf, 49425, + "ba7cf742c99377cd0b7755c9b7a02ab98a54d8f52e5c2367af"); + FeedZipHtml(zip_buf, 49450, + "eb5d688f597b6b988632d406ed781b1bd5d43c5573b42e54d1"); + FeedZipHtml(zip_buf, 49475, + "51bbce85bb47eb2b7eb4441e478c3591a8e42e5b7b97d45563"); + FeedZipHtml(zip_buf, 49500, + "968619ba7d04b6da83a3fb16516314aaeac7217c3776938ef0"); + FeedZipHtml(zip_buf, 49525, + "cd5efed504360477edbec55df3c35df343b9d1ed6c7e9837d6"); + FeedZipHtml(zip_buf, 49550, + "6c78f3435b2eaa6b7e58367a03e4a985343fdceaf36da34c59"); + FeedZipHtml(zip_buf, 49575, + "d1fc3027b17ff5cd0fb7b326f8fd28ada807fef3872b127ed3"); + FeedZipHtml(zip_buf, 49600, + "7892c05ed75b0e7ca632ddb073d928918a9416f9657e44ab8e"); + FeedZipHtml(zip_buf, 49625, + "f6acfa88f4c354147265eb83813b18f70b22edc88fb8ccb590"); + FeedZipHtml(zip_buf, 49650, + "6b1d20952f7b982042f7c3c12461fbe12cbe660c01937fac7d"); + FeedZipHtml(zip_buf, 49675, + "55f0dc976243ef83ecd81ffb9d7018666119904a06b7bc4932"); + FeedZipHtml(zip_buf, 49700, + "9c45cd9f692e60a8615660b27e0724668c809bc5646cde9b5c"); + FeedZipHtml(zip_buf, 49725, + "1fcb59e24d90f45556f0ae29ace98ffb6ae80ca52311249fa3"); + FeedZipHtml(zip_buf, 49750, + "996ea37478a3fb2805cc67d5dace068daef549966d940a6fc3"); + FeedZipHtml(zip_buf, 49775, + "610f24c63257fa6aa0761564b9f39f81a85d02b392c18fc3ba"); + FeedZipHtml(zip_buf, 49800, + "7258c27229aaccec6e4aa52a748d539baadc919897d33d45b6"); + FeedZipHtml(zip_buf, 49825, + "8301fa42630bd86e5599f69500dec0be0ffeb89663c09816bc"); + FeedZipHtml(zip_buf, 49850, + "ec5957011f207253843b0c19f963c7076ae772e390d2eed02f"); + FeedZipHtml(zip_buf, 49875, + "27725c957406a2db4d0a8aa835f43f3cc7ffc0b33f086e583b"); + FeedZipHtml(zip_buf, 49900, + "cbcd9c66d3020e84e90ddc5504779c386a8db7bdfe301cdff8"); + FeedZipHtml(zip_buf, 49925, + "0f41da40a2ab608a5f3db8f8a7e130e815bfb83796de747d0a"); + FeedZipHtml(zip_buf, 49950, + "da288cc7696eeec31e9a8ef2c529e81b3cbb83dbac417d8ab5"); + FeedZipHtml(zip_buf, 49975, + "dc586356d4f6d4e69adff20a6f54edaefc6a177f8b6d2940e6"); + FeedZipHtml(zip_buf, 50000, + "90dbd8cb1f9320994a55ce5e146e4b985ad082c3b7d611d374"); + FeedZipHtml(zip_buf, 50025, + "1e2772d07d97443c77de5898c488c421f59f2fcf95ad46da6e"); + FeedZipHtml(zip_buf, 50050, + "f45de0c405f181341e38649a792ddd3a9643a3b4a9b5d81a8d"); + FeedZipHtml(zip_buf, 50075, + "b721b0955747eb376da1d0394a64d28b0dd093a0d7754dadf1"); + FeedZipHtml(zip_buf, 50100, + "9d40699abfc53ca20755586cfd84a51ed52b8a361b333284ec"); + FeedZipHtml(zip_buf, 50125, + "35871e3db372469cee0a6bf4741dc6fbce1bdf7c814be693af"); + FeedZipHtml(zip_buf, 50150, + "74c329050532d824391a3f0595338b013f84ef61920a758182"); + FeedZipHtml(zip_buf, 50175, + "30f3f04bbd5670303840dcfbf6c501fcefb7869f14fef2fdc1"); + FeedZipHtml(zip_buf, 50200, + "73fa8bf30e05d9f34eb4992fe53605b32e7ffae9eafde15fbe"); + FeedZipHtml(zip_buf, 50225, + "7ff9376b0bf457f8e3f72fcbf761321adecc87b30fa79cfc27"); + FeedZipHtml(zip_buf, 50250, + "2b67e1105d7f9d1a85952295b129fadd77e368606d8afffafb"); + FeedZipHtml(zip_buf, 50275, + "3818946f8a581cefc6c440e67c0c1b2359c5859c5eab1b4f86"); + FeedZipHtml(zip_buf, 50300, + "3de1e4f95624de5480c162a0bc7438cff1d35bb96e3cf6b15d"); + FeedZipHtml(zip_buf, 50325, + "074a8e7a66d7da8a39ab65ab16106a6c4a3c7d2c99cd6d9c84"); + FeedZipHtml(zip_buf, 50350, + "7fc6641d45f9954328f11f0f0ecfbc382f32fb2ada425f55d9"); + FeedZipHtml(zip_buf, 50375, + "3652e3a0b7b0a27837d02c130e057b839347b1f3c4ea419963"); + FeedZipHtml(zip_buf, 50400, + "79b4539bab8b978917038588f042c432602b8cf08d38a8b179"); + FeedZipHtml(zip_buf, 50425, + "270ae8a7ac6a5738cae3072f78408355ca1d5f60f4387c0886"); + FeedZipHtml(zip_buf, 50450, + "7cf4c76e835fcdda7d88c775391b112f74e515116974fcee97"); + FeedZipHtml(zip_buf, 50475, + "4142ae047ed371f43f8307eff2fd5b4fcc817948a9a75843bf"); + FeedZipHtml(zip_buf, 50500, + "fff7e7cf9f5b7ce1e8eff8bf95148a224128e32a2ad0c6c910"); + FeedZipHtml(zip_buf, 50525, + "84e12c9598c23c55b429448dd38248c9b39b133baaf651fe28"); + FeedZipHtml(zip_buf, 50550, + "9bd45db2fe630c96cbb58194aa95f951ad9985eac75944e8a6"); + FeedZipHtml(zip_buf, 50575, + "37db200250a9b583c831b3836f4946b947db4bf8620ae6125b"); + FeedZipHtml(zip_buf, 50600, + "8895b3d8f2e766dcd9713c9e26921f6b40152f4e0d6c7c7957"); + FeedZipHtml(zip_buf, 50625, + "22c440e4af8a9fe7be54a8bc0097156c00f393ba4194e67fb1"); + FeedZipHtml(zip_buf, 50650, + "578e45458215e8a3b628626a795e64a854db23ee867ea67290"); + FeedZipHtml(zip_buf, 50675, + "3b260f2feb7adb109738b441a6265999696a1117d7ef9ab7af"); + FeedZipHtml(zip_buf, 50700, + "d19809419fe6361ef6309f8d037c94ebdc0cb2e7fed385e802"); + FeedZipHtml(zip_buf, 50725, + "77284731a81e0ec4d0d2a7d17a0326db91430c7b3e09a8a666"); + FeedZipHtml(zip_buf, 50750, + "c88e8a84c0b81c18742326e3d01cf299b6f5131dbe393e7eee"); + FeedZipHtml(zip_buf, 50775, + "bd38782e0539fa8bf7f657ef2ffcb78a07ea1b8e27e0dc1254"); + FeedZipHtml(zip_buf, 50800, + "23c2d41338c24e562ccfc29f192220ddbf208e4159012db337"); + FeedZipHtml(zip_buf, 50825, + "d473fa3bf532c3c400a26ac0bafd178f6d0b6591cd4702761d"); + FeedZipHtml(zip_buf, 50850, + "5b16a3e662ccf319270b96ad45eca5dcccb3581b4f0343dd82"); + FeedZipHtml(zip_buf, 50875, + "8e33a3a568369fd822f6e8b2753de60956be483c33738a7471"); + FeedZipHtml(zip_buf, 50900, + "4f6ec7808088e901bce87ef14a7d0cb43685201a1155c0ce3b"); + FeedZipHtml(zip_buf, 50925, + "18b62ae46ea4d0f1227ca78b719000483311dc57ee211183e6"); + FeedZipHtml(zip_buf, 50950, + "b9f22fc1346fe2275e37a74776c93b213212369259835e4aac"); + FeedZipHtml(zip_buf, 50975, + "a911a7366252f71d9655a6fd2f0c49cb040138ac30a2e877da"); + FeedZipHtml(zip_buf, 51000, + "f7d271d0c5a81078348759b8cfe7175be2e83dc36a030fa94c"); + FeedZipHtml(zip_buf, 51025, + "0cb20d86141caa0d65426f55a62aa7b91157e20d950084461c"); + FeedZipHtml(zip_buf, 51050, + "78a70f3e56774d0fc5efcda3a970193a1cdcc80fa42f8b9db1"); + FeedZipHtml(zip_buf, 51075, + "0e4db1a362351af12d9b209f0b13a4b9b7c7ccf762e1f3bd58"); + FeedZipHtml(zip_buf, 51100, + "e87cdfbbf667e4bd7ee3362c08d46f6056b095794ba2eb62e6"); + FeedZipHtml(zip_buf, 51125, + "189b2901a5fca457c07afbc786d2fadaecd70a2b6106663f8c"); + FeedZipHtml(zip_buf, 51150, + "72e6ff0d320454b2cfc2b01532d066068312e624bba396dcd3"); + FeedZipHtml(zip_buf, 51175, + "5a1fae1346d14ac0db633601ea1ffc2f4129bcc9903f37d56c"); + FeedZipHtml(zip_buf, 51200, + "84187119f4afa63591593c669edb70bb8647614491a91cc6aa"); + FeedZipHtml(zip_buf, 51225, + "ff38cdff51491223ffc1f10bff21ff8b190492ed39d4d2659b"); + FeedZipHtml(zip_buf, 51250, + "428ff105093965328ee53994eeb1c22616e11bc44b51920f5e"); + FeedZipHtml(zip_buf, 51275, + "86fe0700dfdc39c29d375441b1dfa6de5bf412e01fdfc60f5e"); + FeedZipHtml(zip_buf, 51300, + "cbff228a87031e0080caccfef3bece579757e56f73e9ad3d9d"); + FeedZipHtml(zip_buf, 51325, + "47ba8a39e5472d8a9217f424176f670bdee62a785b43d6016c"); + FeedZipHtml(zip_buf, 51350, + "e74b8c1452f20acf4a1f6bbd0036455cb2efecf3e5b9fb0ef2"); + FeedZipHtml(zip_buf, 51375, + "a3e6b9861233585994d3d2df6ab9b506c1f0d29c6ed86d644c"); + FeedZipHtml(zip_buf, 51400, + "01ba2917f46a517cc478cce5630cebf7704ab55fa40d489db7"); + FeedZipHtml(zip_buf, 51425, + "f8be6917bc58403bc30f4be31c8cd60d2dcb1dcebef03d9d79"); + FeedZipHtml(zip_buf, 51450, + "28ccc57010765f2ff2e1b39eb76e0cbb3372552a972650943f"); + FeedZipHtml(zip_buf, 51475, + "1d7479c66db948ca2c1a2ea80a1ffbb9a8c9704b37a02ae7e8"); + FeedZipHtml(zip_buf, 51500, + "1550d743ee4f6d6f5a18c4b06c4c8773d39fbeb6af17266d99"); + FeedZipHtml(zip_buf, 51525, + "017bd30542280bdd9d8f655981125f25ebaae4581653121c69"); + FeedZipHtml(zip_buf, 51550, + "1ca7a1eabc238a358adc6f359788a6a3c89aa07798fbd88de3"); + FeedZipHtml(zip_buf, 51575, + "a41752592eeeca88f7d77adef69eefd18d86f9a472b9a9f0cd"); + FeedZipHtml(zip_buf, 51600, + "643c867ba0ca7d203144121971fe5f3cff214cb9f6978f6eca"); + FeedZipHtml(zip_buf, 51625, + "41cce6807b103cd8af4a3e551efd6bfde84e9c65f108b49d15"); + FeedZipHtml(zip_buf, 51650, + "71f2ca9bb048a04a678105c3d1646454dd5379ee3ed63280f5"); + FeedZipHtml(zip_buf, 51675, + "f0972f18d2a86f083bb6ad716cc2cbf1d83c4774480fc36e45"); + FeedZipHtml(zip_buf, 51700, + "aea3e5d7dea24c47a965e1fecfb5fbde7e461d835a32e4423c"); + FeedZipHtml(zip_buf, 51725, + "09d5e1edeae6679ba9ed2d2a74debc1e66909a39cac8726317"); + FeedZipHtml(zip_buf, 51750, + "ac42174abdf85e061bf1b8ee4659395931cf77c21f6016b99f"); + FeedZipHtml(zip_buf, 51775, + "8822f71341c4ba26880c76a0aa07a21c461a0cfbfb4285f7ee"); + FeedZipHtml(zip_buf, 51800, + "6f8328dfb5f8e4ad74c798de18e19cf82cb57f0692e96ee001"); + FeedZipHtml(zip_buf, 51825, + "9f92780c3c35c36e67fbde0510d3bb24084a479fc0a04ff092"); + FeedZipHtml(zip_buf, 51850, + "865def24c6d4eab291466086fb3346697c5f37e02f3503f6af"); + FeedZipHtml(zip_buf, 51875, + "8e6a27c1310de6d9bf386e32150e73cc66386f4c2b4b55988c"); + FeedZipHtml(zip_buf, 51900, + "7ce447fed40beee08f132e58c23573500746a181cac01a6912"); + FeedZipHtml(zip_buf, 51925, + "0245be85272d1860fb9b201971023076840d85eb5a6d61ad76"); + FeedZipHtml(zip_buf, 51950, + "1e6dbda9e42bce61b371968601980ba07f2e25643424308297"); + FeedZipHtml(zip_buf, 51975, + "0a34bfc26b28bf85cb00cf52c3d973435a5e3cecb93831309c"); + FeedZipHtml(zip_buf, 52000, + "c75d082fd5f032e4261677117266790e1da486c1d672ce6983"); + FeedZipHtml(zip_buf, 52025, + "4945c95a3432c19e44455a7c0aa8a8449660d9894d21c4ab20"); + FeedZipHtml(zip_buf, 52050, + "332ef773e26ad46d0f412570490fb22b52b724007d6df42a67"); + FeedZipHtml(zip_buf, 52075, + "973cda21046c377b7eac28ecf7eeb0224aef19682b6937180e"); + FeedZipHtml(zip_buf, 52100, + "fd2888277052f177cf1291b74812a6d616255531f5b7566951"); + FeedZipHtml(zip_buf, 52125, + "202afc76e32aeec3e5a99c9f68058abef4bbb2e772c36c6273"); + FeedZipHtml(zip_buf, 52150, + "4fabdd545b8835372fac1ffe0b3e1c1c1c189f9f5bdfff3d13"); + FeedZipHtml(zip_buf, 52175, + "b3309a74706f06aee7f67f31dc798f8a27b3c22fda355299ca"); + FeedZipHtml(zip_buf, 52200, + "62ebc34371985b652050697786e4256d04340b1558865dfa59"); + FeedZipHtml(zip_buf, 52225, + "2652c042ac3ed7f63a93acd05f111b3e92b44ecbd8bd1fad59"); + FeedZipHtml(zip_buf, 52250, + "29e13609110361b203c5cd90dd7c4097461627534dbb876e9e"); + FeedZipHtml(zip_buf, 52275, + "67d4b104a27766d3f2315fe516943a85fe496a64264a71dee3"); + FeedZipHtml(zip_buf, 52300, + "c91decd0c0235adacc7a342fa2f84b13cf0a3f2ddc57f1f706"); + FeedZipHtml(zip_buf, 52325, + "1eb2350437dc317ce41400925285782a0dca33dfdfc6147b1a"); + FeedZipHtml(zip_buf, 52350, + "70411cefd64f25ffcee2912c118871aa91ac9fa78a638fe228"); + FeedZipHtml(zip_buf, 52375, + "1ee23fbac4ccac1dd8fc5bff13fee3635ed64f0f71326145c1"); + FeedZipHtml(zip_buf, 52400, + "20f2e7c018132c0faf82625dd88895ada421e5c0a3a6ad6a3c"); + FeedZipHtml(zip_buf, 52425, + "a88725a8717848f5c1fa7112004fdfff124cd3c3c35ca8993d"); + FeedZipHtml(zip_buf, 52450, + "14b4d8019061c530cc0000b906d87af9187f3c0ea25ef977ae"); + FeedZipHtml(zip_buf, 52475, + "0729becbf65737b2d8a9eb175d3fcd5e5224a4fa956c337ec3"); + FeedZipHtml(zip_buf, 52500, + "3fb77f99bf0aa5902956997b5df92165ae623acdf78cc7b54d"); + FeedZipHtml(zip_buf, 52525, + "c220d5f21721466a3c6601a8e1e2813eb0cc548f8cfd67f332"); + FeedZipHtml(zip_buf, 52550, + "f1f75ed983941fb241ef52716b4ff0793a222b1088ffbd2009"); + FeedZipHtml(zip_buf, 52575, + "efd85b1d536a8df12e73553bae0c2b6df65c074f2201e79ba8"); + FeedZipHtml(zip_buf, 52600, + "a2a4de08b81a8cd446236af988a9b1bdb02f1dde646de61279"); + FeedZipHtml(zip_buf, 52625, + "54be320d50c404344d425f368cf91d351bd134b950e8bc1b63"); + FeedZipHtml(zip_buf, 52650, + "306f86b62bff2e0ee5f3814f2ba13d3627e618638e69c022be"); + FeedZipHtml(zip_buf, 52675, + "7413b2c4f2d65216e6099c4cc643acc0175cc6f78e6888e298"); + FeedZipHtml(zip_buf, 52700, + "96377ba789a22843290ae275e22e9ff8baa967912a2c4b1350"); + FeedZipHtml(zip_buf, 52725, + "4f2e8f5791029d2080f03f3d5182905e3a8535b4aa7807d1d7"); + FeedZipHtml(zip_buf, 52750, + "84f9a5cc2953002e3260321a02d83f0989e0c740166dde3b28"); + FeedZipHtml(zip_buf, 52775, + "bf5157e71d7b6b5ca195d07591f774198ce2bba0e6a21c831a"); + FeedZipHtml(zip_buf, 52800, + "de943c6bc319da5e8edbcc1ba227608b8bd21de5612963881c"); + FeedZipHtml(zip_buf, 52825, + "e821b2f1f01eb9fda097c27fa388d3652f6037b09986e1d3a1"); + FeedZipHtml(zip_buf, 52850, + "7d9a06c8bc4c85fdc593115694a6e20e11b792425106e59f6b"); + FeedZipHtml(zip_buf, 52875, + "e3f03a0fc1aa924bab8204c66934a2d2010b781cd7286366c3"); + FeedZipHtml(zip_buf, 52900, + "be28de8c070fd17349aeabb007b88c7ccd6402b32266802cad"); + FeedZipHtml(zip_buf, 52925, + "47a05c38429e0eb9b66f32d5f5b18b18e91ad582659ccf18ca"); + FeedZipHtml(zip_buf, 52950, + "34429e29be7dae5fd032f86dfcc5f10312986eb8455f13dcdf"); + FeedZipHtml(zip_buf, 52975, + "b8bdce4a65db791021beac4c81660980fd45ac8d19aa582f14"); + FeedZipHtml(zip_buf, 53000, + "4db70a9a24a97c7ae4819645588ec8ecfaed49c2edd8427ab6"); + FeedZipHtml(zip_buf, 53025, + "318116b44d96500250a249a0e0dada520d55ae8e405d9faadf"); + FeedZipHtml(zip_buf, 53050, + "cdbd08d2987f9b8514fa87f580715b1f3e9f5f9fed63de2e1d"); + FeedZipHtml(zip_buf, 53075, + "41951d0f75f5754ff79015d6015d383c05c623ba5a8ce041a4"); + FeedZipHtml(zip_buf, 53100, + "957a94660db21cb18e128334a1803409aace0bac5262f4858c"); + FeedZipHtml(zip_buf, 53125, + "f11000321edab6f4e09b185333932f853a81ab467309eb0684"); + FeedZipHtml(zip_buf, 53150, + "13ea1e84299a22cd30cb91ca137b7f06492c3a6d70b5687a5f"); + FeedZipHtml(zip_buf, 53175, + "ee41adbdd560c3a18282f68d760e23d1e0b92dc4cc781090c0"); + FeedZipHtml(zip_buf, 53200, + "a68ae9b3d20f0cd89228b86b850e6e318bbe5bde4feec8102a"); + FeedZipHtml(zip_buf, 53225, + "b086aa0db40da4f04daee2bfbc5ef14486069a86224d3c6fbe"); + FeedZipHtml(zip_buf, 53250, + "58cf6bb884f7d0a5e3aedbe850a3de97fbbe29e6291eed4b8d"); + FeedZipHtml(zip_buf, 53275, + "5ebed15180c54b118bb891449b768980328024e245a4a9cd61"); + FeedZipHtml(zip_buf, 53300, + "b07298113a96b1ddaef24f6155cc608ee177d731f5b9f05ad6"); + FeedZipHtml(zip_buf, 53325, + "83b167304d40bffcaa47249fc89636e4820853d5e040025360"); + FeedZipHtml(zip_buf, 53350, + "83a8ed40482045755dd77cc8515dc098ba7ed2b34a30d49837"); + FeedZipHtml(zip_buf, 53375, + "5c9211099761940689658e3419c9c205a693241e97779932bf"); + FeedZipHtml(zip_buf, 53400, + "ce28b3d7fd745e31c29eb7cc60f188ad369f72b1fa86a1ec4b"); + FeedZipHtml(zip_buf, 53425, + "d543b37fb607b40029af442f939fc2e07e8fed0af0260e273d"); + FeedZipHtml(zip_buf, 53450, + "a93a4a6621479ee19bc2f211cce5638814a72aa3211670bb9b"); + FeedZipHtml(zip_buf, 53475, + "8a0eba8289a0232efcf23569294b328830adf2b28b23d8b311"); + FeedZipHtml(zip_buf, 53500, + "86b25dfdf353915ad5a796d747d6e4a81fe2c0e1eead9fa038"); + FeedZipHtml(zip_buf, 53525, + "d3905816b7088ad169526c568e1f68298c482c5304f0c7e32f"); + FeedZipHtml(zip_buf, 53550, + "655f941d9aeac6e4bf76e320e9062f4ff20bab4579d04886d0"); + FeedZipHtml(zip_buf, 53575, + "e686d1be99b66e547b8ffc000c40bb61f779f52a4384e00df5"); + FeedZipHtml(zip_buf, 53600, + "09cbef93fdef3706a13a160284efc469a1cdf0bf9dffbba716"); + FeedZipHtml(zip_buf, 53625, + "9f91398574eb5cec4812f3ad3f460c50ade7149913b3ca4922"); + FeedZipHtml(zip_buf, 53650, + "b3f9cf2466b15db693c22d53e8b068bc7a874571413005666b"); + FeedZipHtml(zip_buf, 53675, + "bad47047016da9158f4266113e87a11fa4b7630e1ce67f7083"); + FeedZipHtml(zip_buf, 53700, + "392ea572d0ebf4e99fe9a40f6c7fcf21a5b8bd628ce8ac10b8"); + FeedZipHtml(zip_buf, 53725, + "da468aba4f8cfaf46b0a06877f03ff032602f247cc6cbb07cc"); + FeedZipHtml(zip_buf, 53750, + "d56846f2f69d370a502ab02a297dbe7eb7ff7763dfc79f5ebc"); + FeedZipHtml(zip_buf, 53775, + "fcebcb6a1f8bdbdde5063ad222ed12533a3decc1c66cee152e"); + FeedZipHtml(zip_buf, 53800, + "b6cfe1c39da964c28e931ab4aa6185b891a62024ea1aabb976"); + FeedZipHtml(zip_buf, 53825, + "7434bf6e7856b78aa27aeb3e7c829a600746d55ba18698da4f"); + FeedZipHtml(zip_buf, 53850, + "028f34b563410ab8b83e7d7f7ae91d7dbefe7876717c79fae1"); + FeedZipHtml(zip_buf, 53875, + "f4e25a93e9379f7ed49dc0449fb25a1028c623223e541d10a2"); + FeedZipHtml(zip_buf, 53900, + "395c4961e22758f4fa7f7efb9f0ffff3db07f5c7f3b38bd3ab"); + FeedZipHtml(zip_buf, 53925, + "ebcbb38bf7e617a99de18fce7f7dfff122ff3352b86798d0f8"); + FeedZipHtml(zip_buf, 53950, + "4d7e3ed964d038abb97517920b96cae90f2c0679fda13f38c4"); + FeedZipHtml(zip_buf, 53975, + "168832fe06582e3fe774e5cfebef5a33e1c2c4af4c0e6d341d"); + FeedZipHtml(zip_buf, 54000, + "9a6d018b8f3b361f8e46410f2bc9a1ea3509874cae4a0823d9"); + FeedZipHtml(zip_buf, 54025, + "6ac625f5cbe05a0f79289c8a63d501a3f909012e301e62bc1a"); + FeedZipHtml(zip_buf, 54050, + "8635f37287aee57821164b7c7a2efe7b320c61f6139f28cbc5"); + FeedZipHtml(zip_buf, 54075, + "dbcc27a880b1c55e4be71f7f3ebd34b810fdfbf808c525ecd3"); + FeedZipHtml(zip_buf, 54100, + "a65d1a1e8711ea467ad11d2b368008d43d9ddebc96c42f162f"); + FeedZipHtml(zip_buf, 54125, + "1da9dbc0f83e7db296a47fcfba24e591744bda7b5e1d7d3835"); + FeedZipHtml(zip_buf, 54150, + "16c07f36989f92528c067ec5f4ed62b85afe49afc1391a8fb8"); + FeedZipHtml(zip_buf, 54175, + "c0e94857f0bb098b0206d23560cd424a70ac26e5078c89a450"); + FeedZipHtml(zip_buf, 54200, + "0cd2360f5df3b6bd693c21e39121718f81bb2b54e435412cc7"); + FeedZipHtml(zip_buf, 54225, + "818043f8cadd838a724b7e10d496c5fc07734404b85466964b"); + FeedZipHtml(zip_buf, 54250, + "1eeb4dc0d5f21d27ec4684de7d301c4aa308681666f01c46af"); + FeedZipHtml(zip_buf, 54275, + "f0ee7a719cb04101c58e718cc508904da441779284191a3fd3"); + FeedZipHtml(zip_buf, 54300, + "4990ca468f9354c72521087b618a1285f9c430bbed38f677aa"); + FeedZipHtml(zip_buf, 54325, + "af40d541812d04d15d98c4d188eb4472956304c9d5a7a3ebb3"); + FeedZipHtml(zip_buf, 54350, + "a3f3b3ebd39babd3e3cf9767d7bffe80c2d443a04c9c52ce12"); + FeedZipHtml(zip_buf, 54375, + "769b90ab3d02a2f500d6d869b8df67830ab6ba8a58f631bb32"); + FeedZipHtml(zip_buf, 54400, + "5678651e4a7516f5c96d2328f70394281f336a33ab58be0d72"); + FeedZipHtml(zip_buf, 54425, + "3a4d9457466807955ac0bfe7f125888ed005891c59555e8027"); + FeedZipHtml(zip_buf, 54450, + "71b9441eac177a65d3bfa6b2a0982227ff397ebd69f2ff4a65"); + FeedZipHtml(zip_buf, 54475, + "f8eaa4148549926c41cced4f869c78c417c2494f4618b576b8"); + FeedZipHtml(zip_buf, 54500, + "11ebe1558413202f9f9204e9101d0d9995c445e3105af22c95"); + FeedZipHtml(zip_buf, 54525, + "0e732246ab70b43dcfb19f9df4b118e9638e8755f5f3dc3dac"); + FeedZipHtml(zip_buf, 54550, + "1bfcb0b2310e784d9931103e2ddf18b88845caed79b6c1acdc"); + FeedZipHtml(zip_buf, 54575, + "ae56fb90cef1943acc5ec8d837cbec853b6a691f808815df44"); + FeedZipHtml(zip_buf, 54600, + "abd64acd591b6d27da1901bed66778a7ee3ef95799954ae7ab"); + FeedZipHtml(zip_buf, 54625, + "ac3eb9f5cd19b4ca9ae76e695aa37cff96a134aef8fd5bcd1b"); + FeedZipHtml(zip_buf, 54650, + "b653823688fbee94a0a7ca6e7ffce0a82ba73e959af766b0ee"); + FeedZipHtml(zip_buf, 54675, + "d59a1117b40ea94249d00d658f5f634565326456e28e7ee805"); + FeedZipHtml(zip_buf, 54700, + "693709c7322ae9b14a50d397018e5ffa32183a9025b53bca12"); + FeedZipHtml(zip_buf, 54725, + "cff7823cd2eef8b817489ebcce01a475973a20a8fbe74318c9"); + FeedZipHtml(zip_buf, 54750, + "135d5050b0d6db20ccd21c3cc819f4f70a6790aaada191c70d"); + FeedZipHtml(zip_buf, 54775, + "e86f53c96e4504381e164f49dcd735a58173f3cd6c4c90eeb8"); + FeedZipHtml(zip_buf, 54800, + "f8d7cac58144fffb0a8dcb6e4e2e3eaf849b2f702d64cac516"); + FeedZipHtml(zip_buf, 54825, + "ec8a979731fbe5b26b71beaf94659ba75f1cdb36bafac828fd"); + FeedZipHtml(zip_buf, 54850, + "948479d9781a83e67122a376b6da09fd367da58a368a445190"); + FeedZipHtml(zip_buf, 54875, + "6a75ec4f0493e9e89db797eabf31e1e3ea16607c7c79650e70"); + FeedZipHtml(zip_buf, 54900, + "fe1dff781e4703f13731bd70e6f06f8ccf2ea02fe77ddaf1fa"); + FeedZipHtml(zip_buf, 54925, + "af83d7b3dbe097f3ab32b7057c9ac1a350eba0986d3a64c9f7"); + FeedZipHtml(zip_buf, 54950, + "71f225bd0d82cc1de16bfb24fa61926637c3300a6ea8736ec1"); + FeedZipHtml(zip_buf, 54975, + "35b128df433ac60a59b42ff641605dd70f613789d318f4e083"); + FeedZipHtml(zip_buf, 55000, + "8761ea4916848d1337c64591dff8829c118f710fe46e58d4ac"); + FeedZipHtml(zip_buf, 55025, + "e152c777e4ddc17bc2e29e88e4829a3298158ea07e2bdd0664"); + FeedZipHtml(zip_buf, 55050, + "4721ef027786a38f4ee3fc81d3ec95c31f874f80ca90e2380f"); + FeedZipHtml(zip_buf, 55075, + "c749f0e88d08693ab5cd24155e820a30eeecd24f99edfefcae"); + FeedZipHtml(zip_buf, 55100, + "94edc227cd276fe264a6d6b4b3b3e5c52ed7d4839cdefbba4d"); + FeedZipHtml(zip_buf, 55125, + "6ede813cf607c14d1afe59c8a7a84dfaf8f7237dcc94974599"); + FeedZipHtml(zip_buf, 55150, + "bfbe0780a17fa7f124e92e865f0bf0cec6b6711fccae554ee6"); + FeedZipHtml(zip_buf, 55175, + "91965c87535963d15118127f4a8530ba2e669fab976f727cfc"); + FeedZipHtml(zip_buf, 55200, + "e130df437b4d6f44990b19f7b87617b2c263c76b81dfc68633"); + FeedZipHtml(zip_buf, 55225, + "e4175a47646effcaff7868fc3e287048e2a015b111c13db358"); + FeedZipHtml(zip_buf, 55250, + "556f1e53e2a91800420887f7640a30ea35b84c140c08796835"); + FeedZipHtml(zip_buf, 55275, + "f98090e28169f0f4d7b0cfab620c712f8ebea5320041c4bddc"); + FeedZipHtml(zip_buf, 55300, + "91f361a504b100d660c21f37494f5961acffee45fd9a5ed493"); + FeedZipHtml(zip_buf, 55325, + "5fcae3af7ec985465d514dfabaf7f19bfa5f97644fb63d2ef4"); + FeedZipHtml(zip_buf, 55350, + "57f8b3d11dc4781b650b97b8977f60c97e01d4820be69b2c12"); + FeedZipHtml(zip_buf, 55375, + "c7bd716649973cd80b8abdfae59d788f909ef28843c8fd2847"); + FeedZipHtml(zip_buf, 55400, + "b29abec83b1e9b1bc7b7e2e03a8470547880139d613e718378"); + FeedZipHtml(zip_buf, 55425, + "29ecfe6cc69ef50de7237870022bef0c13b594abf5fb9392b0"); + FeedZipHtml(zip_buf, 55450, + "5dde4071aa93b3ab6b78c1ae8d393e9cfd725a368d8549aef9"); + FeedZipHtml(zip_buf, 55475, + "2e3e5e9caaad9d9f5dfc786a6eeff385fe53994c70a3abad62"); + FeedZipHtml(zip_buf, 55500, + "590d819954ea85c899b421ba2be6a0f4ca00b8e5482076c919"); + FeedZipHtml(zip_buf, 55525, + "6aa59543431010b5bd10716890100724f33eb456bc37b11afe"); + FeedZipHtml(zip_buf, 55550, + "937ea12ab3e5ac60fc9f2bc8525fe4d3b20dcfcbd63e31a81b"); + FeedZipHtml(zip_buf, 55575, + "9c8449c54b2346b4b0f4c90d31b8391e9cba49be9a7767a8df"); + FeedZipHtml(zip_buf, 55600, + "1b59b24a551ee6aa4627546106b4b0daf748c2b2f97be48bfa"); + FeedZipHtml(zip_buf, 55625, + "357132353da5b82b21d3ff9f83de034738f1166dd6b37bc376"); + FeedZipHtml(zip_buf, 55650, + "6fd8ee0ddbbd61eb79c3bef9c6e9dd772a4aea538b4a3502db"); + FeedZipHtml(zip_buf, 55675, + "cbbd38ed3215081e8b3f8637d872705af8c2f80eccfdc6f9c3"); + FeedZipHtml(zip_buf, 55700, + "0248a513da3d7ce8778261f9678ae6e7168d332c49bf4ae2cc"); + FeedZipHtml(zip_buf, 55725, + "974133eedfd1ce00021897fa3a5728a3267a60eed8015196bf"); + FeedZipHtml(zip_buf, 55750, + "99be65949b24a7143d6521178f4ce2e150f5ce14d7cb8f2097"); + FeedZipHtml(zip_buf, 55775, + "5a34153517db95f7ab705495c92232c47c78aa8928285d5201"); + FeedZipHtml(zip_buf, 55800, + "194f83ac3ee2d846135ca5ad922c0b7fb5b140fdd975fbb45f"); + FeedZipHtml(zip_buf, 55825, + "5e499cd47ddb348e2a2772bc008719dbf654e046a653073991"); + FeedZipHtml(zip_buf, 55850, + "5967124602b380d3f2728ae531cc6d08a2bf307f0af166b94f"); + FeedZipHtml(zip_buf, 55875, + "a1ad8665fb0fdf38eb141adcd8157a6d2035a34337a304171f"); + FeedZipHtml(zip_buf, 55900, + "4f2b0c759efc0ee7d56e38ae8b89cc35c3e08a5bff2e1f63e2"); + FeedZipHtml(zip_buf, 55925, + "b5d486aa76519a616bc73688388e2e2d260d9eb0493bd28136"); + FeedZipHtml(zip_buf, 55950, + "893d0115e7c4879bdb9e4668afe4608e4359b24cd570f4ccba"); + FeedZipHtml(zip_buf, 55975, + "665cb2ecfb0231acf631ddbd8aab7a15afae6f8e275824a3b5"); + FeedZipHtml(zip_buf, 56000, + "577c17f547ae91bb6f1526b49e08feae5c628e6fb22e51e173"); + FeedZipHtml(zip_buf, 56025, + "67e8f782f2a995e78cc7b997e06fb844e113bf0baedf593eb9"); + FeedZipHtml(zip_buf, 56050, + "8a3a8af839f147fbc0e7c7fb583617fb09e7c6cce5776332c7"); + FeedZipHtml(zip_buf, 56075, + "6beb4ec891efc3758ee3613ca05afd580f05f3e7b151833f55"); + FeedZipHtml(zip_buf, 56100, + "4f226ae454b1583c31842693945d05f0f12dc2c2fa2812f160"); + FeedZipHtml(zip_buf, 56125, + "fea413c241f91260a1e940955314e3f7b4a30d2183854a716f"); + FeedZipHtml(zip_buf, 56150, + "7d38b3ec42212a8f62f9e09eeca624ebc6c2f21ff91d36d667"); + FeedZipHtml(zip_buf, 56175, + "d242591d561d111bd8efde86c39ed03de198b7e138d5d23d4c"); + FeedZipHtml(zip_buf, 56200, + "df9f200b17a5ec99fa52ffcef027993e2ee66cfc548836a9ea"); + FeedZipHtml(zip_buf, 56225, + "0468584dfc2e684a7ef70b5f0f6ccf7c56085ef487b11f02ab"); + FeedZipHtml(zip_buf, 56250, + "00cd1ad7e98409163016a5a5858a22e190835234b5a0640147"); + FeedZipHtml(zip_buf, 56275, + "ec370f1658ce78abfaf07f497b9d6469d80b885ff23dde8766"); + FeedZipHtml(zip_buf, 56300, + "ad58923e22fc1d3f1aa6c641e3732dbdab04260b16525cd1bc"); + FeedZipHtml(zip_buf, 56325, + "cfec65072fcd90dacde28206e4951c45f283316ab6220e6df7"); + FeedZipHtml(zip_buf, 56350, + "3ef3651d74bd307b3abb06842e0da12b574fc74139c33ecbb4"); + FeedZipHtml(zip_buf, 56375, + "f81046b2794a6634fb129dc6e1ec1f8ece283298e0d5a1901b"); + FeedZipHtml(zip_buf, 56400, + "6a2eaddf373452887660dec95b8dfec48f87ba0570a853ba5e"); + FeedZipHtml(zip_buf, 56425, + "8ba659fb56cfae12a0c8b1da112da43b9bcbf217a396273ee5"); + FeedZipHtml(zip_buf, 56450, + "35d8a0096109d85052b1632b6f2bf76255de96f16a99b7a51f"); + FeedZipHtml(zip_buf, 56475, + "2cd76d951dbe58183dcb137281a9e9ca2b42cabff545dd77ea"); + FeedZipHtml(zip_buf, 56500, + "2fa45bc3e0db7879c63623e2a8cdb086199b8536aad83fe34e"); + FeedZipHtml(zip_buf, 56525, + "a1bb9deb6aca0f8deb08eea970c4ec10201f094f15c8471890"); + FeedZipHtml(zip_buf, 56550, + "7151e0a0d4443489b005ca0aefa6d248b99ddb7990655caa8a"); + FeedZipHtml(zip_buf, 56575, + "d5096c3711bde5d73daaa085a421ea983aac01b0d6ea3db057"); + FeedZipHtml(zip_buf, 56600, + "229ddb01246f158a38598c8d8cb94faaef9422b761007a0650"); + FeedZipHtml(zip_buf, 56625, + "3b49a20ab47e6abe42827c2296402928b1941873c0162d11f3"); + FeedZipHtml(zip_buf, 56650, + "4a12cb0e696c9f435e62919e1eb37b23cae82c7f047f3ca636"); + FeedZipHtml(zip_buf, 56675, + "e8a84ae5720218ebe471f0e68402a0ea50f7b82724f5e3118d"); + FeedZipHtml(zip_buf, 56700, + "9d72114b249e8a6da5dc934b194673cbb59979dd83e8c8be69"); + FeedZipHtml(zip_buf, 56725, + "6a1a1647dae6e8c3a70220575e44db5b44016d52280b9a73dd"); + FeedZipHtml(zip_buf, 56750, + "59485cd7d2bae33cd92d47d82622e2860d0c6856c6d78c5b98"); + FeedZipHtml(zip_buf, 56775, + "b1855b9c1a4b21a6f21930b42be3f432680ad0fff2e8833c36"); + FeedZipHtml(zip_buf, 56800, + "ef7a51872f55c42bdafbb65d3d81db56f7607ceda4fe2d69ea"); + FeedZipHtml(zip_buf, 56825, + "a5fc38866b2495597c277d82aa7de59b03a82060de22e59d24"); + FeedZipHtml(zip_buf, 56850, + "de083b8dbcc6061cbc315d2b9582c42dfd34afa0be0f32d641"); + FeedZipHtml(zip_buf, 56875, + "3fc0ca70952e3db5300617c36e75a6cf51eb7db55db75448d4"); + FeedZipHtml(zip_buf, 56900, + "284ec995047a1a221620ca208ab1f8a537e295588ec74a6fea"); + FeedZipHtml(zip_buf, 56925, + "91c969d49aa5547a07d88f421d71c4d41e37eb42a4a00e1069"); + FeedZipHtml(zip_buf, 56950, + "1d9854edb9d307d4194b00951fe5dd819e034a08b74671d97f"); + FeedZipHtml(zip_buf, 56975, + "05fc4cab6f3904612bc509a521c31422856035e526ba9c1e26"); + FeedZipHtml(zip_buf, 57000, + "a229618e9f780e51afd1100909ad8e22ef1494a0613c0e7222"); + FeedZipHtml(zip_buf, 57025, + "81095267cf5bbc2009816f81c010ed1912b8d0ab4617452d0e"); + FeedZipHtml(zip_buf, 57050, + "92046549eca886f490a3381626ecfe1d034f1c8aceba576594"); + FeedZipHtml(zip_buf, 57075, + "394bcfe3fba3abe3b333d7251a5fd9809fd25dd57bda4b2fed"); + FeedZipHtml(zip_buf, 57100, + "2ca2fef4949c07cb8b9212707a2a421168e3712ae6c72b0952"); + FeedZipHtml(zip_buf, 57125, + "c9c242f1b0a90400184efbf3fe6bbf13b2094215b6a8906eaf"); + FeedZipHtml(zip_buf, 57150, + "6f03457c083fc018b1fd367713f2e567362262cb1a3272a211"); + FeedZipHtml(zip_buf, 57175, + "b1ed3da7ff2696e97075e0ff205fdbe79f7cbef8f1e2e3cf17"); + FeedZipHtml(zip_buf, 57200, + "aeb861c5d8e1565172256be2ca9aa6a77f0c41cee83e7b838f"); + FeedZipHtml(zip_buf, 57225, + "ec27f8afa0870260dbbb62d950ff89c55cfeeb4fc2a298b249"); + FeedZipHtml(zip_buf, 57250, + "658b7bab5ffd31c423de00ab3af7d3ec14e9cc6199748c5a2c"); + FeedZipHtml(zip_buf, 57275, + "d7172c9fe95cb264d3b361df0f5d461f9e346c97dd6226b177"); + FeedZipHtml(zip_buf, 57300, + "a0825bea584a465db900e1d1991e3032e616a09d9407e94888"); + FeedZipHtml(zip_buf, 57325, + "5c0144e201b2b772a8e9311cdb395ba00e52d20c339961398f"); + FeedZipHtml(zip_buf, 57350, + "ea4ea302af7d028d5817deccb1ac388a8a553f1616400f65d0"); + FeedZipHtml(zip_buf, 57375, + "5474a893fb3d7d0840f352ed7659ce611a2a7e77f577bbe637"); + FeedZipHtml(zip_buf, 57400, + "449ed55236f24f1ccac31e330d1564830ddb64f00d4e8044ff"); + FeedZipHtml(zip_buf, 57425, + "0a39a8d25384d3d0c418547e624f7822e4e129f0dc21163b1d"); + FeedZipHtml(zip_buf, 57450, + "4a46dc0c609b5e42ba5fa46381e0a55c2712c4d4666e2cf0f2"); + FeedZipHtml(zip_buf, 57475, + "953d8372f8e8223e42baddb3e690589f25c05a9c091206adbc"); + FeedZipHtml(zip_buf, 57500, + "280da11022e8ab2ac5c7c5ad11f042ea3791a7eb63703f429d"); + FeedZipHtml(zip_buf, 57525, + "e6659b0f9e1ff7e7f2426db477a78295d6b184f706212f888d"); + FeedZipHtml(zip_buf, 57550, + "4af496629d9667117b8c5b68ce26813b9ab787eab939693d28"); + FeedZipHtml(zip_buf, 57575, + "de25f18823f3ca002147b428b2a313f7f20e2b0191b7e71fdf"); + FeedZipHtml(zip_buf, 57600, + "96b2c5ba49543db51b55e6ab7a914640f73d1cefc59ddf0161"); + FeedZipHtml(zip_buf, 57625, + "24d4614bfa1561b90ad6f4c7e964e82bf4555d8411ba6f61bb"); + FeedZipHtml(zip_buf, 57650, + "b6e672c65329ce221a4ee6f89ea20bcbb12c67d4d61ecb44a0"); + FeedZipHtml(zip_buf, 57675, + "ab73155b1acb9a7312464c3111f31d25a41e2c967108ed98f8"); + FeedZipHtml(zip_buf, 57700, + "4585c457f0a31a37ffae92d2e488baa7b716c1aa26d93404cb"); + FeedZipHtml(zip_buf, 57725, + "a196378cfd9ef3cecd87758780cde20537fa4d2a2394b3943a"); + FeedZipHtml(zip_buf, 57750, + "8796d38918d092e86660abc25e2d4e9623f025dd81d5894f4a"); + FeedZipHtml(zip_buf, 57775, + "02d838044e46480dbb67600b545528cd4630da83697835451f"); + FeedZipHtml(zip_buf, 57800, + "8d0147b349250de074311929e5ae1c58e6a82a883592b625c4"); + FeedZipHtml(zip_buf, 57825, + "5c4981689b31b763b9580a4f890b888d81d5941397414eeed3"); + FeedZipHtml(zip_buf, 57850, + "51caa930c409b3b6e74cb39e41243221899170d351270652f5"); + FeedZipHtml(zip_buf, 57875, + "94514c5bbc2e843221b7340f60cd76995ca941cda6ba694b73"); + FeedZipHtml(zip_buf, 57900, + "87d48ce8883f3cd7be1b5c6b083a3579be6cedc9c2b23d6fdf"); + FeedZipHtml(zip_buf, 57925, + "7b3113f63ff2693d1a0e1b508239aa8a1266b93e1ff3eebb78"); + FeedZipHtml(zip_buf, 57950, + "25c37014e25b31c4fed218bb0e67fcc9e0add60daf9140ea25"); + FeedZipHtml(zip_buf, 57975, + "61d8f54f6845ab240e1ad1c2d7c31d188c1fd8166746e81721"); + FeedZipHtml(zip_buf, 58000, + "ac727ce69dbb9afe1e3dfd493c917dc197307bbe1cc522e77e"); + FeedZipHtml(zip_buf, 58025, + "1c5aa347334830fe884af6646cea55084d465785251e9ec363"); + FeedZipHtml(zip_buf, 58050, + "13f06a70f4d2bf072229c750febe282a178c38f1ef3d4b56dd"); + FeedZipHtml(zip_buf, 58075, + "50023e8ee32f41af123e6a48431015b0b17a024245d8b05bb5"); + FeedZipHtml(zip_buf, 58100, + "78fcbc2f7213631ce6c1c181f76f35e2a276e9a6b7dea51d3d"); + FeedZipHtml(zip_buf, 58125, + "f2e23dbf8f2912d4215eda234d7afa49c4295a5ec190427a0e"); + FeedZipHtml(zip_buf, 58150, + "69ffb663d9ef22eaa4ac98280f2e3fc92ffec68a46301cee23"); + FeedZipHtml(zip_buf, 58175, + "f15653ae7a665f8943918e701f76b57b560504a939387f02c3"); + FeedZipHtml(zip_buf, 58200, + "1113c39ed9f7512014c6e8c53efc25882e6cb2e5682e8db673"); + FeedZipHtml(zip_buf, 58225, + "2279d5cfe747f126b32e15c1c5067618be100ccf055ba8b809"); + FeedZipHtml(zip_buf, 58250, + "a1d5b7176456ca9380f64c1c536cc97599f4eb1ee8b4e53e56"); + FeedZipHtml(zip_buf, 58275, + "6b56fbcabbbfb41332d3fa2165c7743045d534b1cb48196595"); + FeedZipHtml(zip_buf, 58300, + "9f022a61813e11ec50ae693700d5a5683b57092639a8e5b9f3"); + FeedZipHtml(zip_buf, 58325, + "e9b00a5e3197e0b1a6085e9344af0024ae48b867f2f0a4f044"); + FeedZipHtml(zip_buf, 58350, + "87f7e93517ce76c553c0a74914fe310974d02ad338d9c072f3"); + FeedZipHtml(zip_buf, 58375, + "bb1280f1c0ae896556988f814e5825cc28ed2e4d80b9e945b5"); + FeedZipHtml(zip_buf, 58400, + "24f853da050133752cc79074ad6778cdd8dad8372d88365322"); + FeedZipHtml(zip_buf, 58425, + "6ba351aaca61e917aebe38c97f24f3e95e2ed1c9f644b988c0"); + FeedZipHtml(zip_buf, 58450, + "a4f9121c9dd50a546dcdd028fb3e70f92dacef4e6c9ed3d6eb"); + FeedZipHtml(zip_buf, 58475, + "84b8690016a5e24af0f7a03a1d3a2c419d5e1ca43a6c269ddb"); + FeedZipHtml(zip_buf, 58500, + "b4d614a82701a67256c295875482b609f513747b345705d41e"); + FeedZipHtml(zip_buf, 58525, + "8b7cde92e0f499da465f4b2e510a2c63dc0cac756638766ffd"); + FeedZipHtml(zip_buf, 58550, + "68a0628bd5b664f0bf1664b60fc6c0a4a48056036531b20cce"); + FeedZipHtml(zip_buf, 58575, + "8f7cad1c70b684c7cd077539a4cb758a622c4805dd3b158066"); + FeedZipHtml(zip_buf, 58600, + "33cca159cc36f1ea948b4a0cd8690c6bd01860bfb552b03966"); + FeedZipHtml(zip_buf, 58625, + "2621b8d4e06b7215cb69bda0f51c46e0652f59340c2f7bc5bc"); + FeedZipHtml(zip_buf, 58650, + "b178d9eb2d459191f4b2483dc6d7547801bf5d8e0aa309bd56"); + FeedZipHtml(zip_buf, 58675, + "83b9539c4474ccc3b070cc6dda27adc4a7625dd5110718069f"); + FeedZipHtml(zip_buf, 58700, + "a5560c32fe153060e223efa0ccb688eb5d6c819282c858a1a3"); + FeedZipHtml(zip_buf, 58725, + "88cf0b5651cad8bb088a2fe828266acea4a268c7ecea341404"); + FeedZipHtml(zip_buf, 58750, + "59b582a2472c4d3fb120b681a23382a08176921bb641cac9f6"); + FeedZipHtml(zip_buf, 58775, + "00b8cc63ec1a562e9c96bb8ceb1fbb1917984b6498718d7964"); + FeedZipHtml(zip_buf, 58800, + "841997985d289871814529889aff6e05aec37f61702efe0537"); + FeedZipHtml(zip_buf, 58825, + "859b114a08fd3ff87f5cffff7fbcbe7da13376121f45a16198"); + FeedZipHtml(zip_buf, 58850, + "052f6fd23f86201dd11fcef10f761a8eb76f54f2c010129197"); + FeedZipHtml(zip_buf, 58875, + "f302674cb04bc4ebdb976fec9f18e90d3f81c0453a10881647"); + FeedZipHtml(zip_buf, 58900, + "49f71616e866a466c1afe0b79978077bd9ed0fcf5e3c7ffebf"); + FeedZipHtml(zip_buf, 58925, + "9f791d0ad9837f59c947f03f01a6e580a234f67b18d9f8c3b3"); + FeedZipHtml(zip_buf, 58950, + "bf3d834d14f28182e7f8bfcfe4a47f8539cd9c9f06830be93e"); + FeedZipHtml(zip_buf, 58975, + "aff9ff107fb93c7f79234ec52904252a280ecf8797df096880"); + FeedZipHtml(zip_buf, 59000, + "0067025c0784871126ec1e88199c6b5f53339d9be34f9f675e"); + FeedZipHtml(zip_buf, 59025, + "de8c6c87df038ee90b996d13c77e98c48b00c330ec7471ae19"); + FeedZipHtml(zip_buf, 59050, + "979f24c345ad8edd53665afc37f8d52216ff13e6a1d27227a7"); + FeedZipHtml(zip_buf, 59075, + "efce8faea90eeade6c5b39ffedc3d182e030fc73e4cfb6f8a7"); + FeedZipHtml(zip_buf, 59100, + "8bf70b5a7b8c994fb32cfddf9f4e17b5f6efe360e0b5e244fe"); + FeedZipHtml(zip_buf, 59125, + "f73e8cebc433dec3f5d9bb770bda0fe88efdd9167f1fc40b5c"); + FeedZipHtml(zip_buf, 59150, + "7f10c4b36fe1e7d3b79f16b4fe7dd019cfc80c6efde4fc6a51"); + FeedZipHtml(zip_buf, 59175, + "ec00261ba6b36de0e3388816889198caf5fbf825b186ff068c"); + FeedZipHtml(zip_buf, 59200, + "7cf9fcf9f326bc41c80354d5d72b7f9c6512345784c45ce92e"); + FeedZipHtml(zip_buf, 59225, + "75cbc45c452eec259e6f1d62019b4ae841dce637fbd64f6fe8"); + FeedZipHtml(zip_buf, 59250, + "b437dc0dd4b8a382e4883fbbc6f63b529fc63ad50cab5c0297"); + FeedZipHtml(zip_buf, 59275, + "04d5c17f30dc59be8cd3cca7efe2925f782d9411f72ad1486f"); + FeedZipHtml(zip_buf, 59300, + "b017f431217ac63d8a67c46bfd198e0fd9b4005a76e67befa8"); + FeedZipHtml(zip_buf, 59325, + "20e8decaf70f809eef0837171f8d53c4936c5d07198bfc99e6"); + FeedZipHtml(zip_buf, 59350, + "2780477175dbc3f76ac6fd219f5add06fbfec35ffe7f7b57d7"); + FeedZipHtml(zip_buf, 59375, + "dcb6cdaceff32b38e7c6f28ced247ddb73324ddb19f9238e3a"); + FeedZipHtml(zip_buf, 59400, + "cec7d84ed3f626438bb4c496221592b2adf7d71fec2e00825f"); + FeedZipHtml(zip_buf, 59425, + "1265891225edf422b54481c0ee02789ec56277c10ebeebfef9"); + FeedZipHtml(zip_buf, 59450, + "63db671ac02eabf37fc74b4fb45ca7e1dce495d5a10c3a706c"); + FeedZipHtml(zip_buf, 59475, + "84797007e2e754c36b420936efbdc124b2d33b4bcdcd47c497"); + FeedZipHtml(zip_buf, 59500, + "30198db12e311dd7345cdac3171c2aa108ab0313e4d80fe3d8"); + FeedZipHtml(zip_buf, 59525, + "172cbe7d630378b4e0c8beba779fad0e0c69dabef1f8fe7243"); + FeedZipHtml(zip_buf, 59550, + "6aa79608c22dbc382390443ea2709fd55eb58931ae6e881b55"); + FeedZipHtml(zip_buf, 59575, + "634de06c78b530a22c7623cff6bdff42f480f7e4fa32c42cde"); + FeedZipHtml(zip_buf, 59600, + "6e982cafb0e28848b7e0bf1ceb3fb331e1707dcc86ac8fb7d3"); + FeedZipHtml(zip_buf, 59625, + "b1abbecfb86ce1d874323ab5032756df9738b80b773c354d02"); + FeedZipHtml(zip_buf, 59650, + "baa22e711b1217cd8a9fc96ec18fd2706fc8fc813e542f999e"); + FeedZipHtml(zip_buf, 59675, + "48a5960636a4c6a38332a40dfd2c3f9c919f4e8601e7f26a51"); + FeedZipHtml(zip_buf, 59700, + "1599195c15e33e73c29d2f411ce79222ce9e53e669a8947049"); + FeedZipHtml(zip_buf, 59725, + "6a29b26d43f424e69f679f432e2832d21264eea6d741b98a30"); + FeedZipHtml(zip_buf, 59750, + "c8e419f5020f12fac9541c74eafef7c5f5a734c4bad23f927c"); + FeedZipHtml(zip_buf, 59775, + "cec86f86452f40da47813b0a03af6fe9c6d5c1ed5a245663c0"); + FeedZipHtml(zip_buf, 59800, + "3759bb5af1b0d3d6db36ee8fe664983feaeab5c7749debdbe4"); + FeedZipHtml(zip_buf, 59825, + "d874db869c9e61cd5baeef44f77bba94effcd51867a6da1a9b"); + FeedZipHtml(zip_buf, 59850, + "7c697a2459ad05890b2c5a31ffa0b21c69fc0a0a7a64277d4a"); + FeedZipHtml(zip_buf, 59875, + "208c9d3c88ad747d3d5cabde487499f21faaf287baeb7e4a99"); + FeedZipHtml(zip_buf, 59900, + "82cbeeb9cb7bfc3517b99bd5eac4d8d9d316e7ec2b2596b2a6"); + FeedZipHtml(zip_buf, 59925, + "5e959c66cfd9ec02f771d10dcfc47fc9d05515ba21dccab446"); + FeedZipHtml(zip_buf, 59950, + "72abe682b9e015d00426f0d085a7f237d90c3bdd5e43ecc598"); + FeedZipHtml(zip_buf, 59975, + "65796cc344ad85221b828089ee46bf7530b0177f1adbc27c36"); + FeedZipHtml(zip_buf, 60000, + "299f706cf75b8890c592f14c035a66cea7c6926c7c4f171258"); + FeedZipHtml(zip_buf, 60025, + "dc3a96183cd49d82d76d7ce0f8fe8bef82ade7a1dbb7d7e5bb"); + FeedZipHtml(zip_buf, 60050, + "057df9c3e25306f8059694780c179837314e1c8af06ddfcc51"); + FeedZipHtml(zip_buf, 60075, + "b00c2e0a5274c9e9f473e805492a4ce7ce28979a09d23aa2eb"); + FeedZipHtml(zip_buf, 60100, + "d60fae4e3d5ff876acdb92a23ebec4d205fafb69648fa6ce37"); + FeedZipHtml(zip_buf, 60125, + "df7d48edb402301c7fd6e29d01303735926118fdf75be46a36"); + FeedZipHtml(zip_buf, 60150, + "4df8427f0d91d0c5af670cb1687fa23b905a3acddf46c3b4ce"); + FeedZipHtml(zip_buf, 60175, + "64bf73355c0a0396596033c3447081531821b0c229237b6c54"); + FeedZipHtml(zip_buf, 60200, + "d48b8d4c73d4b016c6cf2f30e01deb57a8296f655f5b1e1c8e"); + FeedZipHtml(zip_buf, 60225, + "d506c45389ae4d710085330e2456801070553930237c9d061d"); + FeedZipHtml(zip_buf, 60250, + "6bbce8e4eaba8404d62851b34ca6d32b2b9192b6e8c5901a55"); + FeedZipHtml(zip_buf, 60275, + "5f81c903acbc909321c5f9a50d940f10a2dac37f08cde98230"); + FeedZipHtml(zip_buf, 60300, + "f9c6c2c7007ba7468c01efc51562a17d9a560abdf62eb156ac"); + FeedZipHtml(zip_buf, 60325, + "c0c769fb6e02e5b777c8cb493a942333f61ce383c5fc9d4b62"); + FeedZipHtml(zip_buf, 60350, + "35f5deed7168c2524dbdfe38195d04b240c63c413ecff3822a"); + FeedZipHtml(zip_buf, 60375, + "871aa658184a317969969bf5c15027cea0832084694d5b82b1"); + FeedZipHtml(zip_buf, 60400, + "4ce73946ea78e594638444d4797ff1e7f1f5e5a94c91a5bd1e"); + FeedZipHtml(zip_buf, 60425, + "95b3d9c24eaf9d74aa4ee0db57e606694417840bdca7ebc11d"); + FeedZipHtml(zip_buf, 60450, + "b65c3df797723d541973def94011ec8ed4370ef3e4c52d5668"); + FeedZipHtml(zip_buf, 60475, + "820f8ae929c49fe265b12beb5c61167170e3dabef5f5e2d432"); + FeedZipHtml(zip_buf, 60500, + "0de60836710f979503b16cbf79f5e695dcca3548db6e23912d"); + FeedZipHtml(zip_buf, 60525, + "1698067d5cc935e4d7cdb08dd295bf657c63790c41fbedcb53"); + FeedZipHtml(zip_buf, 60550, + "aa0222f015d4258a771052a4833329cbe70c63c99fe12930ff"); + FeedZipHtml(zip_buf, 60575, + "51dd322d79262a6b7d8e2d9610acb97d9dfb9e8d1ffd167b38"); + FeedZipHtml(zip_buf, 60600, + "1f34c94218e2d7a92ee4afccb4dcfa1ead710d17d6a3eeed6d"); + FeedZipHtml(zip_buf, 60625, + "f7ecfdc5f9f1f9a9f588c54f30704853b6c2a27b1f4e02275b"); + FeedZipHtml(zip_buf, 60650, + "29a3bcd6fbec0a84b2ca272db646a53ee029aafe60eb5061de"); + FeedZipHtml(zip_buf, 60675, + "b6be7d0ccfedc446521c9f09c1240b58db227891b23ff7e10d"); + FeedZipHtml(zip_buf, 60700, + "001ae9b5448c35687c964965e151b3c24a6330d6292b1a8e14"); + FeedZipHtml(zip_buf, 60725, + "55c77deafb13c42619191e6e8d10cbcebfeb8a6fc9a3f039b2"); + FeedZipHtml(zip_buf, 60750, + "9843569a150b2ec8cfb4aa3a62c9a75f4faf13648ece5b2422"); + FeedZipHtml(zip_buf, 60775, + "e89721a00f5eb0e84eb8aa036ef16a6f3419c954178ab691c7"); + FeedZipHtml(zip_buf, 60800, + "ae4f877490c17bbdc25be7f1618936eca78d69c37e626d64b5"); + FeedZipHtml(zip_buf, 60825, + "d17d186c4a1b5dc2592f3fb876c02a31b142b42995c055b211"); + FeedZipHtml(zip_buf, 60850, + "26b2c43bf270459c1593e28fc439771f36af1bf1c6c0b123c7"); + FeedZipHtml(zip_buf, 60875, + "12bdf1a836286b496be9bdf8371c44f6a809453d3be8f6e3a5"); + FeedZipHtml(zip_buf, 60900, + "607a54be536654d22592b45e1d0f1206dd4d50a37a187ba1d5"); + FeedZipHtml(zip_buf, 60925, + "e55d5124855b28c9b77beea75b59cdad86e3a9aee7094ff73d"); + FeedZipHtml(zip_buf, 60950, + "e7aae2701f9f49c46b3f394ef974812f2f1edc6071c25ac30f"); + FeedZipHtml(zip_buf, 60975, + "4403660f509b3c40a093de484527accc050a76d43b6f74cded"); + FeedZipHtml(zip_buf, 61000, + "3c7831dc19122bef83e73e1e9651d68cc535b072a2a98e60e3"); + FeedZipHtml(zip_buf, 61025, + "4ec2683ad768c9bc0cdbba73335d588d75952de730cdf4fd94"); + FeedZipHtml(zip_buf, 61050, + "d8f2edfebf9833550c4cb5658d876182b11e623bd2d1228444"); + FeedZipHtml(zip_buf, 61075, + "3ade897b629d776fbb97d7bdf34321655592f73212fb42df96"); + FeedZipHtml(zip_buf, 61100, + "890d8d9fa843a758a8002f89a95ebe7827fa22e332403fb14a"); + FeedZipHtml(zip_buf, 61125, + "76f3e1cbd56defb4fbf19cb2afd778479ac19db6aa3bdc4403"); + FeedZipHtml(zip_buf, 61150, + "7f9a39f62af460de9488bcb1efc2b6b7f6c991852cd7ae33ff"); + FeedZipHtml(zip_buf, 61175, + "a1cbc84d97ebeac74e9f1f1fbe6f22a1a706754f905962f324"); + FeedZipHtml(zip_buf, 61200, + "46fd4d8377795bd8c4b690a2aaac6d506f8ef2df4993507d0d"); + FeedZipHtml(zip_buf, 61225, + "9cfc03640cb9b150921a1399d9d19d27741f7998a076340e65"); + FeedZipHtml(zip_buf, 61250, + "ff219001b4162736617f1d65490ee8427e1b05e0d41de3d5b1"); + FeedZipHtml(zip_buf, 61275, + "96cc14be35cb01cb212bcb2e01a1ab8fe048cbdd8be60f90c0"); + FeedZipHtml(zip_buf, 61300, + "dcdf1f58b803438d1bc80994b887a65a65d5e25cb733336e91"); + FeedZipHtml(zip_buf, 61325, + "aedb907d59de12974e08b34f1a9e123a2d871d902e698a19d3"); + FeedZipHtml(zip_buf, 61350, + "9566c42f4dde47160b9bb54cbd3e0713006810920368306f03"); + FeedZipHtml(zip_buf, 61375, + "ff1006610b565e802dcfdf725b3e88956c92db3d46ded65aba"); + FeedZipHtml(zip_buf, 61400, + "ad913ee7780caaf6a5946cf0eeb4b3bb53eb48f186f7d0c53d"); + FeedZipHtml(zip_buf, 61425, + "b5da9d8651822e7547ac0de2a311aab46937edaa5db394f483"); + FeedZipHtml(zip_buf, 61450, + "e47766ded8e9d4dd6e1ace1022b7bd11ce0321edaa76607f85"); + FeedZipHtml(zip_buf, 61475, + "a0592fa9ded46067fc0ae2297de2857ce2bdeb0d86a5db1a36"); + FeedZipHtml(zip_buf, 61500, + "02f768cabf7ca1c67aedc6a18f471ff8209d88cd097f647d34"); + FeedZipHtml(zip_buf, 61525, + "a20fb82ef7b95a27f4105c9a9bf1102b6e4b15873d09d2d8ce"); + FeedZipHtml(zip_buf, 61550, + "3ac73bacd99dd02cc91df04b926ba1acc323d186933e572de5"); + FeedZipHtml(zip_buf, 61575, + "98b6fccf76329cfbd087f39fe63da2f7e74a0a3527589e6d93"); + FeedZipHtml(zip_buf, 61600, + "6d73fdb6898f79f1b7ef1381d455f591f906fc22e707b093c4"); + FeedZipHtml(zip_buf, 61625, + "1d8d315f1ad51c9637d0f2b79721b3ab97b94b4855bf02624a"); + FeedZipHtml(zip_buf, 61650, + "e7a7c7f742eff34f995fde7c393bbbb8b9293b6d7ef9aedbbb"); + FeedZipHtml(zip_buf, 61675, + "fa725debd47916b99a8613ac5f3691bc5ab240e0969971e6c7"); + FeedZipHtml(zip_buf, 61700, + "08197b3cacb0255d1b626c763098f8764a7129c6fda4c08c85"); + FeedZipHtml(zip_buf, 61725, + "7422f90adbf7c34724d482392aef81bc6a2ede2a83e5913ebe"); + FeedZipHtml(zip_buf, 61750, + "2d7a217c1b82192ad8684ad867a722729fec3ebc3573d15f8d"); + FeedZipHtml(zip_buf, 61775, + "f32056690042c7f58b43b90f27916035d56381fc7a24a1cf21"); + FeedZipHtml(zip_buf, 61800, + "7c26f8dea7b19c17524c1de96170bc186c137d1592a21e9e58"); + FeedZipHtml(zip_buf, 61825, + "17767fa82ef1d32ff3ae081bcc165c602a61e81d664950a41b"); + FeedZipHtml(zip_buf, 61850, + "cde557ddf84b0b4ceb5737c03f0f4b86e4dd8b11015fbcf7c0"); + FeedZipHtml(zip_buf, 61875, + "0f30636c09d886caf96b046ee0da684e3561a250304d8d344d"); + FeedZipHtml(zip_buf, 61900, + "3aa86bf96406fd6296e7f8c64dd4bb7ac17d182fb67da43502"); + FeedZipHtml(zip_buf, 61925, + "4bbeb4ef624c2551ed299db3bd6da66fcb2f6fbd40cc8b24c6"); + FeedZipHtml(zip_buf, 61950, + "da1d13ac1c151fa25675a5c40770928811812b24ec7bb69c64"); + FeedZipHtml(zip_buf, 61975, + "b6e95153192f8ce17ed3651e73792902aa9e67fa288cf41619"); + FeedZipHtml(zip_buf, 62000, + "61c843ad8c0074245f452fc91b25ec2c9733437bb7f4aa5126"); + FeedZipHtml(zip_buf, 62025, + "ba4eceab253d34ca9b9560f63bc7150be2c80bdcb86c0ae806"); + FeedZipHtml(zip_buf, 62050, + "a5edbf8587c2919760abe6c3e81cc2d1440fb4acd9be58751d"); + FeedZipHtml(zip_buf, 62075, + "9c0f5810122772261506797e28731a05a942288678ad54ef11"); + FeedZipHtml(zip_buf, 62100, + "6552b7d5d7b4148861bc466f1aac00564756d792197fe1739c"); + FeedZipHtml(zip_buf, 62125, + "8d5647569e155bcbf1eb5ab792dd78de45f22ce23b0bc7d348"); + FeedZipHtml(zip_buf, 62150, + "a39edaf3a39ff9d933e767e33dc107c412e98a3955aba3f3e6"); + FeedZipHtml(zip_buf, 62175, + "a1ee23ce842b6a79cdb3313b609d502796a6ac3a380c7dc78d"); + FeedZipHtml(zip_buf, 62200, + "d0d6cd230433ab0299a2b22a65f74e9d796a0a15079016530b"); + FeedZipHtml(zip_buf, 62225, + "039a3a0817a48862f13d95a93553cdc0a19578e89b6c8c9668"); + FeedZipHtml(zip_buf, 62250, + "f47fa22fdd3d199c807ecece5e59af4fb0560c022cf8c43afd"); + FeedZipHtml(zip_buf, 62275, + "cbfa913edbe2d9781e85e385a957bde9f5aca6d3f339bb5f45"); + FeedZipHtml(zip_buf, 62300, + "2ce686b52a68ee84784a04354c31d7d048bcbb04bd76bc40dd"); + FeedZipHtml(zip_buf, 62325, + "c7b4117dfb14dc4f4c223eb23e53846e8c530eddf487e9d952"); + FeedZipHtml(zip_buf, 62350, + "eb41bddc8ff2273a7a2ed5dadf28ff934efb6407744a020dc1"); + FeedZipHtml(zip_buf, 62375, + "71c36daab134ad747a02381482f3e704f151dd5a29f405bd00"); + FeedZipHtml(zip_buf, 62400, + "f4a399b1abf38cb5a1b7afd19ed5818e69ce82460017c3a7c9"); + FeedZipHtml(zip_buf, 62425, + "aaa52d835528d044e79aa9e16fab8513936c8f812f7e40a794"); + FeedZipHtml(zip_buf, 62450, + "b3ce33b9555f9d30d3c1d07004bf5ed1d6f2fc76975d279a7c"); + FeedZipHtml(zip_buf, 62475, + "333e21f6f8be7bedde4d3cbf34f6b3e5dd5bf53ad71118075f"); + FeedZipHtml(zip_buf, 62500, + "26fd2572713bbe13335fc73feaf9828931e3762c4629d686b0"); + FeedZipHtml(zip_buf, 62525, + "1ce5aca15118729623f08cb49147943611430330cb7a6674e9"); + FeedZipHtml(zip_buf, 62550, + "527ee7fa613090f146c9d04ef4d2af5626b14ec702969b0520"); + FeedZipHtml(zip_buf, 62575, + "32105cf743c5b3e0522630f2380a01772ac7d7a380f06e1909"); + FeedZipHtml(zip_buf, 62600, + "902b6e293017e3cc5a8bf26cd55986218e43315ecd42328230"); + FeedZipHtml(zip_buf, 62625, + "96df91eb00db4127619c44e114176e87c418d1eb4f20bfa5d0"); + FeedZipHtml(zip_buf, 62650, + "ce116e71e54da6a5307cf73eb126821d4cfa43d918aac30888"); + FeedZipHtml(zip_buf, 62675, + "1a79249fdc2fe165495142e894dcf0969472931cfc2a5daa21"); + FeedZipHtml(zip_buf, 62700, + "becf079f75bfa945fb196fa0ecb05e043ac08b7275f31e6da4"); + FeedZipHtml(zip_buf, 62725, + "1fcd2d8639b34defd2e4c642d142ad590e1591cfae27694e58"); + FeedZipHtml(zip_buf, 62750, + "5a84e4e2030b2142d22033ef045ad5b377d69e40bd155f9b22"); + FeedZipHtml(zip_buf, 62775, + "c9ed17eac5e9b2e1897517e014d5142061d3798efa0dc2e1b8"); + FeedZipHtml(zip_buf, 62800, + "1fc1c140ce3f5149ada823397b517173da89de1f862a90718c"); + FeedZipHtml(zip_buf, 62825, + "4e0ce9a27023214c81f0ef85158951ddb9c9a30b6975450393"); + FeedZipHtml(zip_buf, 62850, + "dfc6c3690c418020653428748ce257f27df08d452f3db1ba18"); + FeedZipHtml(zip_buf, 62875, + "6a8620121d0e14f3afcc010df607437cff81ff3fb16ed19d4a"); + FeedZipHtml(zip_buf, 62900, + "f171b19ba0ecc9a3ff1ffa19ba32309768488dbb4ff01e79cf"); + FeedZipHtml(zip_buf, 62925, + "0becf2d3c74f67efaf3f7db8b05e1f9ff66ef11dca0004b516"); + FeedZipHtml(zip_buf, 62950, + "7297e572c16c945e54bf4e485a6d5e53c1e87b2300f0b6e8c3"); + FeedZipHtml(zip_buf, 62975, + "c730f1fad2f26d2bb5c09476c578f681790b138f303d1eb04c"); + FeedZipHtml(zip_buf, 63000, + "d369612657c69319b51d17cf53c9aae12c695a20d7196edd14"); + FeedZipHtml(zip_buf, 63025, + "147f56cb2b02e30dbd7bd5abb75c6418acce05ab58981b5b4c"); + FeedZipHtml(zip_buf, 63050, + "43b5ef697cb9b53e5dcb71413d6c16e6b66ac1798e8b81ec0b"); + FeedZipHtml(zip_buf, 63075, + "861b275338f7fd608fb7302b43eec6903dc6fb27692d837411"); + FeedZipHtml(zip_buf, 63100, + "58c54d943bc830203e390d7533baa2818bd98fd5938f95613d"); + FeedZipHtml(zip_buf, 63125, + "f0edb032a4a7e6859bad1fa70c191296377bab6141c898a9d1"); + FeedZipHtml(zip_buf, 63150, + "9c2cf82ca879825acd5537966303d7e958d6cdc91a9f991189"); + FeedZipHtml(zip_buf, 63175, + "caba688f2ef0fb48007200917594353ffed4f1061ea4882d49"); + FeedZipHtml(zip_buf, 63200, + "70665b371afaa97ba869859d7bb3f04e95f3485f791540ce0b"); + FeedZipHtml(zip_buf, 63225, + "14784e9b555ce419f7556b92941d4e32952fe624c698992629"); + FeedZipHtml(zip_buf, 63250, + "05cb96bf3423df70205403cba5bcd35905bda500dffc15dfb1"); + FeedZipHtml(zip_buf, 63275, + "e80439dee5f5daa9f5af4799edd48c3c527e75c16ea853e27f"); + FeedZipHtml(zip_buf, 63300, + "9e2cfb5fdbfa707a5d51dc49c7c4950fcf989e727015423e90"); + FeedZipHtml(zip_buf, 63325, + "2ea803923489387fef1adad51740b1e91c89b475096cba394a"); + FeedZipHtml(zip_buf, 63350, + "9e2ae3a2a52c302aa92285348b4684007498ab6c988cc31e03"); + FeedZipHtml(zip_buf, 63375, + "9984a0d992c19586e217f27294c6e22b6108aa48d691d30dfa"); + FeedZipHtml(zip_buf, 63400, + "ef8ec4fc08acc0051a4bf7a1ab22968131439954d93ecc3f88"); + FeedZipHtml(zip_buf, 63425, + "8f92c6917e118b161cf1ae07dbf39111ca4bd25949e7687ea7"); + FeedZipHtml(zip_buf, 63450, + "60f6da04a0696107f0236d1e2431bc0d3c161c7c1cc1f18d29"); + FeedZipHtml(zip_buf, 63475, + "40315221fd8ca1819de5ac3e13a42d354f8325b1ca5da3206e"); + FeedZipHtml(zip_buf, 63500, + "b55fc82f1cb1fc07310edd4ec837918a432d481764268fe0ec"); + FeedZipHtml(zip_buf, 63525, + "9875e4952ee486b384229bc19993c6ab438c4544b2728d686e"); + FeedZipHtml(zip_buf, 63550, + "fb09ad5a4e00b8503e86352ca0d80dbc985c2b2c4e7425ddd6"); + FeedZipHtml(zip_buf, 63575, + "f2f34a2a1ee6144aece5d8b93fd00e60f9d93f637750f830f1"); + FeedZipHtml(zip_buf, 63600, + "eee949b9c61fa02efb7843fae5d3b16ae7ad95bdd5ad5e130c"); + FeedZipHtml(zip_buf, 63625, + "ca6ad66dc7a5f8595d6ec18578b31a2f1a9d5ef52681f77d02"); + FeedZipHtml(zip_buf, 63650, + "a7a36226eba414714d23d2c0459dde4a4147501e29eddf313a"); + FeedZipHtml(zip_buf, 63675, + "2d5fbdca2a5f7cf6063f02ff9735126314462e844aee42adb2"); + FeedZipHtml(zip_buf, 63700, + "18adf1f7cf17f9be91631df04e1de7cf1f2e9c8f6c1b445d1c"); + FeedZipHtml(zip_buf, 63725, + "8a6fe7381b70feeca82056effcd95341addcf9c3725c9ff387"); + FeedZipHtml(zip_buf, 63750, + "65dd1ee70feb627f9c3fa46b76feb0f3879d3fecfc61e70f3b"); + FeedZipHtml(zip_buf, 63775, + "7fd8f9c3ce9f36387f6a06397923758d8a32ab5a70b397d00e"); + FeedZipHtml(zip_buf, 63800, + "ec891872051fc5e124eabbdb1dfe7415da4efe64b656e0238e"); + FeedZipHtml(zip_buf, 63825, + "1d92ec54f3e23937251b79b5c4fbc9f06b18f9ce3baf6ed68a"); + FeedZipHtml(zip_buf, 63850, + "967530bd2a5595a8690786804f8cb391b7fb38ca95c6091b44"); + FeedZipHtml(zip_buf, 63875, + "4e209671389ef8694aa9346216534919dced6e6a2c7b98b841"); + FeedZipHtml(zip_buf, 63900, + "2e747039978265cdd59024677524fe83c5f7c8baedbd7b7704"); + FeedZipHtml(zip_buf, 63925, + "60ff566cf3b0c3776fce7a3deb3212480f63585b18aa3c6bf3"); + FeedZipHtml(zip_buf, 63950, + "ca297f91db6759d826439ced1c0ad66d57714654a182bd9398"); + FeedZipHtml(zip_buf, 63975, + "be1c842edced80f414b493825216bc5147b69a21839299b809"); + FeedZipHtml(zip_buf, 64000, + "7416828b05c9ce26d59024b34818a1b5cc5d03f8b064a79ca5"); + FeedZipHtml(zip_buf, 64025, + "14fa3906160355d2bd947d107db4ef1054d385756455929109"); + FeedZipHtml(zip_buf, 64050, + "5a93da1f8accb03b30df23d1fbbe0da9c810388081c2930506"); + FeedZipHtml(zip_buf, 64075, + "ab1284610fe0e5f5a56aceefe5ed24c8c5f8a741f0c6156f33"); + FeedZipHtml(zip_buf, 64100, + "fb493e12debcd188f709df5aa1783e7af4e24280bdfecd2008"); + FeedZipHtml(zip_buf, 64125, + "a30c3b6863d07a39cc32b095239079115b29d4b3708e6df137"); + FeedZipHtml(zip_buf, 64150, + "65d8d6845673383778f0a2301851fa194142efe8c6c3cde7ee"); + FeedZipHtml(zip_buf, 64175, + "6daf7bd5bbbdf8767371f6e5ba77fbd7af9011e149de37209d"); + FeedZipHtml(zip_buf, 64200, + "9fa4c054e1d2427eb2529c16833ff5dc5b70ab1316346b9f43"); + FeedZipHtml(zip_buf, 64225, + "5f4f6cec3d4ba0b9b577b019ccd7d261ac1e196eed401bc08f"); + FeedZipHtml(zip_buf, 64250, + "3b2c8b55a34c828b96f214cf058bf1a26851622085550d4c4a"); + FeedZipHtml(zip_buf, 64275, + "db6118e99aa1505410dd600636bd736197a45ec2d693035f85"); + FeedZipHtml(zip_buf, 64300, + "cb63089a9d0c6aae51b273bd80352929c16258d71cd7917988"); + FeedZipHtml(zip_buf, 64325, + "21de0360102a51d823426b4623139d8c6daaa0c63d1695a0ad"); + FeedZipHtml(zip_buf, 64350, + "5e0bb54379cdee7e3b118f6a67dfc93fe381e1e43bb163bc4b"); + FeedZipHtml(zip_buf, 64375, + "7e581f4e31f266e4cdc89b9177bb90376083af1f6e16f43191"); + FeedZipHtml(zip_buf, 64400, + "81cc7a6480b1125f22bfea8105221d46f11f02c5ccc21aa3f8"); + FeedZipHtml(zip_buf, 64425, + "ca9ebad1ac0ea967f0cc77c64314de114623bb3263a978aa2c"); + FeedZipHtml(zip_buf, 64450, + "47bc7892d2c43f0ba5b1229ea588f71559fdb3ca30ba5f9ade"); + FeedZipHtml(zip_buf, 64475, + "7f11d5b1e6daab397c3a1cdbdf679686e639b9739a25c93fda"); + FeedZipHtml(zip_buf, 64500, + "e33fff62c5b3e2732e84287c9a96749bad82ada2a2db0bfb94"); + FeedZipHtml(zip_buf, 64525, + "6a14c079f6d1652162c3f41b09832c21c56d72ee10a795467e"); + FeedZipHtml(zip_buf, 64550, + "7d95f31454046c82c3ed583cad0314a1fe9383a3a5306ca4ed"); + FeedZipHtml(zip_buf, 64575, + "6e9ce4a3767e5969802829a85dd1a1e61ccf96bacfceedf2ef"); + FeedZipHtml(zip_buf, 64600, + "e49c2e7c9999cb85f84035d572deb842ad5f64b2df279e3016"); + FeedZipHtml(zip_buf, 64625, + "10a3ebbbf498f6b198a9049d69608fe49855c162d0c16c25eb"); + FeedZipHtml(zip_buf, 64650, + "445cc5c752d61fc713e9d041172a184fda07e953d2cacdc754"); + FeedZipHtml(zip_buf, 64675, + "0afde1af842ebd07cf8122d5d8c03c6da549c19535c9571cc4"); + FeedZipHtml(zip_buf, 64700, + "99f6954968d997ae90051d542d8e799dd40c6353cb633e1252"); + FeedZipHtml(zip_buf, 64725, + "45ce4ed17395782337ce684dac04a217b2980c05b58126ec27"); + FeedZipHtml(zip_buf, 64750, + "a8cf0b0fd57cbf5c7febbc1e9d2476dfcc4a06b18c28ee3b77"); + FeedZipHtml(zip_buf, 64775, + "0873ce863ad4eea310bad043e0268f61f42f3b9f5ae27caa19"); + FeedZipHtml(zip_buf, 64800, + "a328b4a077bcc7ccae8791cdc6794c6c75d21b1a9107953c9c"); + FeedZipHtml(zip_buf, 64825, + "c3ad8e59fc1a79892b0f8e5280b98a2b4520afd9e1604b5c24"); + FeedZipHtml(zip_buf, 64850, + "aa8f4ccbaa273fc763b6f382aaaa53590280abaa55b25cd721"); + FeedZipHtml(zip_buf, 64875, + "57e3987bd9080d167e23c2272a27647a9656a97db61f8075b4"); + FeedZipHtml(zip_buf, 64900, + "491de9c7a0fece4dfdc8984a564e60a38034f2f73f3d288666"); + FeedZipHtml(zip_buf, 64925, + "f26d75dedb9e023f7c0974298e4f86209e979a6d17d95ffeb6"); + FeedZipHtml(zip_buf, 64950, + "2496ff2bde0b5cd33dc8cc0d46a740b52b3a8733ec9715de58"); + FeedZipHtml(zip_buf, 64975, + "5c2e48271b57a1c22a84229f3cdf034b48636f9492b555d931"); + FeedZipHtml(zip_buf, 65000, + "92b29aa4b8b010ceb8a7f8f1d3c70be336e2f9c5bbabeeadf9"); + FeedZipHtml(zip_buf, 65025, + "c9d5df5f8dbf20aac5f8f35df7cfff64ae2d8a0f7e2cbfa9a8"); + FeedZipHtml(zip_buf, 65050, + "5f941b44059b86ebb92ac2280ef38b4c5ac401958c8e9558ac"); + FeedZipHtml(zip_buf, 65075, + "e75687729b7f9f40d04c82240fc367d4a5bdc37cbf7ef8e97f"); + FeedZipHtml(zip_buf, 65100, + "cd4eed3aa59e11ce81d00470c9edbbaf3b094d564a1e775950"); + FeedZipHtml(zip_buf, 65125, + "9b248f2cd745b1f14aa9098b7ff5e26f0debb0c6be2de0b366"); + FeedZipHtml(zip_buf, 65150, + "1ec65df6bb6905166176b24bec84a9c9ae5313e605cc0b1ae2"); + FeedZipHtml(zip_buf, 65175, + "053b090a564e0a76524a9b66042cd4cdd10196fd3e7001c6f9"); + FeedZipHtml(zip_buf, 65200, + "8cf319e733ce679cbfdf383ff2c6be7b2acc730b831444af7b"); + FeedZipHtml(zip_buf, 65225, + "623378ba965298f9d065e4baa561f9d9c74efd199703364533"); + FeedZipHtml(zip_buf, 65250, + "5849f594b47154c84add41a5ae3a648f35bf539a6f8085b381"); + FeedZipHtml(zip_buf, 65275, + "eca181acd9559026ea17501e927bd78b5ed4854dc52faa0a5b"); + FeedZipHtml(zip_buf, 65300, + "b01f616d7e84cc6ccb5ecfcb4fb20213cd4dafc22d3d2052a6"); + FeedZipHtml(zip_buf, 65325, + "9c9403c1336ede295340fb88139b6ee2e82b6db086c5d96367"); + FeedZipHtml(zip_buf, 65350, + "539e272fe41a5896871d536d45822c4223aa8c44eee620e4f5"); + FeedZipHtml(zip_buf, 65375, + "7f82e1fc7d71fd09bacf219fec6f5989bf85433ed9e5b3eb2e"); + FeedZipHtml(zip_buf, 65400, + "9f2d0cfeda3f970f2ba9dd148095ba834a6d92d3b3ee7742f7"); + FeedZipHtml(zip_buf, 65425, + "eda5ebf9a8df1c63e7286066f5ccea398462ef283df369e6d3"); + FeedZipHtml(zip_buf, 65450, + "8df36986756d27d3aca196026fd6e8ae69b4691acd8adf6ec5"); + FeedZipHtml(zip_buf, 65475, + "6f2d87667eccfc98f931f363e6c7cc8f991fcfe6c71fc220dc"); + FeedZipHtml(zip_buf, 65500, + "f258c6cbc89e563fb51952bbc362dd387c6535b4420db5a26b"); + FeedZipHtml(zip_buf, 65525, + "5957dba3abd5fb0358a5dba1d2f632fdb2e07650492c3888cb"); + FeedZipHtml(zip_buf, 65550, + "64bf3d649fe6c99c8156b1f554a3fbc4d939527d0f683b47aa"); + FeedZipHtml(zip_buf, 65575, + "b3e760b73d075b1c31d966cfc10e8a75e39899d5d00a353447"); + FeedZipHtml(zip_buf, 65600, + "34595b7c5a5cf7b4384b2339ee9aa9e6ee524de699bbce3399"); + FeedZipHtml(zip_buf, 65625, + "e431c96b98e4ed12aa6a0bc3db25996e1ca9b20e36af8366b9"); + FeedZipHtml(zip_buf, 65650, + "1dab8a89dd82c48e491b9336266d4cda98b43169db13d2d68d"); + FeedZipHtml(zip_buf, 65675, + "fb9e771979ce36c1a5cd70b17d17153ee6c5b85c9f09031580"); + FeedZipHtml(zip_buf, 65700, + "a2f4021c8b74e5223d02a93962391cd9feb937f092b859607d"); + FeedZipHtml(zip_buf, 65725, + "debded5e5ef7ce6700eaeecd59af6781eeb80acde6a1f38ae1"); + FeedZipHtml(zip_buf, 65750, + "64aadc7681cac28c9263dd30567c2b7edf4fec6030f1edc8c2"); + FeedZipHtml(zip_buf, 65775, + "4e220c090e922cd148e5fa4c7c69ccbab5a3ccc23a25dbeee4"); + FeedZipHtml(zip_buf, 65800, + "a68214e969188ae91920b13e4c152be6dc7d7e28680b6279f3"); + FeedZipHtml(zip_buf, 65825, + "01ba89973df97e1fdf620e6a9af9d00bc4a2653b12d5c20fc2"); + FeedZipHtml(zip_buf, 65850, + "2828fe20549f750c1408abd1e1b2a874183e0abd0460b2b82c"); + FeedZipHtml(zip_buf, 65875, + "0b11c3ba6c0ded07570a424f275c3cb363cec3d21f494d99b6"); + FeedZipHtml(zip_buf, 65900, + "f611a39682d4dfc7eee0f7cbad0ad5581b44dd17396df20480"); + FeedZipHtml(zip_buf, 65925, + "e5baa8ab58f071df4b4a7dd9ab43a997d7ddbf6eceba5717d6"); + FeedZipHtml(zip_buf, 65950, + "97dec7db37ca094c7f54235770697015f5bdc4b5a0fa7621da"); + FeedZipHtml(zip_buf, 65975, + "fd7493e2146c0cc02ee961343aa7973105753d824091c0fa6e"); + FeedZipHtml(zip_buf, 66000, + "3ad98f714978857f141c8e6f5eb1bf31bb95eee43eba6a1cb7"); + FeedZipHtml(zip_buf, 66025, + "9342da348863a1ee16826374c6e88cd119a3334667cf4067ea"); + FeedZipHtml(zip_buf, 66050, + "33b9b00de53f3ffc66762f96d3136c2bbf88e3f22e97e47b3c"); + FeedZipHtml(zip_buf, 66075, + "7aefdcb87d69c41ef86a9dc35f5e8a06ad72998691e30a91be"); + FeedZipHtml(zip_buf, 66100, + "ce8af7fede2d11af049343e351f715fcf73faad19f449bbfdd"); + FeedZipHtml(zip_buf, 66125, + "4c83c416ab5132acf3f06434b2612785a72b11ab1c52237949"); + FeedZipHtml(zip_buf, 66150, + "626abb775e09035a8231567a90ce12dd3014660534069b5798"); + FeedZipHtml(zip_buf, 66175, + "e48ab5b4312dad3e329d95d97665ae3976bd5e1eabb7840d31"); + FeedZipHtml(zip_buf, 66200, + "b4141196e341a80172333f0c0600cbe4d972ecfa44bb140653"); + FeedZipHtml(zip_buf, 66225, + "8ca72f509ce7c0913dd3e55da2cb9c13aa358c99734271e439"); + FeedZipHtml(zip_buf, 66250, + "479e2f761224b7a946d2b06c0d226a8257efb7445bc0ab5901"); + FeedZipHtml(zip_buf, 66275, + "2dbf26cc7adaa09e5ac3b30a77826b8483311f633ec67770f7"); + FeedZipHtml(zip_buf, 66300, + "958c31136226d42c13da532cd2140dda5371b68403b1f4b780"); + FeedZipHtml(zip_buf, 66325, + "00b19298fdf04913331b6636cc6c98d930b36984d9e85aef3b"); + FeedZipHtml(zip_buf, 66350, + "19ffb2ce82f06d2056accd556973e3a895b5bfcfdaaf153ec7"); + FeedZipHtml(zip_buf, 66375, + "26c226b2a97059b624b6a4167851962c420bbf802c58ec62d9"); + FeedZipHtml(zip_buf, 66400, + "21174b66eed2388ff2dfc9295b20e9b9c99a9312714c534e55"); + FeedZipHtml(zip_buf, 66425, + "b9aec1b0f629cb35473cef812b8a239ed91bb627deb09d0c40"); + FeedZipHtml(zip_buf, 66450, + "dc5b6f186b73db290a6b7f9fb5bf062f061bc99e18497b1d14"); + FeedZipHtml(zip_buf, 66475, + "1585b0948f8283e0d98fc17e0c8ea76127c6524e0cf620b007"); + FeedZipHtml(zip_buf, 66500, + "615d1e0446933be33e60556e2d3160d5efadead7e438600bd9"); + FeedZipHtml(zip_buf, 66525, + "750bd95aaf017b04d823c01e01f608b047803d02ec11d88047"); + FeedZipHtml(zip_buf, 66550, + "e04318843b1f267b19d9a5f5485a40e3f75afe1b87d7acafed"); + FeedZipHtml(zip_buf, 66575, + "d2971ce3aaef9db0525bafd4c65c25acfb5dd17d7b9d206577"); + FeedZipHtml(zip_buf, 66600, + "3b4025b120542efb4176d50f42b36ece40ab1c19a97dec933b"); + FeedZipHtml(zip_buf, 66625, + "832f6aec8147832f6ab053652f9c2a3b1db5bb054e95bd94ff"); + FeedZipHtml(zip_buf, 66650, + "c6313deb6bbbf4d538b566b5b658aded65cd15a10359e2ccd7"); + FeedZipHtml(zip_buf, 66675, + "0e985c33b9e6580166d64c6b99d6ae8fd6ae16cc31636d4cb4"); + FeedZipHtml(zip_buf, 66700, + "8c935959bba3acb57055d6691b75bae544954928935026a14c"); + FeedZipHtml(zip_buf, 66725, + "42998432096512fa7c12da8dfb9e771979ce1a51da3a60da46"); + FeedZipHtml(zip_buf, 66750, + "e9270bb51e4af562dc02ce84d1030aab894059f8eb12fe11c8"); + FeedZipHtml(zip_buf, 66775, + "d7118bf1c8f6cfbd8197c4cd9284f3ee6df7f2ba773e831c74"); + FeedZipHtml(zip_buf, 66800, + "6fce7a3d0bd4cbd5d2768d06ac181aa7a6d22e805c989f72ac"); + FeedZipHtml(zip_buf, 66825, + "1bc6bd6f2d9839763098f87664612711520507499634a5727d"); + FeedZipHtml(zip_buf, 66850, + "265636e6f0da117361d5936d777253418af4340cc5f40cd0e5"); + FeedZipHtml(zip_buf, 66875, + "70982a56ccb9fbfc50d016c462e9030c152f7bf2fd3ebec51c"); + FeedZipHtml(zip_buf, 66900, + "d434f3a1178825d0762442871f845150fc41a83eeb18881656"); + FeedZipHtml(zip_buf, 66925, + "a3c36511f6307c147a09c064719117228655de1ada0fae1484"); + FeedZipHtml(zip_buf, 66950, + "9e4eb81467c79c87d83f929a326ded23de9e05b87f1fbb83df"); + FeedZipHtml(zip_buf, 66975, + "2fd719bdb365e06436e26389b6f0048735d0800bffbb00295e"); + FeedZipHtml(zip_buf, 67000, + "527ac6b03ac47d79ddfdebe6ac7b75617de97dbc7da39cf3f4"); + FeedZipHtml(zip_buf, 67025, + "47350a07e71039e7395e8c31fa12181d0ca95de87c3fddd738"); + FeedZipHtml(zip_buf, 67050, + "a11b03e34b7a7e8dcee94551c1768fe05c24788b9b4ef6635c"); + FeedZipHtml(zip_buf, 67075, + "125ee11f0547f09b57ec072eddc2f775ff6e0893eeab385b02"); + FeedZipHtml(zip_buf, 67100, + "4859fc7b8746196932d264a4c9489391e6c691a6fcec450627"); + FeedZipHtml(zip_buf, 67125, "0d69957b79173a53f1f830190989fc3fb7a47b9d"); + +// uncompressing the ZIP payload + in = zip_buf; + html = (char *) malloc(uncompressed_len + 1); + if (html == NULL) + goto error; + out = (Bytef *) html; + if (uncompress(out, &outLen, in, inLen) != Z_OK) + goto error; + *(html + uncompressed_len) = '\0'; + free(zip_buf); + html_text = wxString::FromUTF8(html); + free(html); + return; + +error: + if (zip_buf != NULL) + free(zip_buf); + if (html != NULL) + free(html); + html_text = + wxT + ("

Sorry, HTML Help is currently unavailable.

"); +} Index: LayerTree.cpp ================================================================== --- LayerTree.cpp +++ LayerTree.cpp @@ -2,11 +2,11 @@ / LayerTree.cpp / tree control to handle map layers / / version 2.0, 2017 January 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2017 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -24,10 +24,13 @@ */ #include "Classdef.h" #include "wx/imaglist.h" +#include "wx/spinctrl.h" +#include "wx/colordlg.h" +#include "wx/clipbrd.h" // // ICONs in XPM format [universally portable] // #include "icons/map_root.xpm" @@ -118,10 +121,14 @@ (wxObjectEventFunction) & MyLayerTree::OnCmdVisible); Connect(Tree_MapFullExtent, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyLayerTree::OnCmdMapFullExtent); Connect(Tree_MapLayerFullExtent, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyLayerTree::OnCmdMapLayerFullExtent); + Connect(Tree_SqlSample, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyLayerTree::OnCmdMapSqlSample); + Connect(Tree_UrlSample, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyLayerTree::OnCmdMapUrlSample); Connect(Tree_MapLayerConfigure, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyLayerTree::OnCmdMapLayerConfigure); Connect(Tree_QuickStyleEdit, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyLayerTree::OnCmdQuickStyleEdit); Connect(Tree_MapLayerInfo, wxEVT_COMMAND_MENU_SELECTED, @@ -159,10 +166,12 @@ idx = 2; else idx = 1; break; case MAP_LAYER_VECTOR: + case MAP_LAYER_VECTOR_VIEW: + case MAP_LAYER_VECTOR_SHP: switch (layer->GetGeometryType()) { case 1: case 1001: case 2001: @@ -237,11 +246,13 @@ // // adds a layer to the TREE list // wxTreeItemId item; wxString name = layer->GetDbPrefix(); - if (layer->GetType() == MAP_LAYER_VECTOR) + if (layer->GetType() == MAP_LAYER_VECTOR + || layer->GetType() == MAP_LAYER_VECTOR_VIEW + || layer->GetType() == MAP_LAYER_VECTOR_SHP) name += wxT(".") + layer->GetVectorPrefix(); name += wxT(".") + layer->GetName(); if (GetChildrenCount(Root) == 0) item = AppendItem(Root, name, 1); else @@ -413,10 +424,19 @@ menu.AppendSeparator(); menuItem = new wxMenuItem(&menu, Tree_MapLayerFullExtent, wxT("Zoom to Full Extent")); menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = new wxMenuItem(&menu, Tree_SqlSample, wxT("SQL sample")); + menu.Append(menuItem); + if (layer->GetType() == MAP_LAYER_WMS) + { + menuItem = + new wxMenuItem(&menu, Tree_UrlSample, wxT("Request URL sample")); + menu.Append(menuItem); + } menu.AppendSeparator(); menuItem = new wxMenuItem(&menu, Tree_MapLayerInfo, wxT("Metadata")); menu.Append(menuItem); menuItem = new wxMenuItem(&menu, Tree_MapLayerConfigure, wxT("Configure")); @@ -460,10 +480,98 @@ if (obj == NULL) return; MapLayer *layer = obj->GetLayer(); MapPanel->SetMapLayerToFullExtent(layer); } + +void MyLayerTree::OnCmdMapSqlSample(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - showing an SQL sample corresponding to the current Map settings +// + MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); + if (obj == NULL) + return; + MapLayer *layer = obj->GetLayer(); + switch (layer->GetType()) + { + case MAP_LAYER_WMS: + DoWmsSqlSample(layer); + break; + case MAP_LAYER_VECTOR: + case MAP_LAYER_VECTOR_VIEW: + case MAP_LAYER_VECTOR_SHP: + DoVectorSqlSample(layer); + break; + case MAP_LAYER_TOPOLOGY: + case MAP_LAYER_NETWORK: + DoVectorSqlSample(layer); + break; + case MAP_LAYER_RASTER: + DoRasterSqlSample(layer); + break; + } +} + +void MyLayerTree::OnCmdMapUrlSample(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - showing a Request URL sample corresponding to the current Map settings +// + MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); + if (obj == NULL) + return; + MapLayer *layer = obj->GetLayer(); + if (layer->GetType() != MAP_LAYER_WMS) + return; + DoWmsUrlSample(layer); +} + +void MyLayerTree::DoWmsSqlSample(MapLayer * lyr) +{ +// +// WMS - showing an SQL sample corresponding to the current Map settings +// + WmsLayerSettings *conf = lyr->GetWmsConfig(); + WmsSqlSampleDialog dlg; + dlg.Create(MapPanel, lyr); + dlg.ShowModal(); +} + +void MyLayerTree::DoWmsUrlSample(MapLayer * lyr) +{ +// +// WMS - showing a Request URL sample corresponding to the current Map settings +// + WmsLayerSettings *conf = lyr->GetWmsConfig(); + WmsSqlSampleDialog dlg; + dlg.Create(MapPanel, lyr, true); + dlg.ShowModal(); +} + +void MyLayerTree::DoVectorSqlSample(MapLayer * lyr) +{ +// +// Vector - showing an SQL sample corresponding to the current Map settings +// +//fprintf(stderr, "Vector SQL\n"); + VectorLayerConfig *conf = lyr->GetVectorConfig(); + VectorSqlSampleDialog dlg; + dlg.Create(MapPanel, lyr); + dlg.ShowModal(); +} + +void MyLayerTree::DoRasterSqlSample(MapLayer * lyr) +{ +// +// Raster - showing an SQL sample corresponding to the current Map settings +// + RasterLayerConfig *conf = lyr->GetRasterConfig(); + RasterSqlSampleDialog dlg; + dlg.Create(MapPanel, lyr); + dlg.ShowModal(); +} void MyLayerTree::OnCmdRemoveLayer(wxCommandEvent & WXUNUSED(event)) { // // menu event - removing some Map layer (Step #1) @@ -748,11 +856,10 @@ // MapLayerObject *obj = (MapLayerObject *) GetItemData(CurrentItem); if (obj == NULL) return; MapLayer *layer = obj->GetLayer(); - bool bboxChanged = false; bool configChanged = false; if (layer->GetType() == MAP_LAYER_VECTOR || layer->GetType() == MAP_LAYER_VECTOR_VIEW || layer->GetType() == MAP_LAYER_VECTOR_SHP) { @@ -767,10 +874,18 @@ || layer->GetType() == MAP_LAYER_NETWORK) { QuickStyleTopologyDialog dlg; dlg.Create(MapPanel, layer); int ret = dlg.ShowModal(); + if (ret == wxID_OK) + configChanged = dlg.ConfigChanged(); + } + if (layer->GetType() == MAP_LAYER_RASTER) + { + QuickStyleRasterDialog dlg; + dlg.Create(MapPanel, layer); + int ret = dlg.ShowModal(); if (ret == wxID_OK) configChanged = dlg.ConfigChanged(); } if (configChanged == true) MapPanel->RefreshMap(); @@ -804,11 +919,13 @@ // // creating the new node // wxTreeItemId position; wxString name = layer->GetDbPrefix(); - if (layer->GetType() == MAP_LAYER_VECTOR) + if (layer->GetType() == MAP_LAYER_VECTOR + || layer->GetType() == MAP_LAYER_VECTOR_VIEW + || layer->GetType() == MAP_LAYER_VECTOR_SHP) name += wxT(".") + layer->GetVectorPrefix(); name += wxT(".") + layer->GetName(); wxColour color(0, 0, 0); int idx = GetIconIndex(layer); if (layer->IsVisible() == false) @@ -904,11 +1021,12 @@ wxDefaultSize); wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *sridList = new wxComboBox(this, ID_RASTER_SRID, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateSRIDs(sridList); sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, wxT("Style"), wxDefaultPosition, @@ -915,11 +1033,12 @@ wxDefaultSize); wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *stlList = new wxComboBox(this, ID_RASTER_STYLE, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateStyles(stlList); stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); wxButton *rst_ok = new wxButton(this, ID_RASTER_OK, wxT("&Apply Changes")); @@ -971,17 +1090,17 @@ "SELECT s.srid, y.ref_sys_name FROM \"%s\".raster_coverages AS r " "JOIN \"%s\".raster_coverages_srid AS s ON (s.coverage_name = r.coverage_name) " "JOIN \"%s\".spatial_ref_sys AS y ON (s.srid = y.srid) " "WHERE r.coverage_name = %Q AND " "s.extent_miny IS NOT NULL AND s.extent_maxx IS NOT NULL AND " - "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, layer, - xdb_prefix, xdb_prefix, xdb_prefix, layer); + "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, + layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1012,20 +1131,22 @@ strcpy(db_prefix, DbPrefix.ToUTF8()); char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); free(db_prefix); char *layer = (char *) malloc((LayerName.Len() * 4) + 1); strcpy(layer, LayerName.ToUTF8()); - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".raster_coverages AS r " - "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " - "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " - "WHERE r.coverage_name = %Q ORDER BY s.style_name", - xdb_prefix, xdb_prefix, xdb_prefix, layer); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".raster_coverages AS r " + "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1036,16 +1157,23 @@ has_default = 1; wxString str = wxString::FromUTF8(style); stlList->Append(str); } sqlite3_free_table(results); + + QuickStyleRasterObj *quickStyle = Layer->GetQuickStyleRaster(); + if (quickStyle != NULL) + { + wxString str = wxString::FromUTF8(quickStyle->GetUUID()); + stlList->Append(str); + } if (!has_default) stlList->Append(wxT("default")); if (stlList->GetSelection() == wxNOT_FOUND) { - for (int i = 0; i < stlList->GetCount(); i++) + for (int i = 0; i < (int) stlList->GetCount(); i++) { if (Style == NULL) { if (stlList->GetString(i).Cmp(wxT("default")) == 0) stlList->SetSelection(i); @@ -1180,11 +1308,12 @@ wxDefaultSize); wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *sridList = new wxComboBox(this, ID_VECTOR_SRID, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateSRIDs(sridList); sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, wxT("Style"), wxDefaultPosition, @@ -1191,11 +1320,12 @@ wxDefaultSize); wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *stlList = new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateStyles(stlList); stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); wxButton *rst_ok = new wxButton(this, ID_VECTOR_OK, wxT("&Apply Changes")); @@ -1267,12 +1397,12 @@ "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1321,12 +1451,12 @@ "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1373,12 +1503,12 @@ "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1424,12 +1554,12 @@ "virt_name, virt_geometry, topology_name, network_name FROM \"%s\".vector_coverages " "WHERE coverage_name = %Q", xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return MAP_LAYER_UNKNOWN; for (int i = 1; i <= rows; i++) @@ -1489,20 +1619,22 @@ strcpy(db_prefix, DbPrefix.ToUTF8()); char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); free(db_prefix); char *layer = (char *) malloc((LayerName.Len() * 4) + 1); strcpy(layer, LayerName.ToUTF8()); - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " - "WHERE r.coverage_name = %Q ORDER BY s.style_name", - xdb_prefix, xdb_prefix, xdb_prefix, layer); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1525,11 +1657,11 @@ if (!has_default) stlList->Append(wxT("default")); if (stlList->GetSelection() == wxNOT_FOUND) { - for (int i = 0; i < stlList->GetCount(); i++) + for (int i = 0; i < (int) stlList->GetCount(); i++) { if (Style == NULL) { if (stlList->GetString(i).Cmp(wxT("default")) == 0) stlList->SetSelection(i); @@ -1665,11 +1797,12 @@ wxDefaultSize); wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *sridList = new wxComboBox(this, ID_TOPOGEO_SRID, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateSRIDs(sridList); sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, wxT("Style"), wxDefaultPosition, @@ -1676,11 +1809,12 @@ wxDefaultSize); wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *stlList = new wxComboBox(this, ID_TOPOGEO_STYLE, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateStyles(stlList); stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); // third row: Primitives Visibility wxStaticBox *visBox = new wxStaticBox(this, wxID_STATIC, wxT("TopoGeo Primitives Visibility"), @@ -1707,16 +1841,18 @@ wxDefaultPosition, wxDefaultSize); nodeCtrl->SetValue(config->AreNodesVisible()); vis1BoxSizer->Add(nodeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxCheckBox *faceSeedCtrl = new wxCheckBox(this, ID_TOPOGEO_FACE_SEED, wxT("FaceSeeds"), - wxDefaultPosition, wxDefaultSize); + wxDefaultPosition, + wxDefaultSize); faceSeedCtrl->SetValue(config->AreFaceSeedsVisible()); vis2BoxSizer->Add(faceSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxCheckBox *edgeSeedCtrl = new wxCheckBox(this, ID_TOPOGEO_EDGE_SEED, wxT("EdgeSeeds"), - wxDefaultPosition, wxDefaultSize); + wxDefaultPosition, + wxDefaultSize); edgeSeedCtrl->SetValue(config->AreEdgeSeedsVisible()); vis2BoxSizer->Add(edgeSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); // Apply/Quit buttons wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); @@ -1775,12 +1911,12 @@ "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1811,20 +1947,22 @@ strcpy(db_prefix, DbPrefix.ToUTF8()); char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); free(db_prefix); char *layer = (char *) malloc((LayerName.Len() * 4) + 1); strcpy(layer, LayerName.ToUTF8()); - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " - "WHERE r.coverage_name = %Q ORDER BY s.style_name", - xdb_prefix, xdb_prefix, xdb_prefix, layer); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -1847,11 +1985,11 @@ if (!has_default) stlList->Append(wxT("default")); if (stlList->GetSelection() == wxNOT_FOUND) { - for (int i = 0; i < stlList->GetCount(); i++) + for (int i = 0; i < (int) stlList->GetCount(); i++) { if (Style == NULL) { if (stlList->GetString(i).Cmp(wxT("default")) == 0) stlList->SetSelection(i); @@ -2028,11 +2166,12 @@ wxDefaultSize); wxBoxSizer *sridBoxSizer = new wxStaticBoxSizer(sridBox, wxVERTICAL); xxSizer->Add(sridBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *sridList = new wxComboBox(this, ID_TOPONET_SRID, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateSRIDs(sridList); sridBoxSizer->Add(sridList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, wxT("Style"), wxDefaultPosition, @@ -2039,11 +2178,12 @@ wxDefaultSize); wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); wxComboBox *stlList = new wxComboBox(this, ID_TOPONET_STYLE, wxT(""), wxDefaultPosition, - wxSize(350, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); PopulateStyles(stlList); stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); // third row: Primitives Visibility wxStaticBox *visBox = new wxStaticBox(this, wxID_STATIC, wxT("TopoNet Primitives Visibility"), @@ -2066,11 +2206,12 @@ wxDefaultPosition, wxDefaultSize); nodeCtrl->SetValue(config->AreNodesVisible()); vis1BoxSizer->Add(nodeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxCheckBox *linkSeedCtrl = new wxCheckBox(this, ID_TOPONET_LINK_SEED, wxT("LinkSeeds"), - wxDefaultPosition, wxDefaultSize); + wxDefaultPosition, + wxDefaultSize); linkSeedCtrl->SetValue(config->AreLinkSeedsVisible()); vis2BoxSizer->Add(linkSeedCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); // Apply/Quit buttons wxBoxSizer *buttonSizer = new wxBoxSizer(wxVERTICAL); rstSizer->Add(buttonSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); @@ -2129,12 +2270,12 @@ "s.extent_maxx IS NOT NULL ORDER BY s.srid", xdb_prefix, xdb_prefix, xdb_prefix, layer, xdb_prefix, xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -2165,20 +2306,22 @@ strcpy(db_prefix, DbPrefix.ToUTF8()); char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); free(db_prefix); char *layer = (char *) malloc((LayerName.Len() * 4) + 1); strcpy(layer, LayerName.ToUTF8()); - sql = sqlite3_mprintf("SELECT s.style_name FROM \"%s\".vector_coverages AS r " - "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " - "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " - "WHERE r.coverage_name = %Q ORDER BY s.style_name", - xdb_prefix, xdb_prefix, xdb_prefix, layer); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); free(layer); free(xdb_prefix); ret = - sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, - NULL); + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) return; for (int i = 1; i <= rows; i++) @@ -2201,11 +2344,11 @@ if (!has_default) stlList->Append(wxT("default")); if (stlList->GetSelection() == wxNOT_FOUND) { - for (int i = 0; i < stlList->GetCount(); i++) + for (int i = 0; i < (int) stlList->GetCount(); i++) { if (Style == NULL) { if (stlList->GetString(i).Cmp(wxT("default")) == 0) stlList->SetSelection(i); @@ -2300,5 +2443,1981 @@ Style = (char *) malloc((stl.Len() * 4) + 1); strcpy(Style, stl.ToUTF8()); DoConfigureMapLayer(); wxDialog::EndModal(wxID_OK); } + +bool VectorSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + BgColor = wxColour(255, 255, 255); + if (wxDialog::Create + (parent, wxID_ANY, wxT("SQL sample: Map Request configuration")) == false) + return false; +// populates individual controls + InitData(); + CreateControls(); +// sets dialog sizer + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); +// centers the dialog window + Centre(); + DoUpdateSql(); + return true; +} + +void VectorSqlSampleDialog::CreateControls() +{ +// +// creating individual control and setting initial values +// + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + this->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// First row: Layer name + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, + wxT("Layer FullName"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString fullName = DbPrefix + wxT(".") + LayerName; + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_VECTOR_LAYER, fullName, + wxDefaultPosition, wxSize(470, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Second row: Vector options + wxBoxSizer *rstSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(rstSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *xxSizer = new wxBoxSizer(wxVERTICAL); + rstSizer->Add(xxSizer, 0, wxALIGN_TOP | wxALL, 5); +// Style + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, + wxT("Style"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); + xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxComboBox *stlList = + new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); + PopulateStyles(stlList); + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// Third row: Image options + wxBoxSizer *imageSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(imageSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// MIME type + wxString mime[4]; + mime[0] = wxT("&PNG"); + mime[1] = wxT("&JPEG"); + mime[2] = wxT("&TIFF"); + mime[3] = wxT("PDF"); + wxRadioBox *mimeBox = new wxRadioBox(this, ID_MIME_TYPE, + wxT("&MIME Type"), + wxDefaultPosition, + wxDefaultSize, 4, + mime, 2, + wxRA_SPECIFY_COLS); + imageSizer->Add(mimeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + mimeBox->SetSelection(0); +// image Quality + wxStaticBox *qtyBox = new wxStaticBox(this, wxID_STATIC, + wxT("Quality"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *qtyBoxSizer = new wxStaticBoxSizer(qtyBox, wxVERTICAL); + imageSizer->Add(qtyBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxSlider *qualityCtrl = new wxSlider(this, ID_IMAGE_QUALITY, 85, 0, 100, + wxDefaultPosition, wxSize(100, 50), + wxSL_HORIZONTAL | wxSL_LABELS); + qtyBoxSizer->Add(qualityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + qualityCtrl->Enable(false); +// Map background + wxStaticBox *bgBox = new wxStaticBox(this, wxID_STATIC, + wxT("Map Background"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *bg1Sizer = new wxStaticBoxSizer(bgBox, wxVERTICAL); + imageSizer->Add(bg1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *bg2Sizer = new wxBoxSizer(wxHORIZONTAL); + bg1Sizer->Add(bg2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxCheckBox *checkeredCtrl = + new wxCheckBox(this, ID_MAPOPT_CHECKERED_BACKGROUND, + wxT("&Transparent"), + wxDefaultPosition, wxDefaultSize); + checkeredCtrl->SetValue(true); + bg2Sizer->Add(checkeredCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, + wxT("Background Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); + bg2Sizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bgColorBmp; + GetButtonBitmap(BgColor, bgColorBmp); + wxBitmapButton *bgColorCtrl = + new wxBitmapButton(this, ID_MAPOPT_SOLID_BACKGROUND, bgColorBmp); + bgColorCtrl->Enable(false); + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// SQL sample + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, + wxT("SQL sample"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); + boxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, + wxDefaultPosition, wxSize(470, 100), + wxTE_MULTILINE | wxTE_WORDWRAP | + wxTE_READONLY); + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// buttons + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *rst_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); + buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); + buttonSizer->Add(rst_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// appends event handlers + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnCopy); + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnQuit); + Connect(ID_VECTOR_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnStyleChanged); + Connect(ID_MIME_TYPE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnMimeTypeChanged); + Connect(ID_IMAGE_QUALITY, wxEVT_SLIDER, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnQualityChanged); + Connect(ID_MAPOPT_CHECKERED_BACKGROUND, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + VectorSqlSampleDialog::OnTransparentChanged); + Connect(ID_MAPOPT_SOLID_BACKGROUND, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & VectorSqlSampleDialog::OnBackgroundChanged); +} + +void VectorSqlSampleDialog::GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp) +{ +// creating a Bitmap representing some Color + bmp = wxBitmap(96, 18); + wxMemoryDC *dc = new wxMemoryDC(bmp); + dc->SetBrush(wxBrush(bgcolor)); + dc->DrawRectangle(-1, -1, 98, 20); + delete dc; +} + +void VectorSqlSampleDialog::InitData() +{ +// initializing the current configuration + int len; + VectorLayerConfig *config = Layer->GetVectorConfig(); + Style = NULL; + if (config->GetStyle() != NULL) + { + len = strlen(config->GetStyle()); + Style = (char *) malloc(len + 1); + strcpy(Style, config->GetStyle()); + } +} + +void VectorSqlSampleDialog::PopulateStyles(wxComboBox * stlList) +{ +// populating the Styles List + int ret; + char *sql; + char **results; + int rows; + int columns; + int has_default = 0; + + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".vector_coverages AS r " + "JOIN \"%s\".SE_vector_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_vector_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // populating the list + const char *style = results[(i * columns) + 0]; + if (strcasecmp(style, "default") == 0) + has_default = 1; + wxString str = wxString::FromUTF8(style); + stlList->Append(str); + } + sqlite3_free_table(results); + + if (!has_default) + stlList->Append(wxT("default")); + if (stlList->GetSelection() == wxNOT_FOUND) + { + for (int i = 0; i < (int) stlList->GetCount(); i++) + { + if (Style == NULL) + { + if (stlList->GetString(i).Cmp(wxT("default")) == 0) + stlList->SetSelection(i); + } else + { + if (stlList->GetString(i).Cmp(wxString::FromUTF8(Style)) == 0) + stlList->SetSelection(i); + } + } + } + if (stlList->GetSelection() == wxNOT_FOUND) + { + // the current Style probably is a QuickStyle + free(Style); + Style = NULL; + for (int i = 0; i < (int) stlList->GetCount(); i++) + { + if (stlList->GetString(i).Cmp(wxT("default")) == 0) + stlList->SetSelection(i); + } + } +} + +void VectorSqlSampleDialog::DoUpdateSql() +{ +// +// updating the SQL query +// + char *str; + char *buf; + wxString col; + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_VECTOR_STYLE); + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); + Sql = wxT("SELECT RL2_GetMapImageFromVector("); + if (DbPrefix.Len() == 0) + Sql += wxT("NULL, "); + else + { + str = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(str, DbPrefix.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// coverage name + str = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(str, LayerName.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// bounding box + wxString bbox; + MapPanel->DoPrepareBBox(bbox); + Sql += bbox; +// image width and height + buf = + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), + MapPanel->GetImageHeight()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// style + wxString style = stlList->GetValue(); + if (style.Len() == 0) + Sql += wxT("'default', "); + else + { + str = (char *) malloc((style.Len() * 4) + 1); + strcpy(str, style.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// MIME type + switch (mimeBox->GetSelection()) + { + case 1: + Sql += wxT("'image/jpeg', "); + break; + case 2: + Sql += wxT("'image/tiff', "); + break; + case 3: + Sql += wxT("'application/x-pdf', "); + break; + default: + Sql += wxT("'image/png', "); + break; + }; +// bgColor + buf = + sqlite3_mprintf("'#%02x%02x%02x', ", BgColor.Red(), BgColor.Green(), + BgColor.Blue()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// transparent + if (transparentCtrl->GetValue()) + Sql += wxT("1, "); + else + Sql += wxT("0, "); +// quality + if (mimeBox->GetSelection() == 1) + { + buf = sqlite3_mprintf("%d", qualityCtrl->GetValue()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } else + Sql += wxT("100"); + Sql += wxT(");"); + sqlCtrl->SetValue(Sql); +} + +void VectorSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Style selection changed +// + DoUpdateSql(); +} + +void VectorSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// MIME Type selection changed +// + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); + if (mimeBox->GetSelection() == 1) + qualityCtrl->Enable(true); + else + qualityCtrl->Enable(false); + DoUpdateSql(); +} + +void VectorSqlSampleDialog::OnQualityChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Image Quality selection changed +// + DoUpdateSql(); +} + +void + VectorSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Transparent Background selection changed +// + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); + wxBitmapButton *btn = + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); + if (transparentCtrl->GetValue() == false) + btn->Enable(true); + else + btn->Enable(false); + DoUpdateSql(); +} + +void + VectorSqlSampleDialog::OnBackgroundChanged(wxCommandEvent & WXUNUSED(event)) +{ +// Map Background Solid Color selection + wxColourData initColor; + int ret; + initColor.SetChooseFull(false); + initColor.SetColour(BgColor); + wxColourDialog colorDialog(this, &initColor); + ret = colorDialog.ShowModal(); + if (ret == wxID_OK) + { + wxColourData colorData = colorDialog.GetColourData(); + BgColor = colorData.GetColour(); + wxBitmap bmp; + GetButtonBitmap(BgColor, bmp); + wxBitmapButton *btn = + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); + btn->SetBitmapLabel(bmp); + DoUpdateSql(); + } +} + +void VectorSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Map Request (SQL statement) +// + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(Sql)); + wxTheClipboard->Close(); + } +} + +void VectorSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} + +bool RasterSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + BgColor = wxColour(255, 255, 255); + if (wxDialog::Create + (parent, wxID_ANY, wxT("SQL sample: Map Request configuration")) == false) + return false; +// populates individual controls + InitData(); + CreateControls(); +// sets dialog sizer + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); +// centers the dialog window + Centre(); + DoUpdateSql(); + return true; +} + +void RasterSqlSampleDialog::CreateControls() +{ +// +// creating individual control and setting initial values +// + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + this->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// First row: Layer name + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, + wxT("Layer FullName"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString fullName = DbPrefix + wxT(".") + LayerName; + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_VECTOR_LAYER, fullName, + wxDefaultPosition, wxSize(470, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Second row: Raster options + wxBoxSizer *rstSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(rstSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *xxSizer = new wxBoxSizer(wxVERTICAL); + rstSizer->Add(xxSizer, 0, wxALIGN_TOP | wxALL, 5); +// Style + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, + wxT("Style"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); + xxSizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxComboBox *stlList = + new wxComboBox(this, ID_VECTOR_STYLE, wxT(""), wxDefaultPosition, + wxSize(350, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); + PopulateStyles(stlList); + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// Third row: Image options + wxBoxSizer *imageSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(imageSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// MIME type + wxString mime[4]; + mime[0] = wxT("&PNG"); + mime[1] = wxT("&JPEG"); + mime[2] = wxT("&TIFF"); + mime[3] = wxT("PDF"); + wxRadioBox *mimeBox = new wxRadioBox(this, ID_MIME_TYPE, + wxT("&MIME Type"), + wxDefaultPosition, + wxDefaultSize, 4, + mime, 2, + wxRA_SPECIFY_COLS); + imageSizer->Add(mimeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + mimeBox->SetSelection(0); +// image Quality + wxStaticBox *qtyBox = new wxStaticBox(this, wxID_STATIC, + wxT("Quality"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *qtyBoxSizer = new wxStaticBoxSizer(qtyBox, wxVERTICAL); + imageSizer->Add(qtyBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxSlider *qualityCtrl = new wxSlider(this, ID_IMAGE_QUALITY, 85, 0, 100, + wxDefaultPosition, wxSize(100, 50), + wxSL_HORIZONTAL | wxSL_LABELS); + qtyBoxSizer->Add(qualityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + qualityCtrl->Enable(false); +// Map background + wxStaticBox *bgBox = new wxStaticBox(this, wxID_STATIC, + wxT("Map Background"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *bg1Sizer = new wxStaticBoxSizer(bgBox, wxVERTICAL); + imageSizer->Add(bg1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *bg2Sizer = new wxBoxSizer(wxHORIZONTAL); + bg1Sizer->Add(bg2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxCheckBox *checkeredCtrl = + new wxCheckBox(this, ID_MAPOPT_CHECKERED_BACKGROUND, + wxT("&Transparent"), + wxDefaultPosition, wxDefaultSize); + checkeredCtrl->SetValue(true); + bg2Sizer->Add(checkeredCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, + wxT("Background Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); + bg2Sizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bgColorBmp; + GetButtonBitmap(BgColor, bgColorBmp); + wxBitmapButton *bgColorCtrl = + new wxBitmapButton(this, ID_MAPOPT_SOLID_BACKGROUND, bgColorBmp); + bgColorCtrl->Enable(false); + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// SQL sample + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, + wxT("SQL sample"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); + boxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, + wxDefaultPosition, wxSize(470, 100), + wxTE_MULTILINE | wxTE_WORDWRAP | + wxTE_READONLY); + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// buttons + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *rst_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); + buttonSizer->Add(rst_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxButton *rst_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); + buttonSizer->Add(rst_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// appends event handlers + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnCopy); + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnQuit); + Connect(ID_VECTOR_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnStyleChanged); + Connect(ID_MIME_TYPE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnMimeTypeChanged); + Connect(ID_IMAGE_QUALITY, wxEVT_SLIDER, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnQualityChanged); + Connect(ID_MAPOPT_CHECKERED_BACKGROUND, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + RasterSqlSampleDialog::OnTransparentChanged); + Connect(ID_MAPOPT_SOLID_BACKGROUND, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & RasterSqlSampleDialog::OnBackgroundChanged); +} + +void RasterSqlSampleDialog::GetButtonBitmap(wxColour & bgcolor, wxBitmap & bmp) +{ +// creating a Bitmap representing some Color + bmp = wxBitmap(96, 18); + wxMemoryDC *dc = new wxMemoryDC(bmp); + dc->SetBrush(wxBrush(bgcolor)); + dc->DrawRectangle(-1, -1, 98, 20); + delete dc; +} + +void RasterSqlSampleDialog::InitData() +{ +// initializing the current configuration + int len; + RasterLayerConfig *config = Layer->GetRasterConfig(); + Style = NULL; + if (config->GetStyle() != NULL) + { + len = strlen(config->GetStyle()); + Style = (char *) malloc(len + 1); + strcpy(Style, config->GetStyle()); + } +} + +void RasterSqlSampleDialog::PopulateStyles(wxComboBox * stlList) +{ +// populating the Styles List + int ret; + char *sql; + char **results; + int rows; + int columns; + int has_default = 0; + + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = + sqlite3_mprintf + ("SELECT s.style_name FROM \"%s\".raster_coverages AS r " + "JOIN \"%s\".SE_raster_styled_layers AS x ON (x.coverage_name = r.coverage_name) " + "JOIN \"%s\".SE_raster_styles AS s ON (s.style_id = x.style_id) " + "WHERE r.coverage_name = %Q ORDER BY s.style_name", xdb_prefix, + xdb_prefix, xdb_prefix, layer); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // populating the list + const char *style = results[(i * columns) + 0]; + if (strcasecmp(style, "default") == 0) + has_default = 1; + wxString str = wxString::FromUTF8(style); + stlList->Append(str); + } + sqlite3_free_table(results); + + if (!has_default) + stlList->Append(wxT("default")); + if (stlList->GetSelection() == wxNOT_FOUND) + { + for (int i = 0; i < (int) stlList->GetCount(); i++) + { + if (Style == NULL) + { + if (stlList->GetString(i).Cmp(wxT("default")) == 0) + stlList->SetSelection(i); + } else + { + if (stlList->GetString(i).Cmp(wxString::FromUTF8(Style)) == 0) + stlList->SetSelection(i); + } + } + } + if (stlList->GetSelection() == wxNOT_FOUND) + { + // the current Style probably is a QuickStyle + free(Style); + Style = NULL; + for (int i = 0; i < (int) stlList->GetCount(); i++) + { + if (stlList->GetString(i).Cmp(wxT("default")) == 0) + stlList->SetSelection(i); + } + } +} + +void RasterSqlSampleDialog::DoUpdateSql() +{ +// +// updating the SQL query +// + char *str; + char *buf; + wxString col; + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_VECTOR_STYLE); + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); + Sql = wxT("SELECT RL2_GetMapImageFromRaster("); + if (DbPrefix.Len() == 0) + Sql += wxT("NULL, "); + else + { + str = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(str, DbPrefix.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// coverage name + str = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(str, LayerName.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// bounding box + wxString bbox; + MapPanel->DoPrepareBBox(bbox); + Sql += bbox; +// image width and height + buf = + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), + MapPanel->GetImageHeight()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// style + wxString style = stlList->GetValue(); + if (style.Len() == 0) + Sql += wxT("'default', "); + else + { + str = (char *) malloc((style.Len() * 4) + 1); + strcpy(str, style.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// MIME type + switch (mimeBox->GetSelection()) + { + case 1: + Sql += wxT("'image/jpeg', "); + break; + case 2: + Sql += wxT("'image/tiff', "); + break; + case 3: + Sql += wxT("'application/x-pdf', "); + break; + default: + Sql += wxT("'image/png', "); + break; + }; +// bgColor + buf = + sqlite3_mprintf("'#%02x%02x%02x', ", BgColor.Red(), BgColor.Green(), + BgColor.Blue()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// transparent + if (transparentCtrl->GetValue()) + Sql += wxT("1, "); + else + Sql += wxT("0, "); +// quality + if (mimeBox->GetSelection() == 1) + { + buf = sqlite3_mprintf("%d", qualityCtrl->GetValue()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } else + Sql += wxT("100"); + Sql += wxT(");"); + sqlCtrl->SetValue(Sql); +} + +void RasterSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Style selection changed +// + DoUpdateSql(); +} + +void RasterSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// MIME Type selection changed +// + wxRadioBox *mimeBox = (wxRadioBox *) FindWindow(ID_MIME_TYPE); + wxSlider *qualityCtrl = (wxSlider *) FindWindow(ID_IMAGE_QUALITY); + if (mimeBox->GetSelection() == 1) + qualityCtrl->Enable(true); + else + qualityCtrl->Enable(false); + DoUpdateSql(); +} + +void RasterSqlSampleDialog::OnQualityChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Image Quality selection changed +// + DoUpdateSql(); +} + +void + RasterSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Transparent Background selection changed +// + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_MAPOPT_CHECKERED_BACKGROUND); + wxBitmapButton *btn = + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); + if (transparentCtrl->GetValue() == false) + btn->Enable(true); + else + btn->Enable(false); + DoUpdateSql(); +} + +void + RasterSqlSampleDialog::OnBackgroundChanged(wxCommandEvent & WXUNUSED(event)) +{ +// Map Background Solid Color selection + wxColourData initColor; + int ret; + initColor.SetChooseFull(false); + initColor.SetColour(BgColor); + wxColourDialog colorDialog(this, &initColor); + ret = colorDialog.ShowModal(); + if (ret == wxID_OK) + { + wxColourData colorData = colorDialog.GetColourData(); + BgColor = colorData.GetColour(); + wxBitmap bmp; + GetButtonBitmap(BgColor, bmp); + wxBitmapButton *btn = + (wxBitmapButton *) FindWindow(ID_MAPOPT_SOLID_BACKGROUND); + btn->SetBitmapLabel(bmp); + DoUpdateSql(); + } +} + +void RasterSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Map Request (SQL statement) +// + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(Sql)); + wxTheClipboard->Close(); + } +} + +void RasterSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} + +bool + WmsSqlSampleDialog::Create(MyMapPanel * parent, MapLayer * layer, + bool request_url) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + RequestURL = request_url; + Url = wxString::FromUTF8(layer->GetWmsGetMapURL()); + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + wxString title = wxT("SQL sample: Map Request configuration"); + if (RequestURL == true) + title = wxT("URL sample: Map Request configuration"); + if (wxDialog::Create(parent, wxID_ANY, title) == false) + return false; +// populates individual controls + InitData(); + CreateControls(); +// sets dialog sizer + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); +// centers the dialog window + Centre(); + DoUpdateSql(); + return true; +} + +WmsSqlSampleDialog::~WmsSqlSampleDialog() +{ + if (Version != NULL) + free(Version); + if (MaxVersion != NULL) + free(MaxVersion); + if (Style != NULL) + free(Style); + if (ImageFormat != NULL) + free(ImageFormat); + if (BgColor != NULL) + free(BgColor); +} + +void WmsSqlSampleDialog::CreateControls() +{ +// +// creating individual control and setting initial values +// + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + this->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// First row: URL + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *urlSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(urlSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *urlBox = new wxStaticBox(this, wxID_ANY, + wxT("WMS GetMap URL"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *urlBoxSizer = new wxStaticBoxSizer(urlBox, wxHORIZONTAL); + urlSizer->Add(urlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *urlCtrl = new wxTextCtrl(this, ID_WMS_URL, Url, + wxDefaultPosition, wxSize(800, 22), + wxTE_READONLY); + urlBoxSizer->Add(urlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Second row: WMS options + wxBoxSizer *optsSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(optsSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// WMS version + wxBoxSizer *wmsSizer = new wxBoxSizer(wxHORIZONTAL); + optsSizer->Add(wmsSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString ver[4]; + ver[0] = wxT("WMS &1.0.0"); + ver[1] = wxT("WMS &1.1.0"); + ver[2] = wxT("WMS &1.1.1"); + ver[3] = wxT("WMS &1.3.0"); + wxRadioBox *versionBox = new wxRadioBox(this, ID_WMS_VERSION, + wxT("WMS &Version"), + wxDefaultPosition, + wxDefaultSize, 4, + ver, 4, + wxRA_SPECIFY_ROWS); + FindMaxVersion(); + if (MaxVersion == NULL) + { + versionBox->Enable(1, false); + versionBox->Enable(2, false); + versionBox->Enable(3, false); + } else + { + if (strcmp(MaxVersion, "1.1.0") == 0) + { + versionBox->Enable(2, false); + versionBox->Enable(3, false); + } else if (strcmp(MaxVersion, "1.1.1") == 0) + { + versionBox->Enable(3, false); + } else if (strcmp(MaxVersion, "1.3.0") == 0) + ; + else + { + versionBox->Enable(1, false); + versionBox->Enable(2, false); + versionBox->Enable(3, false); + } + } + if (strcmp(Version, "1.0.0") == 0) + versionBox->SetSelection(0); + else if (strcmp(Version, "1.1.0") == 0) + versionBox->SetSelection(1); + else if (strcmp(Version, "1.1.1") == 0) + versionBox->SetSelection(2); + else + versionBox->SetSelection(3); + wmsSizer->Add(versionBox, 0, wxALIGN_TOP | wxALL, 5); +// layer Name + wxBoxSizer *opt2Sizer = new wxBoxSizer(wxVERTICAL); + optsSizer->Add(opt2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *nameSizer = new wxBoxSizer(wxHORIZONTAL); + opt2Sizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *nameBox = new wxStaticBox(this, wxID_ANY, + wxT("Layer Name"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_WMS_LAYER, LayerName, + wxDefaultPosition, wxSize(420, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Style + wxBoxSizer *opt3Sizer = new wxBoxSizer(wxHORIZONTAL); + opt2Sizer->Add(opt3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *stlBox = new wxStaticBox(this, wxID_STATIC, + wxT("Style"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *stlBoxSizer = new wxStaticBoxSizer(stlBox, wxVERTICAL); + opt3Sizer->Add(stlBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxComboBox *stlList = + new wxComboBox(this, ID_WMS_STYLE, wxT(""), wxDefaultPosition, + wxSize(250, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); + PopulateStyles(stlList); + stlBoxSizer->Add(stlList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// image format + wxStaticBox *fmtBox = new wxStaticBox(this, wxID_STATIC, + wxT("Image Format"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *fmtBoxSizer = new wxStaticBoxSizer(fmtBox, wxVERTICAL); + opt3Sizer->Add(fmtBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxComboBox *fmtList = + new wxComboBox(this, ID_WMS_FORMAT, wxT(""), wxDefaultPosition, + wxSize(150, 21), 0, NULL, + wxCB_DROPDOWN | wxCB_READONLY); + PopulateImageFormats(fmtList); + fmtBoxSizer->Add(fmtList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// transparent / background color + wxStaticBox *bgColorBox = new wxStaticBox(this, wxID_ANY, + wxT("Background Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *bgColorBoxSizer = new wxStaticBoxSizer(bgColorBox, wxHORIZONTAL); + optsSizer->Add(bgColorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxCheckBox *enableBgColorCtrl = new wxCheckBox(this, ID_WMS_ENABLE_BGCOLOR, + wxT("Transparent"), + wxDefaultPosition, + wxDefaultSize); + if (BgColor == NULL) + { + Transparent = 1; + enableBgColorCtrl->SetValue(true); + } else + { + Transparent = 0; + enableBgColorCtrl->SetValue(false); + } + bgColorBoxSizer->Add(enableBgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, + 5); + wxBitmap bgColorBmp; + GetButtonBitmap(BgColor, bgColorBmp); + wxBitmapButton *bgColorCtrl = + new wxBitmapButton(this, ID_WMS_BGCOLOR, bgColorBmp); + if (Transparent) + bgColorCtrl->Enable(false); + else + bgColorCtrl->Enable(true); + bgColorBoxSizer->Add(bgColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// SQL sample + wxString title = wxT("SQL sample"); + if (RequestURL == true) + title = wxT("URL sample"); + wxStaticBox *sqlBox = new wxStaticBox(this, wxID_STATIC, + title, + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sqlSizer = new wxStaticBoxSizer(sqlBox, wxVERTICAL); + lyrBoxSizer->Add(sqlSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *sqlCtrl = new wxTextCtrl(this, ID_SQL_SAMPLE, Sql, + wxDefaultPosition, wxSize(800, 70), + wxTE_MULTILINE | wxTE_WORDWRAP | + wxTE_READONLY); + sqlSizer->Add(sqlCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); + lyrBoxSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *wms_ok = new wxButton(this, ID_VECTOR_COPY, wxT("&Copy")); + buttonSizer->Add(wms_ok, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxButton *wms_quit = new wxButton(this, wxID_CANCEL, wxT("&Quit")); + buttonSizer->Add(wms_quit, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// appends event handlers + Connect(ID_VECTOR_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnCopy); + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnQuit); + Connect(ID_WMS_VERSION, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnVersionChanged); + Connect(ID_WMS_STYLE, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnStyleChanged); + Connect(ID_WMS_FORMAT, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnMimeTypeChanged); + Connect(ID_WMS_ENABLE_BGCOLOR, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnTransparentChanged); + Connect(ID_WMS_BGCOLOR, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & WmsSqlSampleDialog::OnBgColorChanged); +} + +unsigned char WmsSqlSampleDialog::ParseHex(const char *byte) +{ +// parsing an Hex Byte + unsigned char value = 0; + switch (byte[0]) + { + case '0': + value = 16 * 0; + break; + case '1': + value = 16 * 1; + break; + case '2': + value = 16 * 2; + break; + case '3': + value = 16 * 3; + break; + case '4': + value = 16 * 4; + break; + case '5': + value = 16 * 5; + break; + case '6': + value = 16 * 6; + break; + case '7': + value = 16 * 7; + break; + case '8': + value = 16 * 8; + break; + case '9': + value = 16 * 9; + break; + case 'A': + case 'a': + value = 16 * 10; + break; + case 'B': + case 'b': + value = 16 * 11; + break; + case 'C': + case 'c': + value = 16 * 12; + break; + case 'D': + case 'd': + value = 16 * 13; + break; + case 'E': + case 'e': + value = 16 * 14; + break; + case 'F': + case 'f': + value = 16 * 15; + break; + }; + switch (byte[1]) + { + case '0': + value += 0; + break; + case '1': + value += 1; + break; + case '2': + value += 2; + break; + case '3': + value += 3; + break; + case '4': + value += 4; + break; + case '5': + value += 5; + break; + case '6': + value += 6; + break; + case '7': + value += 7; + break; + case '8': + value += 8; + break; + case '9': + value += 9; + break; + case 'A': + case 'a': + value += 10; + break; + case 'B': + case 'b': + value += 11; + break; + case 'C': + case 'c': + value += 12; + break; + case 'D': + case 'd': + value += 13; + break; + case 'E': + case 'e': + value += 14; + break; + case 'F': + case 'f': + value += 15; + break; + }; + return value; +} + +void + WmsSqlSampleDialog::ParseBgColor(const char *color, unsigned char *red, + unsigned char *green, unsigned char *blue) +{ +// parsing an Hex RGB color + char byte[2]; + *red = 0x80; + *green = 0x80; + *blue = 0x80; + if (color == NULL) + return; + + byte[0] = *(color + 0); + byte[1] = *(color + 1); + *red = ParseHex(byte); + byte[0] = *(color + 2); + byte[1] = *(color + 3); + *green = ParseHex(byte); + byte[0] = *(color + 4); + byte[1] = *(color + 5); + *blue = ParseHex(byte); +} + +void WmsSqlSampleDialog::GetButtonBitmap(const char *bgcolor, wxBitmap & bmp) +{ +// creating a Bitmap representing some Color + unsigned char red; + unsigned char green; + unsigned char blue; + ParseBgColor(bgcolor, &red, &green, &blue); + wxColour color = wxColour(red, green, blue); + bmp = wxBitmap(96, 64); + wxMemoryDC *dc = new wxMemoryDC(bmp); + dc->SetBrush(wxBrush(color)); + dc->DrawRectangle(-1, -1, 98, 66); + delete dc; +} + +void WmsSqlSampleDialog::InitData() +{ +// initializing the current configuration + int ret; + char *sql; + char **results; + int rows; + int columns; + + char *url = (char *) malloc((Url.Len() * 4) + 1); + strcpy(url, Url.ToUTF8()); + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = + sqlite3_mprintf + ("SELECT version, srs, format, style, is_queryable, flip_axes, " + "is_cached, tiled, tile_width, tile_height, bgcolor, transparent " + "FROM \"%s\".wms_getmap WHERE url = %Q AND layer_name = %Q", + xdb_prefix, url, layer); + free(url); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + Version = NULL; + ImageFormat = NULL; + Style = NULL; + Transparent = 1; + BgColor = NULL; + return; + } + + for (int i = 1; i <= rows; i++) + { + // fetching data + int len; + const char *version = results[(i * columns) + 0]; + const char *ref_sys = results[(i * columns) + 1]; + const char *format = results[(i * columns) + 2]; + const char *style = results[(i * columns) + 3]; + const char *bgcolor = results[(i * columns) + 10]; + Transparent = atoi(results[(i * columns) + 11]); + if (version == NULL) + Version = NULL; + else + { + len = strlen(version); + Version = (char *) malloc(len + 1); + strcpy(Version, version); + } + if (format == NULL) + ImageFormat = NULL; + else + { + len = strlen(format); + ImageFormat = (char *) malloc(len + 1); + strcpy(ImageFormat, format); + } + if (style == NULL) + Style = NULL; + else + { + len = strlen(style); + Style = (char *) malloc(len + 1); + strcpy(Style, style); + } + if (bgcolor == NULL) + BgColor = NULL; + else + { + if (strlen(bgcolor) == 6) + { + BgColor = (char *) malloc(7); + strcpy(BgColor, bgcolor); + } else + BgColor = NULL; + } + } + sqlite3_free_table(results); +} + +void WmsSqlSampleDialog::FindMaxVersion() +{ +// identifying the Max WMS Version + int ret; + char *sql; + char **results; + int rows; + int columns; + MaxVersion = NULL; + + char *url = (char *) malloc((Url.Len() * 4) + 1); + strcpy(url, Url.ToUTF8()); + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = sqlite3_mprintf("SELECT Max(s.value) FROM \"%s\".wms_getmap AS m " + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'version'", + xdb_prefix, xdb_prefix, url, layer); + free(url); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // fetching data + int len; + const char *version = results[(i * columns) + 0]; + if (version == NULL) + MaxVersion = NULL; + else + { + len = strlen(version); + MaxVersion = (char *) malloc(len + 1); + strcpy(MaxVersion, version); + } + } + sqlite3_free_table(results); +} + +void WmsSqlSampleDialog::PopulateStyles(wxComboBox * stlList) +{ +// populating the Styles List + int ret; + char *sql; + char **results; + int rows; + int columns; + + char *url = (char *) malloc((Url.Len() * 4) + 1); + strcpy(url, Url.ToUTF8()); + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = sqlite3_mprintf("SELECT s.value FROM \"%s\".wms_getmap AS m " + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'style' ORDER BY s.id", + xdb_prefix, xdb_prefix, url, layer); + free(url); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // populating the list + const char *style = results[(i * columns) + 0]; + wxString str = wxString::FromUTF8(style); + stlList->Append(str); + if (strcmp(Style, style) == 0) + stlList->SetSelection(i - 1); + } + sqlite3_free_table(results); +} + +void WmsSqlSampleDialog::PopulateImageFormats(wxComboBox * fmtList) +{ +// populating the Image Formats List + int ret; + char *sql; + char **results; + int rows; + int columns; + + char *url = (char *) malloc((Url.Len() * 4) + 1); + strcpy(url, Url.ToUTF8()); + char *db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + char *xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + free(db_prefix); + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + sql = sqlite3_mprintf("SELECT s.value FROM \"%s\".wms_getmap AS m " + "JOIN \"%s\".wms_settings AS s ON (s.parent_id = m.id) " + "WHERE m.url = %Q AND m.layer_name = %Q AND s.key = 'format' ORDER BY s.id", + xdb_prefix, xdb_prefix, url, layer); + free(url); + free(layer); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // populating the list + const char *format = results[(i * columns) + 0]; + wxString str = wxString::FromUTF8(format); + fmtList->Append(str); + if (strcmp(ImageFormat, format) == 0) + fmtList->SetSelection(i - 1); + } + sqlite3_free_table(results); +} + +int WmsSqlSampleDialog::CheckMarker(wxString & url) +{ +// testing if some "?" marker is already defined + int ret = url.Find('?'); + if (ret == wxNOT_FOUND) + return 0; + return 1; +} + +int + WmsSqlSampleDialog::DoQueryWmsCoverage(const char *db_prefix, + const char *cvg_name, int srid, char **url, int *swap_axes) +{ +// querying the WMS Coverage definitions + int len; + int i; + char **results; + int rows; + int columns; + char *sql; + int ret; + char *xdb_prefix; + int ok = 0; + if (db_prefix == NULL) + db_prefix = "MAIN"; + xdb_prefix = gaiaDoubleQuotedSql(db_prefix); + sql = sqlite3_mprintf("SELECT w.url, s.has_flipped_axes " + "FROM \"%s\".wms_getmap AS w, \"%s\".spatial_ref_sys_aux AS s " + "WHERE w.layer_name = %Q AND s.srid = %d", + xdb_prefix, xdb_prefix, cvg_name, srid); + free(xdb_prefix); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, + &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return 0; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *val = results[(i * columns) + 0]; + if (*url != NULL) + free(*url); + len = strlen(val); + *url = (char *) malloc(len + 1); + strcpy(*url, val); + val = results[(i * columns) + 1]; + *swap_axes = atoi(val); + ok = 1; + } + } + sqlite3_free_table(results); + if (!ok) + return 0; + return 1; +} + +void WmsSqlSampleDialog::DoUpdateUrl() +{ +// +// updating the Request URL +// + char *str; + char *buf; + wxString col; + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); + wxRadioBox *versionBox = (wxRadioBox *) FindWindow(ID_WMS_VERSION); + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_WMS_STYLE); + wxComboBox *mimeList = (wxComboBox *) FindWindow(ID_WMS_FORMAT); + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_WMS_ENABLE_BGCOLOR); + char *db_prefix; + int srid; + const char *crs_prefix = "CRS"; + char *crs = NULL; + char *url = (char *) malloc((Url.Len() * 4) + 1); + strcpy(url, Url.ToUTF8()); + const char *version = Version; + char *layer = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(layer, LayerName.ToUTF8()); + char *style; + char *format = ImageFormat; + int swap_xy; + double minx; + double miny; + double maxx; + double maxy; + int width = MapPanel->GetImageWidth(); + int height = MapPanel->GetImageHeight(); + int opaque; + char *bg_color; + int valid_bg_color = 1; + char *request; + int force_marker = CheckMarker(Url); + + MapPanel->GetBBox(&srid, &minx, &miny, &maxx, &maxy); + if (DbPrefix.Len() == 0) + db_prefix = NULL; + else + { + db_prefix = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(db_prefix, DbPrefix.ToUTF8()); + } + if (!DoQueryWmsCoverage(db_prefix, layer, srid, &url, &swap_xy)) + return; + +crs = sqlite3_mprintf("EPSG:%d", srid); + wxString xstyle = stlList->GetValue(); + if (xstyle.Len() == 0) + style = NULL; + else + { + style = (char *) malloc((xstyle.Len() * 4) + 1); + strcpy(style, xstyle.ToUTF8()); + } + wxString xformat = mimeList->GetValue(); + if (xformat.Len() == 0) + format = NULL; + else + { + format = (char *) malloc((xformat.Len() * 4) + 1); + strcpy(format, xformat.ToUTF8()); + } + +/* masking NULL arguments */ + if (version == NULL) + version = ""; + if (strcmp(version, "1.3.0") != 0) + swap_xy = 0; + if (style == NULL) + { + style = (char *) malloc(1); + *style = '\0'; + } + if (format == NULL) + { + format = (char *) malloc(1); + *format = '\0'; + } +/* validating the background color */ + if (BgColor == NULL) + valid_bg_color = 0; + else if (strlen(BgColor) != 6) + valid_bg_color = 0; + else + { + int i; + for (i = 0; i < 6; i++) + { + char h = *(BgColor + i); + if ((h >= '0' && h <= '9') || (h >= 'a' && h <= 'f') + || (h >= 'A' && h <= 'F')) + ; + else + valid_bg_color = 0; + } + } + if (valid_bg_color) + bg_color = sqlite3_mprintf("0x%s", BgColor); + else + bg_color = sqlite3_mprintf("0xFFFFFF"); + if (transparentCtrl->GetValue()) + opaque = 0; + else + opaque = 1; + +/* preparing the request URL */ + if (strcmp(version, "1.3.0") < 0) + { + /* earlier versions of the protocol require SRS instead of CRS */ + crs_prefix = "SRS"; + } + if (force_marker) + { + /* "?" marker not declared */ + if (swap_xy) + request = + sqlite3_mprintf("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s" + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" + "&TRANSPARENT=%s&BGCOLOR=%s", url, + version, layer, crs_prefix, crs, miny, + minx, maxy, maxx, width, height, style, + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); + else + request = + sqlite3_mprintf("%s?SERVICE=WMS&REQUEST=GetMap&VERSION=%s" + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" + "&TRANSPARENT=%s&BGCOLOR=%s", url, + version, layer, crs_prefix, crs, minx, + miny, maxx, maxy, width, height, style, + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); + } else + { + /* "?" marker already defined */ + if (swap_xy) + request = + sqlite3_mprintf("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s" + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" + "&TRANSPARENT=%s&BGCOLOR=%s", url, + version, layer, crs_prefix, crs, miny, + minx, maxy, maxx, width, height, style, + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); + else + request = + sqlite3_mprintf("%sSERVICE=WMS&REQUEST=GetMap&VERSION=%s" + "&LAYERS=%s&%s=%s&BBOX=%1.6f,%1.6f,%1.6f,%1.6f" + "&WIDTH=%d&HEIGHT=%d&STYLES=%s&FORMAT=%s" + "&TRANSPARENT=%s&BGCOLOR=%s", url, + version, layer, crs_prefix, crs, minx, + miny, maxx, maxy, width, height, style, + format, (opaque == 0) ? "TRUE" : "FALSE", bg_color); + } + Sql = wxString::FromUTF8(request); + sqlite3_free(request); + sqlCtrl->SetValue(Sql); + + if (url != NULL) + free(url); + if (layer != NULL) + free(layer); + if (db_prefix != NULL) + free(db_prefix); + if (crs != NULL) + sqlite3_free(crs); + if (style != NULL) + free(style); + if (format != NULL) + free(format); + if (bg_color != NULL) + sqlite3_free(bg_color); +} + +void WmsSqlSampleDialog::DoUpdateSql() +{ +// +// updating the SQL query +// + if (RequestURL == true) + { + DoUpdateUrl(); + return; + } + char *str; + char *buf; + wxString col; + wxTextCtrl *sqlCtrl = (wxTextCtrl *) FindWindow(ID_SQL_SAMPLE); + wxRadioBox *versionBox = (wxRadioBox *) FindWindow(ID_WMS_VERSION); + wxComboBox *stlList = (wxComboBox *) FindWindow(ID_WMS_STYLE); + wxComboBox *mimeList = (wxComboBox *) FindWindow(ID_WMS_FORMAT); + wxCheckBox *transparentCtrl = + (wxCheckBox *) FindWindow(ID_WMS_ENABLE_BGCOLOR); + Sql = wxT("SELECT RL2_GetMapImageFromWMS("); + if (DbPrefix.Len() == 0) + Sql += wxT("NULL, "); + else + { + str = (char *) malloc((DbPrefix.Len() * 4) + 1); + strcpy(str, DbPrefix.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// coverage name + str = (char *) malloc((LayerName.Len() * 4) + 1); + strcpy(str, LayerName.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// bounding box + wxString bbox; + MapPanel->DoPrepareBBox(bbox); + Sql += bbox; +// image width and height + buf = + sqlite3_mprintf("%d, %d, ", MapPanel->GetImageWidth(), + MapPanel->GetImageHeight()); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; +// WMS version + switch (versionBox->GetSelection()) + { + case 1: + Sql += wxT("'1.1.0', "); + break; + case 2: + Sql += wxT("'1.1.1', "); + break; + case 3: + Sql += wxT("'1.3.0', "); + break; + default: + Sql += wxT("'1.0.0', "); + break; + }; +// style + wxString style = stlList->GetValue(); + if (style.Len() == 0) + Sql += wxT("'default', "); + else + { + str = (char *) malloc((style.Len() * 4) + 1); + strcpy(str, style.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// MIME type + wxString format = mimeList->GetValue(); + if (format.Len() == 0) + Sql += wxT("'default', "); + else + { + str = (char *) malloc((format.Len() * 4) + 1); + strcpy(str, format.ToUTF8()); + buf = sqlite3_mprintf("%Q, ", str); + free(str); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// bgColor + if (BgColor == NULL) + Sql += wxT("'#ffffff', "); + else + { + buf = sqlite3_mprintf("'#%s', ", BgColor); + col = wxString::FromUTF8(buf); + sqlite3_free(buf); + Sql += col; + } +// transparent + if (transparentCtrl->GetValue()) + Sql += wxT("1"); + else + Sql += wxT("0"); + Sql += wxT(");"); + sqlCtrl->SetValue(Sql); +} + +void WmsSqlSampleDialog::OnVersionChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// WMS Version selection changed +// + DoUpdateSql(); +} + +void WmsSqlSampleDialog::OnStyleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Style selection changed +// + DoUpdateSql(); +} + +void WmsSqlSampleDialog::OnMimeTypeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// MIME Type selection changed +// + DoUpdateSql(); +} + +void WmsSqlSampleDialog::OnTransparentChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Transparent selection changed +// + wxBitmapButton *btn = (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); + if (Transparent == 1) + { + Transparent = 0; + if (BgColor != NULL) + free(BgColor); + BgColor = (char *) malloc(7); + strcpy(BgColor, "ffffff"); + wxBitmap bmp; + GetButtonBitmap(BgColor, bmp); + btn->SetBitmapLabel(bmp); + btn->Enable(true); + } else + { + Transparent = 0; + btn->Enable(false); + if (BgColor != NULL) + { + free(BgColor); + BgColor = NULL; + } + } + DoUpdateSql(); +} + +void WmsSqlSampleDialog::OnBgColorChanged(wxCommandEvent & WXUNUSED(event)) +{ +// BgColor selection + wxColourData initColor; + int ret; + unsigned char red; + unsigned char green; + unsigned char blue; + ParseBgColor(BgColor, &red, &green, &blue); + wxColour color = wxColour(red, green, blue); + initColor.SetChooseFull(false); + initColor.SetColour(color); + wxColourDialog colorDialog(this, &initColor); + ret = colorDialog.ShowModal(); + if (ret == wxID_OK) + { + wxColourData colorData = colorDialog.GetColourData(); + color = colorData.GetColour(); + char byte[3]; + sprintf(byte, "%02x", color.Red()); + memcpy(BgColor, byte, 2); + sprintf(byte, "%02x", color.Green()); + memcpy(BgColor + 2, byte, 2); + sprintf(byte, "%02x", color.Blue()); + memcpy(BgColor + 4, byte, 2); + *(BgColor + 6) = '\0'; + wxBitmap bmp; + GetButtonBitmap(BgColor, bmp); + wxBitmapButton *bgColorCtrl = + (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); + bgColorCtrl->SetBitmapLabel(bmp); + DoUpdateSql(); + } +} + +void WmsSqlSampleDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Map Request (SQL statement) +// + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(Sql)); + wxTheClipboard->Close(); + } +} + +void WmsSqlSampleDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} Index: Main.cpp ================================================================== --- Main.cpp +++ Main.cpp @@ -2,11 +2,11 @@ / Main.cpp / the main core of spatialite_gui - a SQLite /SpatiaLite GUI tool / / version 1.7, 2014 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2014 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -32,10 +32,12 @@ #include "wx/tokenzr.h" #include #include #include + +#include // // ICONs in XPM format [universally portable] // #include "icons/icon.xpm" @@ -77,11 +79,11 @@ #include "icons/dxf.xpm" #include "icons/map_go.xpm" #include "icons/security_lock.xpm" #include "icons/security_relaxed.xpm" #include "icons/security_rdonly.xpm" - +#include "icons/postgres.xpm" #if defined(_WIN32) && !defined(__MINGW32__) #define unlink _unlink #endif @@ -111,10 +113,13 @@ // main GUI frame constructor // setlocale(LC_ALL, ""); // forcing DECIMAL POINT IS COMMA setlocale(LC_NUMERIC, "C"); + +// setting up the LibPQ virtual API + DoInitVirtualPQapi(); // creating the internal WMS Cache WmsCache = create_wms_cache(); ::wxInitAllImageHandlers(); @@ -341,10 +346,11 @@ BtnCheckGeom = new wxBitmap(checkgeom_xpm); BtnSaneGeom = new wxBitmap(sanegeom_xpm); BtnWFS = new wxBitmap(wfs_xpm); BtnDXF = new wxBitmap(dxf_xpm); BtnMap = new wxBitmap(map_go_xpm); + BtnPostgres = new wxBitmap(postgres_xpm); // // setting up the application icon // wxIcon MyIcon(icon_xpm); @@ -449,10 +455,15 @@ menuFile->Append(menuItem); menuItem = new wxMenuItem(menuFile, ID_Attach, wxT("&Attach DataBase")); menuItem->SetBitmap(*BtnAttach); menuFile->Append(menuItem); menuFile->AppendSeparator(); + menuItem = + new wxMenuItem(menuFile, ID_Postgres, wxT("&Connecting to PostgreSQL")); + menuItem->SetBitmap(*BtnPostgres); + menuFile->Append(menuItem); + menuFile->AppendSeparator(); menuItem = new wxMenuItem(menuFile, ID_MapPanel, wxT("Map &Panel"), wxT("Map &Panel"), wxITEM_CHECK); menuFile->Append(menuItem); menuFile->AppendSeparator(); @@ -496,11 +507,11 @@ advancedMenu->Append(menuItem); menuItem = new wxMenuItem(advancedMenu, ID_VirtualXL, wxT("Virtual &XLS")); menuItem->SetBitmap(*BtnVirtualXL); advancedMenu->Append(menuItem); advancedMenu->AppendSeparator(); - menuItem = new wxMenuItem(advancedMenu, ID_Network, wxT("Build &Network")); + menuItem = new wxMenuItem(advancedMenu, ID_Network, wxT("Create &Network")); menuItem->SetBitmap(*BtnNetwork); advancedMenu->Append(menuItem); advancedMenu->AppendSeparator(); menuItem = new wxMenuItem(advancedMenu, ID_Exif, wxT("Import &EXIF photos")); menuItem->SetBitmap(*BtnExif); @@ -563,10 +574,11 @@ // menuBar->Enable(ID_Disconnect, false); menuBar->Enable(ID_MemoryDbClock, false); menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_Vacuum, false); + menuBar->Enable(ID_Postgres, false); menuBar->Enable(ID_MapPanel, false); menuBar->Enable(ID_SqlScript, false); menuBar->Enable(ID_QueryViewComposer, false); menuBar->Enable(ID_LoadShp, false); menuBar->Enable(ID_VirtualShp, false); @@ -623,19 +635,21 @@ *BtnVacuum, wxNullBitmap, wxITEM_NORMAL, wxT("Optimizing current SQLite DB [VACUUM]")); toolBar->AddTool(ID_Attach, wxT("Attach DataBase"), *BtnAttach, wxNullBitmap, wxITEM_NORMAL, wxT("Attach DataBase")); - toolBar->AddTool(ID_MapPanel, wxT("Map Panel"), - *BtnMap, wxNullBitmap, wxITEM_CHECK, wxT("Map Panel")); - toolBar->AddTool(ID_SqlLog, wxT("SQL Log"), - *BtnSqlLog, wxNullBitmap, wxITEM_CHECK, wxT("SQL Log")); - toolBar->AddTool(ID_DbStatus, wxT("DB Status"), - *BtnDbStatus, wxNullBitmap, wxITEM_NORMAL, wxT("DB Status")); - toolBar->AddTool(ID_CheckGeom, wxT("Check Geometries"), - *BtnCheckGeom, wxNullBitmap, wxITEM_NORMAL, - wxT("Check Geometries")); + toolBar->AddTool(ID_Postgres, wxT("Connecting to PostgreSQL"), + *BtnPostgres, wxNullBitmap, wxITEM_CHECK, + wxT("Connecting to PostgreSQL")); + toolBar->AddTool(ID_MapPanel, wxT("Map Panel"), *BtnMap, wxNullBitmap, + wxITEM_CHECK, wxT("Map Panel")); + toolBar->AddTool(ID_SqlLog, wxT("SQL Log"), *BtnSqlLog, wxNullBitmap, + wxITEM_CHECK, wxT("SQL Log")); + toolBar->AddTool(ID_DbStatus, wxT("DB Status"), *BtnDbStatus, wxNullBitmap, + wxITEM_NORMAL, wxT("DB Status")); + toolBar->AddTool(ID_CheckGeom, wxT("Check Geometries"), *BtnCheckGeom, + wxNullBitmap, wxITEM_NORMAL, wxT("Check Geometries")); toolBar->AddTool(ID_SaneGeom, wxT("Sanitize Geometries"), *BtnSaneGeom, wxNullBitmap, wxITEM_NORMAL, wxT("Sanitize Geometries")); toolBar->AddTool(ID_SqlScript, wxT("Execute SQL script"), *BtnSqlScript, wxNullBitmap, wxITEM_NORMAL, wxT("Execute SQL script")); toolBar->AddTool(ID_QueryViewComposer, wxT("Query/View Composer"), @@ -655,12 +669,12 @@ wxNullBitmap, wxITEM_NORMAL, wxT("Virtual DBF")); toolBar->AddTool(ID_LoadXL, wxT("Load XLS"), *BtnLoadXL, wxNullBitmap, wxITEM_NORMAL, wxT("Load XLS")); toolBar->AddTool(ID_VirtualXL, wxT("Virtual XLS"), *BtnVirtualXL, wxNullBitmap, wxITEM_NORMAL, wxT("Virtual XLS")); - toolBar->AddTool(ID_Network, wxT("Build Network"), *BtnNetwork, wxNullBitmap, - wxITEM_NORMAL, wxT("Build Network")); + toolBar->AddTool(ID_Network, wxT("Create Network"), *BtnNetwork, wxNullBitmap, + wxITEM_NORMAL, wxT("Create Network")); toolBar->AddTool(ID_Exif, wxT("Import EXIF photos"), *BtnExif, wxNullBitmap, wxITEM_NORMAL, wxT("Import EXIF photos")); toolBar->AddTool(ID_GpsPics, wxT("Import GPS photos"), *BtnGpsPics, wxNullBitmap, wxITEM_NORMAL, wxT("Import GPS photos")); toolBar->AddTool(ID_LoadXml, wxT("Import XML Documents"), *BtnLoadXml, @@ -688,10 +702,11 @@ // toolBar->EnableTool(ID_Disconnect, false); toolBar->EnableTool(ID_MemoryDbClock, false); toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_Vacuum, false); + toolBar->EnableTool(ID_Postgres, false); toolBar->EnableTool(ID_MapPanel, false); toolBar->EnableTool(ID_SqlScript, false); toolBar->EnableTool(ID_QueryViewComposer, false); toolBar->EnableTool(ID_LoadShp, false); toolBar->EnableTool(ID_VirtualShp, false); @@ -736,10 +751,12 @@ (wxObjectEventFunction) & MyFrame::OnMemoryDbClock); Connect(ID_MemoryDbSave, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyFrame::OnMemoryDbSave); Connect(ID_Vacuum, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyFrame::OnVacuum); + Connect(ID_Postgres, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyFrame::OnPostgreSQL); Connect(ID_MapPanel, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyFrame::OnMapPanel); Connect(ID_SqlScript, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyFrame::OnSqlScript); Connect(ID_QueryViewComposer, wxEVT_COMMAND_MENU_SELECTED, @@ -863,10 +880,12 @@ delete BtnMemDbSave; if (BtnVacuum != NULL) delete BtnVacuum; if (BtnMap != NULL) delete BtnMap; + if (BtnPostgres != NULL) + delete BtnPostgres; if (BtnSqlScript != NULL) delete BtnSqlScript; if (BtnQueryComposer != NULL) delete BtnQueryComposer; if (BtnLoadShp != NULL) @@ -923,10 +942,12 @@ delete[]CharsetsNames; if (WmsCache != NULL) destroy_wms_cache(WmsCache); if (RL2PrivateData) rl2_cleanup_private(RL2PrivateData); + if (DynamicLibPQ.IsLoaded() == true) + DynamicLibPQ.Unload(); } void MyFrame::SaveConfig() { // @@ -945,10 +966,11 @@ config->Write(wxT("ReadOnlyConnection"), ReadOnlyConnection); config->Write(wxT("RL2MaxThreads"), RL2MaxThreads); config->Write(wxT("MapMultiThreadingEnabled"), MapMultiThreadingEnabled); config->Write(wxT("MapMaxThreads"), MapMaxThreads); config->Write(wxT("MapAutoTransformEnabled"), MapAutoTransformEnabled); + config->Write(wxT("PathLibPQ"), PathLibPQ); delete config; } void MyFrame::LoadConfig(wxString & externalPath) { @@ -971,10 +993,11 @@ config->Read(wxT("ReadOnlyConnection"), &ReadOnlyConnection); config->Read(wxT("RL2MaxThreads"), &RL2MaxThreads); config->Read(wxT("MapMultiThreadingEnabled"), &MapMultiThreadingEnabled); config->Read(wxT("MapMaxThreads"), &MapMaxThreads); config->Read(wxT("MapAutoTransformEnabled"), &MapAutoTransformEnabled); + config->Read(wxT("PathLibPQ"), &PathLibPQ); delete config; Hide(); if (externalPath.Len() > 0) { // applying the external path @@ -1012,10 +1035,11 @@ menuBar->Enable(ID_MemoryDbClock, false); } menuBar->Enable(ID_CreateNew, false); menuBar->Enable(ID_Disconnect, true); menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -1054,10 +1078,11 @@ toolBar->EnableTool(ID_MemoryDbClock, false); } toolBar->EnableTool(ID_CreateNew, false); toolBar->EnableTool(ID_Disconnect, true); toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -1081,10 +1106,30 @@ toolBar->EnableTool(ID_CheckGeom, true); toolBar->EnableTool(ID_SaneGeom, true); UpdateStatusBar(); } } + if (VirtualPQapiOK == false) + { + // attempting to attempting to load LibPQ + if (PathLibPQ.Len() > 0) + { + // using the same path from the previous session + DoLoadLibPQ(PathLibPQ); + } + if (VirtualPQapiOK == false) + { + // using just the library name + wxString path; +#ifdef _WIN32 + path = wxDynamicLibrary::CanonicalizeName(wxT("libpq")); +#else + path = wxDynamicLibrary::CanonicalizeName(wxT("pq")); +#endif + DoLoadLibPQ(path); + } + } Show(); if (AutoFDOmsg.Len() > 0) { wxMessageBox(AutoFDOmsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); @@ -1104,11 +1149,11 @@ // EXIT - event handler // Close(true); } -void MyFrame::OnClose(wxCloseEvent & event) +void MyFrame::OnClose(wxCloseEvent & WXUNUSED(event)) { // // immedtiately before closing the main window // wxString db_path = SqlitePath; @@ -1452,10 +1497,15 @@ if (GetLibXml2Version(ver)) { // printing out the LIBXML2 version if supported str += wxT("LIBXML2 version ") + wxString::FromUTF8(ver) + wxT("\n"); } + strcpy(ver, virtualpg_version()); + str += wxT("VirtualPG version ") + wxString::FromUTF8(ver) + wxT("\n"); + wxString pqver; + GetPQlibVersion(pqver); + str += wxT("PQlib (PostgreSQL client) version ") + pqver + wxT("\n"); str += wxT("\nSQLite's extensions: 'SpatiaLite', 'VirtualShape', 'VirtualDbf',\n"); str += wxT("'VirtualXL', 'VirtualText', 'VirtualXPath', 'VirtualNetwork',\n"); str += wxT("'RTree', 'MbrCache', 'VirtualBBox', 'VirtualFDO', 'VirtualGPKG',\n"); @@ -1593,10 +1643,11 @@ { menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_MemoryDbClock, false); } menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -1635,10 +1686,11 @@ { toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_MemoryDbClock, false); } toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -1697,10 +1749,11 @@ } wxMenuBar *menuBar = GetMenuBar(); menuBar->Enable(ID_Disconnect, mode); menuBar->Enable(ID_Vacuum, mode); + menuBar->Enable(ID_Postgres, mode); menuBar->Enable(ID_MapPanel, mode); menuBar->Enable(ID_SqlScript, mode); menuBar->Enable(ID_QueryViewComposer, mode2); menuBar->Enable(ID_LoadShp, mode); menuBar->Enable(ID_VirtualShp, mode); @@ -1723,10 +1776,11 @@ menuBar->Enable(ID_CheckGeom, mode); menuBar->Enable(ID_SaneGeom, mode); wxToolBar *toolBar = GetToolBar(); toolBar->EnableTool(ID_Disconnect, mode); toolBar->EnableTool(ID_Vacuum, mode); + toolBar->EnableTool(ID_Postgres, mode); toolBar->EnableTool(ID_MapPanel, mode); toolBar->EnableTool(ID_SqlScript, mode); toolBar->EnableTool(ID_QueryViewComposer, mode2); toolBar->EnableTool(ID_LoadShp, mode); toolBar->EnableTool(ID_VirtualShp, mode); @@ -1804,10 +1858,11 @@ { menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_MemoryDbClock, false); } menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -1846,10 +1901,11 @@ { toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_MemoryDbClock, false); } toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -1911,10 +1967,11 @@ menuBar->Enable(ID_MemoryDbLoad, true); menuBar->Enable(ID_MemoryDbNew, true); menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_MemoryDbClock, false); menuBar->Enable(ID_Vacuum, false); + menuBar->Enable(ID_Postgres, false); menuBar->Enable(ID_MapPanel, false); menuBar->Enable(ID_SqlScript, false); menuBar->Enable(ID_QueryViewComposer, false); menuBar->Enable(ID_LoadShp, false); menuBar->Enable(ID_VirtualShp, false); @@ -1945,10 +2002,11 @@ toolBar->EnableTool(ID_MemoryDbLoad, true); toolBar->EnableTool(ID_MemoryDbNew, true); toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_MemoryDbClock, false); toolBar->EnableTool(ID_Vacuum, false); + toolBar->EnableTool(ID_Postgres, false); toolBar->EnableTool(ID_MapPanel, false); toolBar->EnableTool(ID_SqlScript, false); toolBar->EnableTool(ID_QueryViewComposer, false); toolBar->EnableTool(ID_LoadShp, false); toolBar->EnableTool(ID_VirtualShp, false); @@ -2015,10 +2073,11 @@ menuBar->Enable(ID_MemoryDbLoad, false); menuBar->Enable(ID_MemoryDbNew, false); menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_MemoryDbClock, false); menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -2050,10 +2109,11 @@ toolBar->EnableTool(ID_MemoryDbLoad, false); toolBar->EnableTool(ID_MemoryDbNew, false); toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_MemoryDbClock, false); toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -2156,10 +2216,11 @@ sqlite3_close(extSqlite); // setting up the internal cache SpliteInternalCache = spatialite_alloc_connection(); spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); rl2_init(SqliteHandle, RL2PrivateData, 0); + DoInitVirtualPG(); // enabling LOAD_EXTENSION ret = sqlite3_enable_load_extension(SqliteHandle, 1); if (ret != SQLITE_OK) { wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), @@ -2200,10 +2261,11 @@ { menuBar->Enable(ID_MemoryDbSave, false); menuBar->Enable(ID_MemoryDbClock, false); } menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -2242,10 +2304,11 @@ { toolBar->EnableTool(ID_MemoryDbSave, false); toolBar->EnableTool(ID_MemoryDbClock, false); } toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -2345,10 +2408,11 @@ menuBar->Enable(ID_MemoryDbLoad, false); menuBar->Enable(ID_MemoryDbNew, false); menuBar->Enable(ID_MemoryDbSave, true); menuBar->Enable(ID_MemoryDbClock, true); menuBar->Enable(ID_Vacuum, true); + menuBar->Enable(ID_Postgres, true); menuBar->Enable(ID_MapPanel, true); menuBar->Enable(ID_SqlScript, true); menuBar->Enable(ID_QueryViewComposer, HasViewsMetadata()); menuBar->Enable(ID_LoadShp, true); menuBar->Enable(ID_VirtualShp, true); @@ -2380,10 +2444,11 @@ toolBar->EnableTool(ID_MemoryDbLoad, false); toolBar->EnableTool(ID_MemoryDbNew, false); toolBar->EnableTool(ID_MemoryDbSave, true); toolBar->EnableTool(ID_MemoryDbClock, true); toolBar->EnableTool(ID_Vacuum, true); + toolBar->EnableTool(ID_Postgres, true); toolBar->EnableTool(ID_MapPanel, true); toolBar->EnableTool(ID_SqlScript, true); toolBar->EnableTool(ID_QueryViewComposer, HasViewsMetadata()); toolBar->EnableTool(ID_LoadShp, true); toolBar->EnableTool(ID_VirtualShp, true); @@ -2742,10 +2807,186 @@ } } sqlite3_free_table(results); return ok; } + +void MyFrame::CreateNetwork(wxString & table, wxString & from, wxString & to, + bool isNoGeometry, wxString & geom, + bool isNameEnabled, wxString & name, + bool isGeomLength, wxString & cost, + bool isBidirectional, bool isOneWays, + wxString & oneWayFromTo, wxString & oneWayToFrom, + bool aStarSupported, wxString & dataTableName, + wxString & virtualTableName, bool overwrite) +{ +// +// creating VirtualRouting tables +// + char *xtable = (char *) malloc(table.Len() * 4); + strcpy(xtable, table.ToUTF8()); + char *xfrom = (char *) malloc(from.Len() * 4); + strcpy(xfrom, from.ToUTF8()); + char *xto = (char *) malloc(to.Len() * 4); + strcpy(xto, to.ToUTF8()); + char *xgeom = NULL; + if (isNoGeometry == false && geom.Len() > 0) + { + xgeom = (char *) malloc(geom.Len() * 4); + strcpy(xgeom, geom.ToUTF8()); + } + char *xname = NULL; + if (isNameEnabled == true && name.Len() > 0) + { + xname = (char *) malloc(name.Len() * 4); + strcpy(xname, name.ToUTF8()); + } + char *xcost = NULL; + if (isGeomLength == false && cost.Len() > 0) + { + xcost = (char *) malloc(cost.Len() * 4); + strcpy(xcost, cost.ToUTF8()); + } + int xbidirectional = 0; + if (isBidirectional == true) + xbidirectional = 1; + char *xonewayfrom = NULL; + char *xonewayto = NULL; + if (isOneWays == true && oneWayFromTo.Len() > 0 && oneWayToFrom.Len() > 0) + { + xonewayfrom = (char *) malloc(oneWayFromTo.Len() * 4); + strcpy(xonewayfrom, oneWayFromTo.ToUTF8()); + xonewayto = (char *) malloc(oneWayToFrom.Len() * 4); + strcpy(xonewayto, oneWayToFrom.ToUTF8()); + } + int xastarsupported = 0; + if (aStarSupported == true) + xastarsupported = 1; + char *xdatatablename = (char *) malloc(dataTableName.Len() * 4); + strcpy(xdatatablename, dataTableName.ToUTF8()); + char *xvirtualtablename = (char *) malloc(virtualTableName.Len() * 4); + strcpy(xvirtualtablename, virtualTableName.ToUTF8()); + int xoverwrite = 0; + if (overwrite == true) + xoverwrite = 1; + +// preparing the SQL statement + char *sql = sqlite3_mprintf("SELECT CreateRouting(%Q, %Q, %Q, %Q, %Q", + xdatatablename, xvirtualtablename, xtable, xfrom, + xto); + char *prev = sql; + if (xgeom == NULL) + sql = sqlite3_mprintf("%s, NULL", prev); + else + sql = sqlite3_mprintf("%s, %Q", prev, xgeom); + sqlite3_free(prev); + prev = sql; + if (xcost == NULL) + sql = sqlite3_mprintf("%s, NULL", prev); + else + sql = sqlite3_mprintf("%s, %Q", prev, xcost); + sqlite3_free(prev); + prev = sql; + if (xname == NULL) + sql = sqlite3_mprintf("%s, NULL", prev); + else + sql = sqlite3_mprintf("%s, %Q", prev, xname); + sqlite3_free(prev); + prev = sql; + sql = sqlite3_mprintf("%s, %d, %d", prev, xastarsupported, xbidirectional); + sqlite3_free(prev); + prev = sql; + if (xonewayfrom != NULL && xonewayto != NULL) + sql = sqlite3_mprintf("%s, %Q, %Q", prev, xonewayfrom, xonewayto); + else + sql = sqlite3_mprintf("%s, NULL, NULL", prev); + sqlite3_free(prev); + prev = sql; + sql = sqlite3_mprintf("%s, %d)", prev, xoverwrite); + sqlite3_free(prev); + +// executing the SQL statement + int i; + char **results; + int rows; + int columns; + int success = 0; + int ret = + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + goto end; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + success = atoi(results[(i * columns) + 0]); + } + sqlite3_free_table(results); + +end: + free(xtable); + free(xfrom); + free(xto); + if (xgeom != NULL) + free(xgeom); + if (xname != NULL) + free(xname); + if (xcost != NULL) + free(xcost); + if (xonewayfrom != NULL) + free(xonewayfrom); + if (xonewayto != NULL) + free(xonewayto); + free(xdatatablename); + free(xvirtualtablename); + if (success) + { + wxString msg = wxT("The VirtualRouting Tables were succesfully created"); + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); + InitTableTree(); + } else + { + // failure: reporting the error cause + wxString errCause = wxT("Unknown Cause"); + GetLastRoutingError(errCause); + wxString msg = + wxT + ("Some error occurred forbidding to create the VirtualRouting Tables\n\n") + + errCause; + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + } + +} + +void MyFrame::GetLastRoutingError(wxString & msg) +{ +// +// attempting to retrieve the most recent failure cause - CreateRouting +// + int i; + char **results; + int rows; + int columns; + int ret = + sqlite3_get_table(SqliteHandle, "SELECT CreateRouting_GetLastError()", + &results, &rows, &columns, NULL); + if (ret != SQLITE_OK) + return; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *message = results[(i * columns) + 0]; + msg = wxString::FromUTF8(message); + } + } + sqlite3_free_table(results); +} void MyFrame::OnVacuum(wxCommandEvent & WXUNUSED(event)) { // // performing a VACUUM in order to reorganize the current DB @@ -3869,10 +4110,11 @@ wxString table; wxString from; wxString to; bool isNoGeometry; wxString geom; + bool isNameEnabled; wxString name; bool isGeomLength; wxString cost; bool isBidirectional; bool isOneWays; @@ -3879,19 +4121,21 @@ wxString oneWayToFrom; wxString oneWayFromTo; bool aStarSupported; wxString dataTableName; wxString virtualTableName; + bool overwrite; dlg.Create(this); ret = dlg.ShowModal(); if (ret == wxID_OK) { table = dlg.GetTableName(); from = dlg.GetFromColumn(); to = dlg.GetToColumn(); isNoGeometry = dlg.IsNoGeometry(); geom = dlg.GetGeomColumn(); + isNameEnabled = dlg.IsNameEnabled(); name = dlg.GetNameColumn(); isGeomLength = dlg.IsGeomLength(); cost = dlg.GetCostColumn(); isBidirectional = dlg.IsBidirectional(); isOneWays = dlg.IsOneWays(); @@ -3898,13 +4142,17 @@ oneWayToFrom = dlg.GetOneWayToFrom(); oneWayFromTo = dlg.GetOneWayFromTo(); aStarSupported = dlg.IsAStarSupported(); dataTableName = dlg.GetDataTable(); virtualTableName = dlg.GetVirtualTable(); - BuildNetwork(table, from, to, isNoGeometry, geom, name, isGeomLength, - cost, isBidirectional, isOneWays, oneWayFromTo, oneWayToFrom, - aStarSupported, dataTableName, virtualTableName); + overwrite = dlg.IsOverwriteEnabled(); + ::wxBeginBusyCursor(); + CreateNetwork(table, from, to, isNoGeometry, geom, isNameEnabled, name, + isGeomLength, cost, isBidirectional, isOneWays, + oneWayFromTo, oneWayToFrom, aStarSupported, dataTableName, + virtualTableName, overwrite); + ::wxEndBusyCursor(); } } void MyFrame::OnImportXmlDocuments(wxCommandEvent & WXUNUSED(event)) { @@ -4470,11 +4718,19 @@ { // creating a default NO-DATA value no_data = DefaultNoData(SampleType, PixelType, NumBands); } else { - no_data = ParseNoData(NoData, SampleType, PixelType, NumBands); + if (NoData.CmpNoCase(wxT("NONE")) == 0) + { + // creating a NoData pixel of the NONE type + no_data = rl2_create_pixel_none(); + } else + { + // creating the NoData pixel + no_data = ParseNoData(NoData, SampleType, PixelType, NumBands); + } if (no_data == NULL) { wxMessageBox(wxT("ERROR: invalid NO-DATA string"), wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); return false; @@ -5471,10 +5727,11 @@ } // setting up the internal cache SpliteInternalCache = spatialite_alloc_connection(); spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); rl2_init(SqliteHandle, RL2PrivateData, 0); + DoInitVirtualPG(); // enabling LOAD_EXTENSION ret = sqlite3_enable_load_extension(SqliteHandle, 1); if (ret != SQLITE_OK) { wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), @@ -5490,11 +5747,32 @@ sqlite3_free(errMsg); } // setting RL2 MaxThreads char sqlmax[1024]; sprintf(sqlmax, "SELECT RL2_SetMaxThreads(%d)", RL2MaxThreads); - sqlite3_exec(SqliteHandle, sqlmax, NULL, 0, &errMsg); + sqlite3_exec(SqliteHandle, sqlmax, NULL, 0, NULL); +// creating POSTGIS_GEOMETRY_COLUMNS (Temporary Table) + const char *sql = + "CREATE TEMPORARY TABLE IF NOT EXISTS postgis_geometry_columns (\n" + "\tf_table_name TEXT NOT NULL,\n\tf_geometry_column TEXT NOT NULL,\n" + "\tcoord_dimension INTEGER NOT NULL,\n\tsrid INTEGER NOT NULL,\n" + "\tgeometry_type TEXT NOT NULL,\n\tCONSTRAINT tmp_postgis_pk PRIMARY " + "KEY (f_table_name, f_geometry_column))"; + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); +// creating TMP_VECTOR_COVERAGES (Temporary Table) + sql = + "CREATE TEMPORARY TABLE IF NOT EXISTS tmp_vector_coverages (\n" + "\tcoverage_name TEXT NOT NULL PRIMARY KEY,\n" + "\tf_table_name TEXT,\n\tf_geometry_column TEXT,\n" + "\tview_name TEXT,\n\tview_geometry TEXT,\n\tvirt_name TEXT,\n" + "\tvirt_geometry TEXT,\n\ttopology_name TEXT,\n\tnetwork_name TEXT,\n" + "\tpostgis_table TEXT,\n\tpostgis_geometry TEXT,\n" + "\tgeo_minx DOUBLE,\n\tgeo_miny DOUBLE,\n\tgeo_maxx DOUBLE,\n" + "\tgeo_maxy DOUBLE,\n\textent_minx DOUBLE,\n\textent_miny DOUBLE,\n" + "\textent_maxx DOUBLE,\n\textent_maxy DOUBLE)"; + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); + AutoFDOStart(); AutoGPKGStart(); InitTableTree(); LoadHistory(); return true; @@ -5682,10 +5960,11 @@ // // disconnecting current SQLite DB // if (!SqliteHandle) return; + AutoPostgresStop(); AutoFDOStop(); AutoGPKGStop(); if (AutoFDOmsg.Len() > 0) wxMessageBox(AutoFDOmsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); @@ -5703,10 +5982,16 @@ ReadOnlyConnection = false; MemoryDatabase = false; ResetSecurity(); AttachedList.Flush(); ClearTableTree(); +// dropping POSTGIS_GEOMETRY_COLUMNS (Temporary Table) + const char *sql = "DROP TABLE IF EXISTS temp.postgis_geometry_columns"; + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); +// dropping TMP_VECTOR_COVERAGES (Temporary Table) + sql = "DROP TABLE IF EXISTS temp.tmp_vector_coverages"; + sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); } bool MyFrame::CreateDB() { // creating a new, empty SQLite DB @@ -5742,10 +6027,11 @@ } // setting up the internal cache SpliteInternalCache = spatialite_alloc_connection(); spatialite_init_ex(SqliteHandle, SpliteInternalCache, 0); rl2_init(SqliteHandle, RL2PrivateData, 0); + DoInitVirtualPG(); // enabling LOAD_EXTENSION ret = sqlite3_enable_load_extension(SqliteHandle, 1); if (ret != SQLITE_OK) { wxMessageBox(wxT("Unable to enable LOAD_EXTENSION"), @@ -5805,15 +6091,15 @@ if (count > 0) return; // all right, it's empty: proceding to initialize - strcpy(sql, "SELECT InitSpatialMetadata(1)"); + strcpy(sql, "SELECT InitSpatialMetadataFull(1)"); ret = sqlite3_exec(SqliteHandle, sql, NULL, NULL, &errMsg); if (ret != SQLITE_OK) { - wxMessageBox(wxT("Unable to initialite SpatialMetadata: ") + + wxMessageBox(wxT("Unable to initialite SpatialMetadataFull: ") + wxString::FromUTF8(errMsg), wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); sqlite3_free(errMsg); return; } @@ -5929,11 +6215,11 @@ char *xsql; bool status = false; // fetching any defined Spatial Index sql = wxT - ("SELECT f_table_name, f_geometry_column FROM main.geometry_columns WHERE spatial_index_enabled = 1"); + ("SELECT f_table_name, f_geometry_column FROM main.geometry_columns WHERE spatial_index_enabled IN (1,3)"); xsql = (char *) malloc((sql.Len() * 4) + 1); strcpy(xsql, sql.ToUTF8()); int ret = sqlite3_get_table(SqliteHandle, xsql, &results, &rows, &columns, &errMsg); free(xsql); @@ -8036,10 +8322,33 @@ sqlite3_finalize(stmt); if (success == false) return false; return true; } + +void MyFrame::DoCreatePostgreSqlNodes() +{ +// initializing the PostgreSQL nodes + int c = 0; + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + // adding a Connection node + wxTreeItemId connId; + TableTree->AddPostgresConnection(c++, pC, connId); + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + // adding a Schema node + wxTreeItemId schemaId; + TableTree->AddPostgresSchema(connId, pC, pS->GetName(), schemaId); + pS->SetTreeNode(schemaId); + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } +} void MyFrame::InitTableTree() { // loads the table TREE list int i; @@ -8062,10 +8371,11 @@ wxString memory = wxT("MEMORY-DB"); TableTree->SetPath(memory); } else TableTree->SetPath(SqlitePath); TableTree->FlushAll(); + DoCreatePostgreSqlNodes(); if (ExistsTopologies()) { // fetching topologies sql = wxT("SELECT topology_name, srid, has_z "); sql += wxT(" FROM main.topologies"); @@ -8166,11 +8476,11 @@ TableTree->AddRasterCoverage(&coverage); } } sqlite3_free_table(results); } - if (ExistsVectorCoverages()) + if (ExistsVectorCoverages() && ExistsTopologies() && ExistsNetworks()) { // fetching Vector Coverages sql = wxT("SELECT 'table', c.coverage_name, g.srid, g.geometry_type "); sql += wxT("FROM main.vector_coverages AS c "); sql += wxT("JOIN main.geometry_columns AS g ON ("); @@ -8266,11 +8576,13 @@ sqlite3_free_table(results); } // fetching persistent tables and views sql = wxT - ("SELECT name, sql, type FROM main.sqlite_master WHERE (type = 'table' OR type = 'view') ORDER BY name"); + ("SELECT 'main', name, sql, type FROM main.sqlite_master WHERE (type = 'table' OR type = 'view') " + "UNION SELECT 'temp', name, sql, type FROM temp.sqlite_master WHERE type = 'table' " + "AND name IN ('postgis_geometry_columns', 'tmp_vector_coverages') ORDER BY name"); xsql = (char *) malloc((sql.Len() * 4) + 1); strcpy(xsql, sql.ToUTF8()); int ret = sqlite3_get_table(SqliteHandle, xsql, &results, &rows, &columns, &errMsg); free(xsql); @@ -8286,18 +8598,27 @@ ; else { for (i = 1; i <= rows; i++) { - name = results[(i * columns) + 0]; - createSql = results[(i * columns) + 1]; - type = results[(i * columns) + 2]; + const char *db = results[(i * columns) + 0]; + name = results[(i * columns) + 1]; + createSql = results[(i * columns) + 2]; + type = results[(i * columns) + 3]; if (strstr(createSql, " VIRTUAL ") || strstr(createSql, " virtual ")) virtualTable = true; else virtualTable = false; tblName = wxString::FromUTF8(name); + wxString dbName = wxString::FromUTF8(db); + if (dbName.Cmp(wxT("temp")) == 0 + && (tblName.Cmp(wxT("postgis_geometry_columns")) == 0 || + tblName.Cmp(wxT("tmp_vector_coverages")) == 0)) + { + list->Add(dbName, tblName); + continue; + } if (strcmp(type, "view") == 0) list->Add(tblName, true, false); else list->Add(tblName, false, virtualTable); } @@ -8312,11 +8633,15 @@ FindGeometries(list); ptv = list->GetFirst(); while (ptv != NULL) { // inserting items into the Tree Control View - if (ptv->IsView() == true) + if (ptv->IsTmpMetadata() == true) + TableTree->AddTmpMetadata(ptv->GetName()); + else if (ptv->IsPostgresTable(&PostgresList) == true) + TableTree->AddPostgresTable(&PostgresList, ptv->GetName()); + else if (ptv->IsView() == true) TableTree->AddView(ptv->GetName(), ptv->IsGeometry()); else if (ptv->IsGeoPackageGeometry() == true) TableTree->AddGeoPackageTable(ptv->GetName()); else if (ptv->IsGeoPackageVirtualGeometry() == true) TableTree->AddGeoPackageVirtualTable(ptv->GetName()); @@ -8332,11 +8657,12 @@ delete list; // fetching temporary tables and views sql = wxT - ("SELECT name, sql, type FROM sqlite_temp_master WHERE (type = 'table' OR type = 'view') ORDER BY name"); + ("SELECT name, sql, type FROM sqlite_temp_master WHERE (type = 'table' OR type = 'view') " + "AND name NOT IN ('postgis_geometry_columns', 'tmp_vector_coverages') ORDER BY name"); xsql = (char *) malloc((sql.Len() * 4) + 1); strcpy(xsql, sql.ToUTF8()); ret = sqlite3_get_table(SqliteHandle, xsql, &results, &rows, &columns, &errMsg); free(xsql); @@ -9099,11 +9425,12 @@ else { for (i = 1; i <= rows; i++) { column = results[(i * columns) + 0]; - if (atoi(results[(i * columns) + 1]) == 1) + if (atoi(results[(i * columns) + 1]) == 1 + || atoi(results[(i * columns) + 1]) == 3) index = true; else index = false; if (atoi(results[(i * columns) + 1]) == 2) cached = true; @@ -10864,10 +11191,19 @@ } return; } TableTree->SetFdoOgrMode(false); } + +void MyFrame::AutoPostgresStop() +{ +// +// trying to stop the PostgreSQL auto-wrapper +// + DoDropPostgresTables(); + PostgresList.Clear(); +} void MyFrame::AutoFDOStop() { // // trying to stop the FDO-OGR auto-wrapper @@ -11286,11 +11622,11 @@ xname = sqlite3_mprintf("vgpkg_%s", p->GetName()); xname2 = gaiaDoubleQuotedSql(xname); xname3 = gaiaDoubleQuotedSql(p->GetName()); sprintf(sql, "CREATE VIRTUAL TABLE \"%s\" USING VirtualGPKG(\"%s\")", xname2, xname3); - free(xname); + sqlite3_free(xname); free(xname2); free(xname3); ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); if (ret != SQLITE_OK) goto error; @@ -11436,11 +11772,11 @@ xname2 = gaiaDoubleQuotedSql(xname); xname3 = gaiaDoubleQuotedSql(p->GetName()); sprintf(sql, "CREATE VIRTUAL TABLE \"%s\".\"%s\" USING VirtualGPKG(\"%s\", \"%s\")", xdb_prefix, xname2, xdb_prefix, xname3); - free(xname); + sqlite3_free(xname); free(xname2); free(xname3); free(xdb_prefix); ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, NULL); if (ret != SQLITE_OK) @@ -13005,10 +13341,27 @@ msg += wxT("Such a condition could eventually cause serious security breaches."); wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_EXCLAMATION, this); return false; } + +void MyFrame::FeedZipHtml(unsigned char *zip, int offset, const char *data) +{ +// +// feeding data into the Html ZIP buffer +// + int i; + int j; + for (i = 0, j = 0; i < (int) strlen(data); i += 2, j++) + { + char byte_hi; + char byte_lo; + byte_hi = *(data + i); + byte_lo = *(data + i + 1); + *(zip + offset + j) = ColorMapEntry::ParseHex(byte_hi, byte_lo); + } +} MyStatusBar::MyStatusBar(MyFrame * parent):wxStatusBar(parent) { // constructor Parent = parent; @@ -13059,4170 +13412,5 @@ wxStatusBar *sb = Parent->GetStatusBar(); if (!sb) return; sb->SetStatusText(msg, 1); } - -void MyFrame::GetHelp(wxString & html) -{ -// -// return the HTML Help -// - html = - wxT(""); - html += wxT(""); - html += wxT(""); - html += - wxT - (""); - html += wxT("SQLite + SpatiaLite quick Help"); - html += wxT(""); - html += wxT(""); - html += wxT("

SQLite + SpatiaLite quick Help

"); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT("
Index of contents
1.SQLite SQL syntax
2.SQLite SQL functions
3.SpatiaLite SQL Spatial functions
"); - html += wxT("

SQLite SQL syntax

"); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT("
ALTER TABLEsql-statement ::= ALTER TABLE [database-name .] table-name alteration
"); - html += wxT("alteration ::= RENAME TO new-table-name
"); - html += wxT("alteration ::= ADD [COLUMN] column-def
ANALYZEsql-statement ::= ANALYZE
"); - html += wxT("sql-statement ::= ANALYZE database-name
"); - html += - wxT("sql-statement ::= ANALYZE [database-name .] table-name
ATTACH DATABASEsql-statement ::= ATTACH [DATABASE] database-filename AS database-name
BEGIN TRANSACTIONsql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= END [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]
COMMIT TRANSACTIONsql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= END [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]
CREATE INDEXsql-statement ::= CREATE [UNIQUE] INDEX [IF NOT EXISTS] [database-name .] index-name
"); - html += wxT("ON table-name ( column-name [, column-name]* )
"); - html += - wxT - ("column-name ::= name [ COLLATE collation-name] [ ASC | DESC ]
CREATE TABLEsql-command ::= CREATE [TEMP | TEMPORARY] TABLE [IF NOT EXISTS] [database-name .] table-name (
"); - html += wxT("column-def [, column-def]*
"); - html += wxT("[, constraint]*
"); - html += wxT(")
"); - html += - wxT - ("sql-command ::= CREATE [TEMP | TEMPORARY] TABLE [database-name.] table-name AS select-statement
"); - html += - wxT - ("column-def ::= name [type] [[CONSTRAINT name] column-constraint]*
"); - html += wxT("type ::= typename |
"); - html += wxT("typename ( number ) |
"); - html += wxT("typename ( number , number )
"); - html += wxT("column-constraint ::= NOT NULL [ conflict-clause ] |
"); - html += - wxT("PRIMARY KEY [sort-order] [ conflict-clause ] [AUTOINCREMENT] |
"); - html += wxT("UNIQUE [ conflict-clause ] |
"); - html += wxT("CHECK ( expr ) |
"); - html += wxT("DEFAULT value |
"); - html += wxT("COLLATE collation-name
"); - html += - wxT("constraint ::= PRIMARY KEY ( column-list ) [ conflict-clause ] |
"); - html += wxT("UNIQUE ( column-list ) [ conflict-clause ] |
"); - html += wxT("CHECK ( expr )
"); - html += wxT("conflict-clause ::= ON CONFLICT conflict-algorithm
CREATE TRIGGERsql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER [IF NOT EXISTS] trigger-name [ BEFORE | AFTER ]
"); - html += wxT("database-event ON [database-name .] table-name
"); - html += wxT("trigger-action
"); - html += - wxT - ("sql-statement ::= CREATE [TEMP | TEMPORARY] TRIGGER [IF NOT EXISTS] trigger-name INSTEAD OF
"); - html += wxT("database-event ON [database-name .] view-name
"); - html += wxT("trigger-action
"); - html += wxT("database-event ::= DELETE |
"); - html += wxT("INSERT |
"); - html += wxT("UPDATE |
"); - html += wxT("UPDATE OF column-list
"); - html += wxT("trigger-action ::= [ FOR EACH ROW ] [ WHEN expression ]
"); - html += wxT("BEGIN
"); - html += wxT("trigger-step ; [ trigger-step ; ]*
"); - html += wxT("END
"); - html += wxT("trigger-step ::= update-statement | insert-statement |
"); - html += wxT("delete-statement | select-statement
CREATE VIEWsql-command ::= CREATE [TEMP | TEMPORARY] VIEW [IF NOT EXISTS] [database-name.] view-name AS select-statement
CREATE VIRTUAL TABLEsql-command ::= CREATE VIRTUAL TABLE [database-name .] table-name USING module-name [( arguments )]
DELETEsql-statement ::= DELETE FROM [database-name .] table-name [WHERE expr]
DETACH DATABASEsql-command ::= DETACH [DATABASE] database-name
DROP INDEXsql-command ::= DROP INDEX [IF EXISTS] [database-name .] index-name
DROP TABLEsql-command ::= DROP TABLE [IF EXISTS] [database-name.] table-name
DROP TRIGGERsql-statement ::= DROP TRIGGER [IF EXISTS] [database-name .] trigger-name
DROP VIEWsql-command ::= DROP VIEW [IF EXISTS] view-name
END TRANSACTIONsql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= END [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]
EXPLAINsql-statement ::= EXPLAIN sql-statement
INSERTsql-statement ::= INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] VALUES(value-list) |
"); - html += - wxT - ("INSERT [OR conflict-algorithm] INTO [database-name .] table-name [(column-list)] select-statement
ON CONFLICT clauseconflict-clause ::= ON CONFLICT conflict-algorithm
"); - html += - wxT - ("conflict-algorithm ::= ROLLBACK | ABORT | FAIL | IGNORE | REPLACE
PRAGMAsql-statement ::= PRAGMA name [= value] |
"); - html += wxT("PRAGMA function(arg)
"); - html += wxT("PRAGMA auto_vacuum;
"); - html += - wxT("PRAGMA auto_vacuum = 0 | none | 1 | full | 2 | incremental;
"); - html += wxT("PRAGMA cache_size;
"); - html += wxT("PRAGMA cache_size = Number-of-pages;
"); - html += wxT("PRAGMA case_sensitive_like;
"); - html += wxT("PRAGMA case_sensitive_like = 0 | 1;
"); - html += wxT("PRAGMA count_changes;
"); - html += wxT("PRAGMA count_changes = 0 | 1;
"); - html += wxT("PRAGMA default_cache_size;
"); - html += wxT("PRAGMA default_cache_size = Number-of-pages;
"); - html += wxT("PRAGMA empty_result_callbacks;
"); - html += wxT("PRAGMA empty_result_callbacks = 0 | 1;
"); - html += wxT("PRAGMA encoding;
"); - html += wxT("PRAGMA encoding = \"UTF-8\";
"); - html += wxT("PRAGMA encoding = \"UTF-16\";
"); - html += wxT("PRAGMA encoding = \"UTF-16le\";
"); - html += wxT("PRAGMA encoding = \"UTF-16be\";
"); - html += wxT("PRAGMA foreign_keys;
"); - html += wxT("PRAGMA foreign_keys = 0 | 1;
"); - html += wxT("PRAGMA full_column_names;
"); - html += wxT("PRAGMA full_column_names = 0 | 1;
"); - html += wxT("PRAGMA fullfsync;
"); - html += wxT("PRAGMA fullfsync = 0 | 1;
"); - html += wxT("PRAGMA journal_mode;
"); - html += wxT("PRAGMA database.journal_mode;
"); - html += - wxT("PRAGMA journal_mode = DELETE | TRUNCATE | PERSIST | MEMORY | OFF
"); - html += - wxT - ("PRAGMA database.journal_mode = DELETE | TRUNCATE | PERSIST | MEMORY | OFF
"); - html += wxT("PRAGMA journal_size_limit;
"); - html += wxT("PRAGMA journal_size_limit = N
"); - html += wxT("PRAGMA legacy_file_format;
"); - html += wxT("PRAGMA legacy_file_format = 0 | 1
"); - html += wxT("PRAGMA locking_mode;
"); - html += wxT("PRAGMA locking_mode = NORMAL | EXCLUSIVE
"); - html += wxT("PRAGMA page_size;
"); - html += wxT("PRAGMA page_size = bytes;
"); - html += wxT("PRAGMA max_page_count;
"); - html += wxT("PRAGMA max_page_count = N;
"); - html += wxT("PRAGMA read_uncommitted;
"); - html += wxT("PRAGMA read_uncommitted = 0 | 1;
"); - html += wxT("PRAGMA recursive_triggers;
"); - html += wxT("PRAGMA recursive_triggers = 0 | 1;
"); - html += wxT("PRAGMA reverse_unordered_selects;
"); - html += wxT("PRAGMA reverse_unordered_selects = 0 | 1;
"); - html += wxT("PRAGMA short_column_names;
"); - html += wxT("PRAGMA short_column_names = 0 | 1;
"); - html += wxT("PRAGMA synchronous;
"); - html += wxT("PRAGMA synchronous = FULL; (2)
"); - html += wxT("PRAGMA synchronous = NORMAL; (1)
"); - html += wxT("PRAGMA synchronous = OFF; (0)
"); - html += wxT("PRAGMA temp_store;
"); - html += wxT("PRAGMA temp_store = DEFAULT; (0)
"); - html += wxT("PRAGMA temp_store = FILE; (1)
"); - html += wxT("PRAGMA temp_store = MEMORY; (2)
"); - html += wxT("PRAGMA temp_store_directory;
"); - html += wxT("PRAGMA temp_store_directory = 'directory-name';
"); - html += wxT("PRAGMA database_list;
"); - html += wxT("PRAGMA foreign_key_list(table-name);
"); - html += wxT("PRAGMA [database].freelist_count;
"); - html += wxT("PRAGMA index_info(index-name);
"); - html += wxT("PRAGMA index_list(table-name);
"); - html += wxT("PRAGMA table_info(table-name);
"); - html += wxT("PRAGMA [database.]schema_version;
"); - html += wxT("PRAGMA [database.]schema_version = integer ;
"); - html += wxT("PRAGMA [database.]user_version;
"); - html += wxT("PRAGMA [database.]user_version = integer ;
"); - html += wxT("PRAGMA integrity_check;
"); - html += wxT("PRAGMA integrity_check(integer)
"); - html += wxT("PRAGMA quick_check;
"); - html += wxT("PRAGMA quick_check(integer)
"); - html += wxT("PRAGMA parser_trace = ON; (1)
"); - html += wxT("PRAGMA parser_trace = OFF; (0)
"); - html += wxT("PRAGMA vdbe_trace = ON; (1)
"); - html += wxT("PRAGMA vdbe_trace = OFF; (0)
"); - html += wxT("PRAGMA vdbe_listing = ON; (1)
"); - html += wxT("PRAGMA vdbe_listing = OFF; (0)
REINDEXsql-statement ::= REINDEX collation name
"); - html += - wxT - ("sql-statement ::= REINDEX [database-name .] table/index-name
REPLACEsql-statement ::= REPLACE INTO [database-name .] table-name [( column-list )] VALUES ( value-list ) |
"); - html += - wxT - ("REPLACE INTO [database-name .] table-name [( column-list )] select-statement
ROLLBACK TRANSACTIONsql-statement ::= BEGIN [ DEFERRED | IMMEDIATE | EXCLUSIVE ] [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= END [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= COMMIT [TRANSACTION [name]]
"); - html += wxT("sql-statement ::= ROLLBACK [TRANSACTION [name]]
SELECTsql-statement ::= SELECT [ALL | DISTINCT] result [FROM table-list]
"); - html += wxT("[WHERE expr]
"); - html += wxT("[GROUP BY expr-list]
"); - html += wxT("[HAVING expr]
"); - html += wxT("[compound-op select]*
"); - html += wxT("[ORDER BY sort-expr-list]
"); - html += wxT("[LIMIT integer [( OFFSET | , ) integer]]
"); - html += wxT("result ::= result-column [, result-column]*
"); - html += - wxT("result-column ::= * | table-name . * | expr [ [AS] string ]
"); - html += wxT("table-list ::= table [join-op table join-args]*
"); - html += wxT("table ::= table-name [AS alias] |
"); - html += wxT("( select ) [AS alias]
"); - html += - wxT - ("join-op ::= , | [NATURAL] [LEFT | RIGHT | FULL] [OUTER | INNER | CROSS] JOIN
"); - html += wxT("join-args ::= [ON expr] [USING ( id-list )]
"); - html += - wxT("sort-expr-list ::= expr [sort-order] [, expr [sort-order]]*
"); - html += wxT("sort-order ::= [ COLLATE collation-name ] [ ASC | DESC ]
"); - html += - wxT("compound_op ::= UNION | UNION ALL | INTERSECT | EXCEPT
UPDATEsql-statement ::= UPDATE [ OR conflict-algorithm ] [database-name .] table-name
"); - html += wxT("SET assignment [, assignment]*
"); - html += wxT("[WHERE expr]
"); - html += wxT("assignment ::= column-name = expr
VACUUMsql-statement ::= VACUUM
"); - html += wxT("back to index"); - html += - wxT - ("

SQLite SQL functions

"); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (" "); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (" "); - html += wxT("
ordinary functions
back to index
abs(X)Return the absolute value of the numeric argument X. "); - html += - wxT - ("Return NULL if X is NULL. Return 0.0 if X is not a numeric value.
changes()Returns the number of database rows that were changed or inserted or deleted "); - html += - wxT - ("by the most recently completed INSERT, DELETE, or UPDATE statement, exclusive of statements in lower-level triggers.
char(X1,X2,...,XN)The char(X1,X2,...,XN) function returns a string "); - html += - wxT - ("composed of characters having the unicode code point values of integers X1 through XN, respectively.
coalesce(X,Y,...)Return a copy of the first non-NULL argument. "); - html += - wxT - ("If all arguments are NULL then NULL is returned. There must be at least 2 arguments.
glob(X,Y)This function is used to implement the \"X GLOB Y\" syntax of SQLite. "); - html += - wxT - ("The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the GLOB operator.
ifnull(X,Y)Return a copy of the first non-NULL argument. "); - html += - wxT - ("If both arguments are NULL then NULL is returned. This behaves the same as coalesce().
instr(X,Y)The instr(X,Y) function finds the first occurrence of string Y within string X and returns the "); - html += - wxT - ("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 "); - html += - wxT - ("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) "); - html += - wxT - ("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.
hex(X)The argument is interpreted as a BLOB. "); - html += - wxT - ("The result is a hexadecimal rendering of the content of that blob.
last_insert_rowid()Return the ROWID of the last row insert from this connection to the database. "); - html += - wxT - ("This is the same value that would be returned from the sqlite3_last_insert_rowid() API function.
length(X)Return the string length of X in characters. "); - html += - wxT - ("If SQLite is configured to support UTF-8, then the number of UTF-8 characters is returned, not the number of bytes.
like(X,Y)
like(X,Y,Z)
This function is used to implement the \"X LIKE Y [ESCAPE Z]\" syntax of SQL."); - html += - wxT - ("If the optional ESCAPE clause is present, then the user-function is invoked with three arguments. "); - html += wxT("Otherwise, it is invoked with two arguments only. "); - html += - wxT - ("The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the LIKE operator. "); - html += - wxT - ("When doing this, it may be important to override both the two and three argument versions of the like() function. "); - html += - wxT - ("Otherwise, different code may be called to implement the LIKE operator depending on whether or not an ESCAPE clause was specified.
load_extension(X)
load_extension(X,Y)
Load SQLite extensions "); - html += - wxT("out of the shared library file named X using the entry point Y. "); - html += - wxT - ("The result is a NULL. If Y is omitted then the default entry point of sqlite3_extension_init is used. "); - html += - wxT - ("This function raises an exception if the extension fails to load or initialize correctly.
lower(X)Return a copy of string X will all ASCII characters converted to lower case. "); - html += - wxT - ("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.
ltrim(X)
ltrim(X,Y)
Return a string formed by removing any and all characters "); - html += - wxT - ("that appear in Y from the left side of X. If the Y argument is omitted, spaces are removed.
max(X,Y,...)Return the argument with the maximum value. "); - html += wxT("Arguments may be strings in addition to numbers. "); - html += wxT("The maximum value is determined by the usual sort order. "); - html += - wxT - ("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.
min(X,Y,...)Return the argument with the minimum value. "); - html += wxT("Arguments may be strings in addition to numbers. "); - html += wxT("The minimum value is determined by the usual sort order. "); - html += - wxT - ("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.
nullif(X,Y)Return the first argument if the arguments are different, otherwise return NULL.
quote(X)This routine return a string which is the value of its argument suitable for inclusion "); - html += - wxT - ("into another SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. "); - html += - wxT - ("BLOBs are encoded as hexadecimal literals. The implementation of VACUUM uses this function. "); - html += - wxT - ("The function is also useful when writing triggers to implement undo/redo functionality.
random()Return a pseudo-random integer between -9223372036854775808 and +9223372036854775807.
randomblob(N)Return an N-byte blob containing pseudo-random bytes. N should be a postive integer.
replace(X,Y,Z)Return a string formed by substituting string Z for every occurrance of string Y in string X. "); - html += - wxT("The BINARY collating sequence is used for comparisons.
round(X)
round(X,Y)
Round off the number X to Y digits to the right of the decimal point. "); - html += wxT("If the Y argument is omitted, 0 is assumed.
rtrim(X)
rtrim(X,Y)
Return a string formed by removing any and all characters "); - html += - wxT - ("that appear in Y from the right side of X. If the Y argument is omitted, spaces are removed.
sqlite_version(X)Return the version string for the SQLite library that is running. Example: \"3.5.9\"
substr(X,Y,Z)
substr(X,Y)
Return a substring of input string X that begins with the Y-th character "); - html += - wxT - ("and which is Z characters long. If Z is omitted then all character through the end of the string are returned. "); - html += wxT("The left-most character of X is number 1. "); - html += - wxT - ("If Y is negative the the first character of the substring is found by counting from the right rather than the left. "); - html += - wxT - ("If X is string then characters indices refer to actual UTF-8 characters. If X is a BLOB then the indices refer to bytes.
trim(X)
trim(X,Y)
Return a string formed by removing any and all characters that appear in Y from both ends of X. "); - html += wxT("If the Y argument is omitted, spaces are removed.
typeof(X)Return the type of the expression X. "); - html += - wxT - ("The only return values are \"null\", \"integer\", \"real\", \"text\", and \"blob\".
unicode(X)The unicode(X) function returns the numeric unicode code point corresponding to the first "); - html += - wxT - ("character of the string X. If the argument to unicode(X) is not a string then the result is undefined.
upper(X)Return a copy of input string X converted to all upper-case letters. "); - html += - wxT - ("The implementation of this function uses the C library routine toupper() which means it may not work correctly on non-ASCII UTF-8 strings.
zeroblob(N)Return a BLOB consisting of N bytes of 0x00. "); - html += wxT("SQLite manages these zeroblobs very efficiently. "); - html += - wxT - ("Zeroblobs can be used to reserve space for a BLOB that is later written using incremental BLOB I/O.
aggregate functions
back to index
avg(X)Return the average value of all non-NULL X within a group. "); - html += - wxT - ("String and BLOB values that do not look like numbers are interpreted as 0. "); - html += - wxT - ("The result of avg() is always a floating point value even if all inputs are integers.
count(X)
count(*)
The first form return a count of the number of times that X is not NULL in a group. "); - html += - wxT - ("The second form (with no argument) return the total number of rows in the group.
group_concat(X)
group_concat(X,Y)
The result is a string which is the concatenation of all non-NULL values of X. "); - html += - wxT - ("If parameter Y is the separator between instances of X. A comma (\",\") is used as the separator if Y is omitted.
max(X)Return the maximum value of all values in the group. "); - html += - wxT("The usual sort order is used to determine the maximum.
min(X)Return the minimum non-NULL value of all values in the group. "); - html += - wxT - ("The usual sort order is used to determine the minimum. NULL is only returned if all values in the group are NULL.
sum(X)
total(X)
Return the numeric sum of all non-NULL values in the group. "); - html += - wxT - ("If there are no non-NULL input rows then sum() return NULL but total() return 0.0. "); - html += - wxT - ("NULL is not normally a helpful result for the sum of no rows but the SQL standard requires it and most other SQL "); - html += - wxT - ("database engines implement sum() that way so SQLite does it in the same way in order to be compatible. "); - html += - wxT - ("The non-standard total() function is provided as a convenient way to work around this design problem in the SQL language.
"); - html += - wxT - ("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. "); - html += - wxT - ("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.
"); - html += - wxT - ("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."); - html += wxT("Total() never throws an exception.
"); - html += wxT("back to index"); - html += wxT("

SpatiaLite SQL Spatial functions

"); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT("
back to index"); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT("ST_SetStartPoint( line Linestring , point Point ) : Linestring"); - html += - wxT - (""); - html += - wxT("ST_SetEndtPoint( line Linestring , point Point ) : Linestring"); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT(""); - html += - wxT(""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT(""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += - wxT - (""); - html += wxT("
SQL version info [and build options] functions"); - html += wxT("
back to index
spatialite_version( void ) : Stringreturns the current SpatiaLite version
spatialite_target_cpu( void ) : Stringreturns the current SpatiaLite Target CPU
proj4_version( void ) : Stringreturns the current PROJ.4 version, or NULL if PROJ.4 is currently unsupported
geos_version( void ) : Stringreturns the current GEOS version, or NULL if GEOS is currently unsupported
rttopo_version( void ) : Stringreturns the current RTTOPO version, or NULL if RTTOPO is currently unsupported
libxml2_version( void ) : Stringreturns the current LibXML2 version, or NULL if LibXML2 is currently unsupported
HasIconv( void ) : BooleanTRUE if the underlaying library was built enabling ICONV
HasMathSQL( void ) : BooleanTRUE if the underlaying library was built enabling MATHSQL
HasGeoCallbacks( void ) : BooleanTRUE if the underlaying library was built enabling GEOCALLBACKS
HasProj( void ) : BooleanTRUE if the underlaying library was built enabling PROJ
HasGeos( void ) : BooleanTRUE if the underlaying library was built enabling GEOS
HasGeosAdvanced( void ) : BooleanTRUE if the underlaying library was built enabling GEOSADVANCED
HasGeosTrunk( void ) : BooleanTRUE if the underlaying library was built enabling GEOSTRUNK
HasRtTopo( void ) : BooleanTRUE if the underlaying library was built enabling RTTOPO
HasLibXML2( void ) : BooleanTRUE if the underlaying library was built enabling LibXML2
HasEpsg( void ) : BooleanTRUE if the underlaying library was built enabling EPSG
HasFreeXL( void ) : BooleanTRUE if the underlaying library was built enabling FreeXL
generic SQL functions"); - html += wxT("
back to index
CastToInteger( value Generic ) : Integerreturns the intput value possibly casted to the Integer data-type: NULL if no conversion is possible.
CastToDouble( value Generic ) : Double precisionreturns the intput value possibly casted to the Double data-type: NULL if no conversion is possible.
CastToText( value Generic ) : Text
CastToText( value Generic ) : Text
returns the intput value possibly casted to the Text data-type: NULL if no conversion is possible.
"); - html += - wxT - ("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.
CastToBlob( value Generic ) : Blob
"); - html += wxT("(CastToBlob (value Generic , hex_input Boolean ) : Blob
returns the intput value possibly casted to the Blob data-type: NULL if no conversion is possible.
ForceAsNull( val1 Generic , val2 Generic ) : Genericif \"val1\" and \"val2\" are equal (and exactly of the same data-type) NULL will be returned; "); - html += - wxT - ("otherwise \"val1\" will be returned absolutely untouched and still preserving its originale data-type.
CreateUUID( void ) : Textreturns a Version 4 (random) UUID (Universally unique identifier).
MD5Checksum( BLOB | TEXT ) : Textreturns the MD5 checksum corresponding to the input value.
Will return NULL for non-BLOB input.
MD5TotalChecksum( BLOB | TEXT ) : Textreturns a cumulative MD5 checksum.
Aggregate function.
SQL functions reporting "); - html += wxT("GEOS / RTTOPO errors and warnings"); - html += - wxT - ("
GEOS_GetLastWarningMsg( void ) : StringWill return the most recent warning message returned by GEOS (if any).
"); - html += - wxT("NULL will be returned if there is no pending GEOS warning.
GEOS_GetLastErrorMsg( void ) : StringWill return the most recent error message returned by GEOS (if any).
"); - html += - wxT("NULL will be returned if there is no pending GEOS error.
GEOS_GetLastAuxErrorMsg( void ) : StringWill return the most recent (auxiliary) error message returned by GEOS (if any).
"); - html += - wxT - ("NULL will be returned if there is no pending GEOS (auxiliary) error.
GEOS_GetCriticalPointFromMsg( void ) : Point
"); - html += wxT("GEOS_GetCriticalPointFromMsg( SRID Integer ) : Point
Will (possibly) return a Point Geometry extracted from the latest error / warning "); - html += - wxT - ("message returned by GEOS.
NULL will be returned if there is no pending GEOS message, or if the "); - html += - wxT("current GEOS message doesn't contain a critical Point.
RTTOPO_GetLastWarningMsg( void ) : StringWill return the most recent warning message returned by RTTOPO (if any).
"); - html += - wxT("NULL will be returned if there is no pending RTTOPO error.
RTTOPO_GetLastErrorMsg( void ) : StringWill return the most recent error message returned by RTTOPO (if any).
"); - html += - wxT("NULL will be returned if there is no pending RTTOPO error.
SQL math functions"); - html += wxT("
back to index
Abs( x Double precision ) : Double precisionreturns the absolute value of x
Acos( x Double precision ) : Double precisionreturns the arc cosine of x, that is, the value whose cosine is x
"); - html += wxT("returns NULL if x is not in the range -1 to 1
Asin( x Double precision ) : Double precisionreturns the arc sine of x, that is, the value whose sine is x
"); - html += wxT("returns NULL if x is not in the range -1 to 1
Atan( x Double precision ) : Double precisionreturns the arc tangent of x, that is, the value whose tangent is x
Ceil( x Double precision ) : Double precision
"); - html += wxT("Ceiling( x Double precision ) : Double precision
returns the smallest integer value not less than x
Cos( x Double precision ) : Double precisionreturns the cosine of x, where x is given in radians
Cot( x Double precision ) : Double precisionreturns the cotangent of x, where x is given in radians
Degrees( x Double precision ) : Double precisionreturns the argument x, converted from radians to degrees
Exp( x Double precision ) : Double precisionreturns the value of e (the base of natural logarithms) raised to the power of x
"); - html += - wxT - ("the inverse of this function is Log() (using a single argument only) or Ln()
Floor( x Double precision ) : Double precisionreturns the largest integer value not greater than x
Ln( x Double precision ) : Double precision
"); - html += wxT("Log( x Double precision ) : Double precision
returns the natural logarithm of x; that is, the base-e logarithm of x
"); - html += - wxT - ("If x is less than or equal to 0, then NULL is returned
Log( b Double precision, x Double precision ) : Double precisionreturns the logarithm of x to the base b
"); - html += - wxT - ("If x is less than or equal to 0, or if b is less than or equal to 1, then NULL is returned
"); - html += - wxT - ("Log(b, x) is equivalent to Log(x) / Log(b)
Log2( x Double precision ) : Double precisionreturns the base-2 logarithm of x
"); - html += - wxT - ("Log2(x) is equivalent to Log(x) / Log(2)
Log10( x Double precision ) : Double precisionreturns the base-10 logarithm of x
"); - html += - wxT - ("Log10(x) is equivalent to Log(x) / Log(10)
PI( void ) : Double precisionreturns the value of PI
Pow( x Double precision, y Double precision ) : Double precision
"); - html += - wxT - ("Power( x Double precision, y Double precision ) : Double precision
returns the value of x raised to the power of y
Radians( x Double precision ) : Double precisionreturns the argument x, converted from degrees to radians
Sign( x Double precision ) : Double precisionreturns the sign of the argument as -1, 0, or 1, "); - html += - wxT - ("depending on whether x is negative, zero, or positive.
Sin( x Double precision ) : Double precisionreturns the sine of x, where x is given in radians
Sqrt( x Double precision ) : Double precisionreturns the square root of a non-negative number x
Stddev_pop( x Double precision ) : Double precisionreturns the population standard deviation of the input values
"); - html += wxT("aggregate function
Stddev_samp( x Double precision ) : Double precisionreturns the sample standard deviation of the input values
"); - html += wxT("aggregate function
Tan( x Double precision ) : Double precisionreturns the tangent of x, where x is given in radians
Var_pop( x Double precision ) : Double precisionreturns the population variance of the input values (square of the population standard deviation)
"); - html += wxT("aggregate function
Var_samp( x Double precision ) : Double precisionreturns the sample variance of the input values (square of the sample standard deviation)
"); - html += wxT("aggregate function
SQL length/distance unit-conversion functions"); - html += wxT("
back to index
CvtToKm( x Double precision ) : Double precision
CvtFromKm( x Double precision ) : Double precision
meters / kilometers
CvtToDm( x Double precision ) : Double precision
CvtFromDm( x Double precision ) : Double precision
meters / decimeters
CvtToCm( x Double precision ) : Double precision
CvtFromCm( x Double precision ) : Double precision
meters / centimeters
CvtToMm( x Double precision ) : Double precision
CvtFromMm( x Double precision ) : Double precision
meters / millimeters
CvtToKmi( x Double precision ) : Double precision
CvtFromKmi( x Double precision ) : Double precision
meters / internation nautical miles
CvtToIn( x Double precision ) : Double precision
CvtFromIn( x Double precision ) : Double precision
meters / international inches
CvtToFt( x Double precision ) : Double precision
CvtFromFt( x Double precision ) : Double precision
meters / international feet
CvtToYd( x Double precision ) : Double precision
CvtFromYd( x Double precision ) : Double precision
meters / international yards
CvtToMi( x Double precision ) : Double precision
CvtFromMi( x Double precision ) : Double precision
meters / international statute miles
CvtToFath( x Double precision ) : Double precision
CvtFromFath( x Double precision ) : Double precision
meters / international fathoms
CvtToCh( x Double precision ) : Double precision
CvtFromCh( x Double precision ) : Double precision
meters / international chains
CvtToLink( x Double precision ) : Double precision
CvtFromLink( x Double precision ) : Double precision
meters / international links
CvtToUsIn( x Double precision ) : Double precision
CvtFromUsIn( x Double precision ) : Double precision
meters / U.S. inches
CvtToUsFt( x Double precision ) : Double precision
CvtFromUsFt( x Double precision ) : Double precision
meters / U.S. feet
CvtToUsYd( x Double precision ) : Double precision
CvtFromUsYd( x Double precision ) : Double precision
meters / U.S. yards
CvtToUsMi( x Double precision ) : Double precision
CvtFromUsMi( x Double precision ) : Double precision
meters / U.S. statute miles
CvtToUsCh( x Double precision ) : Double precision
CvtFromUsCh( x Double precision ) : Double precision
meters / U.S. chains
CvtToIndFt( x Double precision ) : Double precision
CvtFromIndFt( x Double precision ) : Double precision
meters / indian feet
CvtToIndYd( x Double precision ) : Double precision
CvtFromIndYd( x Double precision ) : Double precision
meters / indian yards
CvtToIndCh( x Double precision ) : Double precision
CvtFromIndCh( x Double precision ) : Double precision
meters / indian chains
DD/DMS conversion functions (longitude/latitude)"); - html += wxT("
back to index
LongLatToDMS( longitude Double precision , latitude Double precision ) : Stringwill return a DMS string (Degrees, Minutes and Seconds) starting from DD (Decimal Degrees) input coordinates
"); - html += wxT("NULL will be returned on invalid input.
LongitudeFromDMS( dms_expression String ) : Double precision
LatitudeFromDMS( dms_expression String ) : Double precision
will return the DD coordinates from within a DMS expression
"); - html += wxT("NULL will be returned on invalid input.
SQL utility functions for BLOB objects"); - html += wxT("
back to index
IsZipBlob( content Blob ) : IntegerThe 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.
"); - html += - wxT - ("TRUE if this BLOB object corresponds to a valid ZIP-compressed file
IsPdfBlob( content Blob ) : IntegerThe 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.
"); - html += - wxT - ("TRUE if this BLOB object corresponds to a valid PDF document
IsGifBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid GIF image
IsPngBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid PNG image
IsTiffBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid TIFF image
IsJpegBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid JPEG image
IsExifBlob( image Blob ) : IntegerThe 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.
"); - html += wxT("TRUE if this BLOB object corresponds to a valid EXIF image
"); - html += - wxT - ("Please note: any valid EXIF image is a valid JPEG as well
IsExifGpsBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid EXIF-GPS image
"); - html += - wxT - ("Please note: any valid EXIF-GPS image is a valid EXIF and JPEG as well
IsWebpBlob( image Blob ) : IntegerThe 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.
"); - html += - wxT("TRUE if this BLOB object corresponds to a valid WebP image
GetMimeType( payload Blob ) : StringThe return type is Text.
"); - html += - wxT - ("NULL could be returned for an invalid argument or if no valid mime-type is detected.
BlobFromFile( filepath String ) : BLOBIf filepath corresponds to some valid pathname, and the corresponding file "); - html += - wxT - ("can be actually accessed in read mode, then the whole file content will be returned as a BLOB value.
"); - html += - wxT - ("Otherwise NULL will be returned.
Please note: SQLite doesn't support BLOB values bigger than SQLITE_MAX_LENGTH (usually, 1 GB).
"); - html += - wxT - ("Please note: security restrictions apply to this function, which is really supported only when the environment variable \"SPATIALTE_SECURITY=relaxed\" is explicitly set.
BlobToFile( payload BLOB , filepath String ) : IntegerIf payload is of the BLOB-type, and if filepath corresponds to some valid pathname "); - html += - wxT - ("(accessible in write/create mode), then the corresponding file will be created/overwritten so to contain the payload.
"); - html += - wxT - ("The return type is Integer, with a return value of 1 for success, 0 for failure.
"); - html += - wxT - ("Please note: security restrictions apply to this function, which is really supported only when the environment variable \"SPATIALTE_SECURITY=relaxed\" is explicitly set.
CountUnsafeTriggers( ) : IntegerThis SQL function checks if the currently connected DB does contain any potentially malicious Trigger; "); - html += - wxT - ("carefully checking this conditions is a minimal precaution expected to be always verified before eventually activating the \"SPATIALITE_SECURITY=relaxed\" mode.
"); - html += - wxT - ("The return type is Integer (total count of suspected Triggers); 0 means that the currently connected DB should be considered absolutely safe.
SQL utility functions [non-standard] for geometric objects"); - html += wxT("
back to index
GeomFromExifGpsBlob( image Blob ) : Geometrya POINT Geometry will be returned representing the GPS long/lat contained within EXIF-GPS metadata for the BLOB image
"); - html += - wxT - ("NULL will be returned if for any reason it's not possible to build such a POINT
ST_Point( x Double precision , y Double precision ) : Geometrysimply an alias-name for MakePoint() (SRID is never supported).
MakePoint( x Double precision , y Double precision [ , SRID Integer] ) : Geometrya Geometry will be returned representing the POINT defined by [x y] coordinates
MakePointZ( x Double precision , y Double precision , z Double precision [ , SRID Integer] ) : Geometrya Geometry will be returned representing the POINT Z defined by [x y z] coordinates
MakePointM( x Double precision , y Double precision , m Double precision [ , SRID Integer] ) : Geometrya Geometry will be returned representing the POINT M defined by [x y m] coordinates
MakePointZM( x Double precision , y Double precision , z Double precision , m Double precision "); - html += wxT("[ , SRID Integer] ) : Geometrya Geometry will be returned representing the POINT ZM defined by [x y z m] coordinates
MakeLine( pt1 PointGeometry , pt2 PointGeometry ) : LinestringGeometrya Linestring Geometry will be returned representing the segment connecting pt1 to pt2
"); - html += wxT("NULL will be returned if any error is encountered
MakeLine( geom PointGeometry ) : LinestringGeometrya Linestring Geometry will be returned connecting all the input Points (accordingly to input sequence)
"); - html += wxT("aggregate function
"); - html += wxT("NULL will be returned if any error is encountered
MakeLine( geom MultiPointGeometry , direction Boolean ) : LinestringGeometrya Linestring Geometry will be returned connecting all the input Points (accordingly to input sequence); \"direction=FALSE\" implies reverse order.
"); - html += - wxT - ("Please note: similar to the previuous one, but this one is an ordinary (not aggregate) function; a MultiPoint input is always expected.
"); - html += wxT("NULL will be returned if any error is encountered
MakeCircle( cx Double , cy Double , radius Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometrywill return a closed LINESTRING approximating the Circle defined by \"cx\", \"cy\" and \"radius\".
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeEllipse( cx Double , cy Double , x_axis Double , y_axus Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometrywill return a closed LINESTRING approximating the Ellipsee defined by \"cx\", \"cy\" and \"x_axis\", \"y_axis\".
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeArc( cx Double , cy Double , radius Double , start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometrywill 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.
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeEllipticArc( cx Double , cy Double , x_axis Double , y_axis Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : LinestringGeometrywill 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.
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeCircularSector( cx Double , cy Double , radius Double , start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometrywill 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.
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeEllipticSector( cx Double , cy Double , x_axis Double , y_axis Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometrywill 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.
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the ellipse; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
MakeCircularStripe( cx Double , cy Double , radius_1 Double , radius_2 Double, start Double , stop Double [ , SRID Integer [ , step Double ] ] ) : PolygonGeometrywill return a POLYGON approximating the Circular Stripe delimited by two arcs sharing the same Centre \"cx\", \"cy\" "); - html += - wxT - ("but having different radii \"radius_1\", \"radius_2\"; the arc's extremities will be defined by \"start\", \"stop\" angles expressed in degrees.
"); - html += - wxT - ("The optional argument \"step\" if specified defines how many points will be interpolated on the circumference; a point will be set every \"step\" degrees.
"); - html += - wxT - ("The implicit default setting corresponds to a point every 10 degrees.
Collect( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += wxT("ST_Collect( geom1 Geometry , geom2 Geometry ) : Geometry
a generic Geometry (possibly a GEOMETRYCOLLECTION) will be returned merging geom1 and geom2
"); - html += wxT("NULL will be returned if any error is encountered
Collect( geom Geometry ) : Geometry
"); - html += wxT("ST_Collect( geom1 Geometry , geom2 Geometry ) : Geometry
a generic Geometry (possibly a GEOMETRYCOLLECTION) will be returned merging input Geometries all together
"); - html += wxT("aggregate function
"); - html += wxT("NULL will be returned if any error is encountered
BuildArea( geom Geometry ) : Geometry
"); - html += wxT("ST_BuildArea( geom Geometry ) : Geometry
a Geometry (actually corresponding to a POLYGON or MULTIPOLYGON) will be returned.
"); - html += wxT - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.
The input Geometry can be an arbitrary collection "); - html += wxT - ("of sparse Linestrings: this function will then try to (possibly) reassemble them into one (or more) polygon(s)."); - html += wxT - ("
If the second [optional] argument is TRUE then a MULTIPOLYGON will be returned anyway.
"); - html += wxT("NULL will be returned if any error is encountered
Polygonize( geom Geometry ) : Geometry
"); - html += wxT("ST_Polygonize( geom Geometry ) : Geometry
Exactly the same as ST_BuildArea, but implemented as an aggregate function.
"); - html += wxT("NULL will be returned if any error is encountered
LineMerge( geom Geometry ) : Geometry
"); - html += wxT("ST_LineMerge( geom Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.
"); - html += wxT - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.
The input Geometry can be an arbitrary collection "); - html += wxT - ("of sparse Linestrings: this function will then try to (possibly) reassemble them into one (or more) polygon(s)."); - html += wxT - ("
If the second [optional] argument is TRUE then a MULTIPOLYGON will be returned anyway.
"); - html += wxT("NULL will be returned if any error is encountered
MakePolygon( geom1 Geometry [ , geom2 Geometry ] ) : Geometry
"); - html += - wxT - ("ST_MakePolygon( geom1 Geometry [ , geom2 Geometry ] ) : Geometry
Kind of lightweight/simplified ST_BuildArea: the first input Geometry is always "); - html += - wxT - ("expected to represent a closed LINESTRING assumed to identify the output polygon's Exterior Ring.
"); - html += - wxT - ("The second input Geometry (if any) is expected to be a LINESTRING or MULTILINESTRING identifying any "); - html += - wxT - ("polygon's Interior Ring (and all them are expected to be correctly closed).
"); - html += - wxT - ("Please note well: this function doesn't perform any internal topology check, so it could "); - html += - wxT - ("possibly return an invalid polygon on invalid input.
NULL will be returned if any error is encountered
LinesFromRings( geom Geometry ) : Geometry
"); - html += wxT("ST_LinesFromRings( geom Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.
"); - html += - wxT - ("The input Geometry is expected to be a POLYGON or MULTIPOLYGON; any RING will then be transformed into the corresponding LINESTRING.
"); - html += wxT("NULL will be returned if any error is encountered
LinesCutAtNodes( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += - wxT - ("ST_LinesCutAtNodes( geom1 Geometry , geom2 Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.
"); - html += - wxT - ("The first input Geometry is expected to be a LINESTRING or MULTILINESTRING (Lines); "); - html += - wxT - ("the second input Geometry is expected to be a POINT or MULTIPOINT (Nodes).
"); - html += - wxT - ("any Line will then be possibly split in two halves where some vertex exactely intercepts a Node.
"); - html += wxT("NULL will be returned if any error is encountered
RingsCutAtNodes( geom Geometry ) : Geometry
"); - html += wxT("ST_RingsCutAtNodes( geom Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned.
"); - html += - wxT - ("The input Geometry is expected to be a POLYGON or MULTIPOLYGON (Rings); "); - html += - wxT - ("any self-intersection or intersection between Rings is assumed to represent a Node.
"); - html += - wxT - ("any Ring will then be possibly split in two halves where some vertex exactely intercepts a Node.
"); - html += wxT("NULL will be returned if any error is encountered
DissolveSegments( geom Geometry ) : Geometry
"); - html += wxT("ST_DissolveSegments( geom Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING, MULTILINESTRING or GEOMETRYCOLLECTION) will be returned.
"); - html += - wxT - ("The input Geometry is arbitrary: any POINT will remain unaffected, but any LINESTRING or RING will be dissolved into elementary segments.
"); - html += wxT("NULL will be returned if any error is encountered
DissolvePoints( geom Geometry ) : Geometry
"); - html += wxT("ST_DissolvePoints( geom Geometry ) : Geometry
a Geometry (actually corresponding to a POINT or MULTIPOINT) will be returned.
"); - html += - wxT - ("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.
"); - html += wxT("NULL will be returned if any error is encountered
CollectionExtract( geom Geometry, type Integer ) : Geometry
"); - html += - wxT("ST_CollectionExtract( geom Geometry, type Integer ) : Geometry
Given a GEOMETRYCOLLECTION, returns a MULTI* geometry consisting only of the specified type.
"); - html += - wxT - ("Sub-geometries that are not the specified type are ignored.
(1=POINT-type, 2=LINESTRING-type, 3=POLYGON-type)
"); - html += - wxT - ("NULL will be returned if any error is encountered (or when no item of required type is found)
ST_Locate_Along_Measure( geom Geometry, m_value Double precision ) : GeometryReturn a derived geometry collection value with elements that match the specified measure.
"); - html += - wxT - ("NULL will be returned if any error is encountered (or when no element corresponding to the given measure is found).
"); - html += - wxT - ("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.
ST_Locate_Between_Measures( geom Geometry, m_start Double precision , m_end Double precision ) : GeometryReturn a derived geometry collection value with elements that match the specified range of measures.
"); - html += - wxT - ("NULL will be returned if any error is encountered (or when no element corresponding to the given range if measures is found).
"); - html += - wxT - ("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.
SquareGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
"); - html += - wxT - ("ST_SquareGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).
"); - html += - wxT - ("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
"); - html += - wxT - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.
"); - html += wxT("NULL will be returned if any error is encountered.
TriangularGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
"); - html += - wxT - ("ST_TriangularGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).
"); - html += - wxT - ("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
"); - html += - wxT - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.
"); - html += wxT("NULL will be returned if any error is encountered.
HexagonalGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
"); - html += - wxT - ("ST_HexagonalGrid( geom Geometry [ , size Double precision [ , edges_only Boolean [ , origin Geometry ]] ) : Geometry
return a grid of square cells (having the edge length of size) precisely covering the input Geometry (expected to be a Polygon or MultiPolygon).
"); - html += - wxT - ("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
"); - html += - wxT - ("If the optional origin argument (expected to be a Point) is not specified then the (0,0) grid origin will be assumed by default.
"); - html += wxT("NULL will be returned if any error is encountered.
DelaunayTriangulation( geom Geometry [ , edges_only Boolean [ , tolerance Double precision ]] ) : Geometry
"); - html += - wxT - ("ST_DelaunayTriangulation( geom Geometry [ , edges_only Boolean [ , tolerance Double precision ]] ) : Geometry
Return the Delaunay Triangulation corresponding to the input Geometry.
"); - html += wxT("NULL will be returned if any error is encountered.
VoronojDiagram( geom Geometry [ , edges_only Boolean [ , extra_frame_size Double precision [ , tolerance Double precision ]]] ) : Geometry
"); - html += - wxT - ("ST_VoronojDiagram( geom Geometry [ , edges_only Boolean [ , extra_frame_size Double precision [ , tolerance Double precision ]]] ) : Geometry
Return the Voronoj Diagram corresponding to the input Geometry.
"); - html += wxT("NULL will be returned if any error is encountered.
ConcaveHull( geom Geometry [ , factor Double precision [ , allow_hols Boolean [ , tolerance Double precision ]]] ) : Geometry
"); - html += - wxT - ("ST_ConcaveHull( geom Geometry [ , factor Double precision [ , allow_hols Boolean [ , tolerance Double precision ]]] ) : Geometry
Return the ConcaveHull corresponding to the input Geometry.
"); - html += wxT("NULL will be returned if any error is encountered.
MakeValid( geom Geometry ) : Geometry
"); - html += wxT("ST_MakeValid( geom Geometry ) : Geometry
Return a surely valid version of the input Geometry.
"); - html += - wxT - ("If the input Geometry was already valid, then it will be returned exactly as it was.
"); - html += wxT("NULL will be returned if any error is encountered.
MakeValidDiscarded( geom Geometry ) : Geometry
"); - html += wxT("ST_MakeValidDiscarded( geom Geometry ) : Geometry
Return all elements that would be eventually discarded by ST_MakeValid() while validating the same input Geometry.
"); - html += - wxT - ("NULL will be returned if any error is encountered, or if no discarded item exists.
Segmentize( geom Geometry , dist Double precision ) : Geometry
"); - html += - wxT - ("ST_Segmentize( geom Geometry , dist Double precision ) : Geometry
return a new Geometry corresponding to the input Geometry; as much Linestring / Ring vertices "); - html += - wxT - ("as required will be eventually interpolated so to ensure that no segment will be longer than dist.
"); - html += wxT("NULL will be returned if any error is encountered.
Split( geom Geometry , blade Geometry ) : Geometry
"); - html += wxT("ST_Split( geom Geometry , blade Geometry ) : Geometry
return a new Geometry collecting all items resulting by splitting the input Geometry by the blade.
"); - html += wxT("NULL will be returned if any error is encountered.
SplitLeft( geom Geometry , blade Geometry ) : Geometry
"); - html += wxT("ST_SplitLeft( geom Geometry , blade Geometry ) : Geometry
return a new Geometry collecting all items resulting by splitting the input Geometry by the blade and falling on the left side.
"); - html += - wxT - ("All items not affected by the split operation (i.e. not intersecting the blade) will be returned into the left collection.
"); - html += wxT("NULL will be returned if any error is encountered.
SplitRight( geom Geometry , blade Geometry ) : Geometry
"); - html += - wxT("ST_SplitRight( geom Geometry , blade Geometry ) : Geometry
return a new Geometry collecting all items resulting by splitting the input Geometry by the blade and falling on the right side.
"); - html += - wxT - ("NULL will be returned if any error is encountered (or if the right side is empty).
Azimuth( pt1 Geometry , pt2 Geometry ) : Double precision
"); - html += - wxT("ST_Azimuth( pt1 Geometry , pt2 Geometry ) : Double precision
return the angle (in radians) from the horizontal of the vector defined by pt1 and pt2.
"); - html += wxT("Both pt1 and pt2 are expected to be simple Points.
"); - html += - wxT - ("Starting since 4.1.0 if both points supports \"long/lat\" coords the returned Azimuth will be precisely computed on the ellipsoid.
"); - html += wxT("NULL will be returned if any error is encountered.
"); - html += wxT("On the clock: 12=0; 3=PI/2; 6=PI; 9=3PI/2
Project( start_point Geometry, distance Double precision, azimuth Double precision ) : Geometry
"); - html += - wxT - ("Project( start_point Geometry, distance Double precision, azimuth Double precision ) : Geometry
return a new Point projected from a start point using a bearing and distance.
"); - html += - wxT - ("start_point is expected to be simple long/lat Point.
distance is expected to be measured in meters; "); - html += - wxT - ("azimuth (aka bearing or heading) has the same identical meaning as in ST_Azimuth().
"); - html += wxT("NULL is returned on failure or on invalid arguments.
SnapToGrid( geom Geometry , size Double precision ) : Geometry
"); - html += - wxT - ("SnapToGrid( geom Geometry , size_x Double precision , size_y Double precision ) : Geometry
"); - html += - wxT - ("SnapToGrid( geom Geometry , origin_x Double precision , origin_y Double precision , size_x Double precision , size_y Double precision ) : Geometry
"); - html += - wxT - ("SnapToGrid( geom Geometry , origin Geometry , size_x Double precision , size_y Double precision , size_z Double precision , size_m Double precision ) : Geometry
"); - html += - wxT - ("ST_SnapToGrid( geom Geometry , size Double precision ) : Geometry
"); - html += - wxT - ("ST_SnapToGrid( geom Geometry , size_x Double precision , size_y Double precision ) ) : Geometry
"); - html += - wxT - ("ST_SnapToGrid( geom Geometry , origin_x Double precision , origin_y Double precision , size_x Double precision , size_y Double precision ) ) : Geometry
"); - html += - wxT - ("ST_SnapToGrid( geom Geometry , origin Geometry , size_x Double precision , size_y Double precision, size_z Double precision , size_m Double precision ) : Geometry
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).
"); - html += wxT("Removes all consecutive points falling on the same cell.
"); - html += - wxT - ("All collapsed geometries will be stripped from the returned Geometry.
"); - html += wxT("NULL will be returned if any error is encountered.
GeoHash( geom Geometry ) : String
"); - html += wxT("ST_GeoHash( geom Geometry ) : String
Return a GeoHash representation (geohash.org) of the geometry.
"); - html += - wxT - ("A GeoHash encodes a point into a text form that is sortable and searchable based on prefixing.
"); - html += - wxT - ("ST_GeoHash will not work with geometries that are not in geographic (lon/lat) coordinates
AsX3D( geom Geometry [ , precision Integer [ , options Integer [ , refid String ]]] ) : String
"); - html += - wxT - ("ST_AsX3D( geom Geometry [ , precision Integer [ , options Integer [ , refid String ]]] ) : String
Returns a geometry as an X3D XML formatted node element
MaxDistance( geom1 Geometry , geom2 Geometry ) : Double precision
"); - html += - wxT - ("ST_MaxDistance( geom1 Geometry , geom2 Geometry ) : Double precision
return the max distance between geom1 and geom2
ST_3DDistance( geom1 Geometry , geom2 Geometry ) : Double precisionreturn the 3D-distance between geom1 and geom2 (considering Z coordinates)
ST_Max3DDistance( geom1 Geometry , geom2 Geometry ) : Double precisionreturn the max 3D-distance between geom1 and geom2 (considering Z coordinates)
ST_Node( geom Geometry ) : GeometryFully nodes a set of linestrings using the least possible number of nodes while preserving all of the input ones.
"); - html += - wxT - ("NULL will be returned if the input Geometry isn't a set of linestrings or if any other error occurs.
SelfIntersections( geom Geometry ) : Geometry
ST_SelffIntersections( geom Geometry ) : Geometry
Returns a MultiPoint Geometry representing any self-intersection found within the input geometry "); - html += - wxT("[Expected to be of the Linestring or MultiLinestring type].
"); - html += - wxT - ("NULL will be returned for invalid arguments, or when no self-intersections were found.
BuildMbr( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision, [ , SRID Integer] ) : Geometry[x1 y1] and [x2 y2] are assumed to be Points identifying a line segment;"); - html += - wxT - ("then a Geometry will be returned representing the MBR for this line segment
BuildCircleMbr( x Double precision , y Double precision , radius Double precision [ , SRID Integer] ) : Geometry[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
Extent( geom Geometry ) : Geometryreturn a geometric object representing the bounding box that encloses a set of input values
"); - html += wxT("aggregate function
ToGARS( geom Geometry ) : Stringgeom is expected to represent a POINT (longitude and latitude coords); "); - html += - wxT("the corresponding GARS area designation code will be returned.
"); - html += wxT("NULL will be returned if any error is encountered.
GARSMbr( GARS_code String ) : Geometrycode is assumed to represent a valid GARS area designation code; "); - html += - wxT - ("a Geometry will be returned representing the MBR for the corresponding GARS area.
"); - html += wxT("NULL will be returned if any error is encountered.
MbrMinX( geom Geometry) : Double precision
"); - html += wxT("ST_MinX( geom Geometry) : Double precision
return the x-coordinate for geom MBR's leftmost side as a double precision number.
"); - html += - wxT("NULL will be returned if geom isn't a valid Geometry.
MbrMinY( geom Geometry) : Double precision
"); - html += wxT("ST_MinY( geom Geometry) : Double precision
return the y-coordinate for geom MBR's lowermost side as a double precision number.
"); - html += - wxT("NULL will be returned if geom isn't a valid Geometry.
MbrMaxX( geom Geometry) : Double precision
"); - html += wxT("ST_MaxX( geom Geometry) : Double precision
return the x-coordinate for geom MBR's rightmost side as a double precision number.
"); - html += - wxT("NULL will be returned if geom isn't a valid Geometry.
MbrMaxY( geom Geometry) : Double precision
"); - html += wxT("ST_MaxY( geom Geometry) : Double precision
return the y-coordinate for geom MBR's uppermost side as a double precision number.
"); - html += - wxT("NULL will be returned if geom isn't a valid Geometry.
ST_MinZ( geom Geometry) : Double precisionreturn the minimum Z-coordinate value for geom as a double precision number.
"); - html += - wxT - ("NULL will be returned if geom isn't a valid Geometry or if geom has no Z dimension.
ST_MaxZ( geom Geometry) : Double precisionreturn the maximum Z-coordinate value for geom as a double precision number.
"); - html += - wxT - ("NULL will be returned if geom isn't a valid Geometry or if geom has no Z dimension.
ST_MinM( geom Geometry) : Double precisionreturn the minimum M-coordinate value for geom as a double precision number.
"); - html += - wxT - ("NULL will be returned if geom isn't a valid Geometry or if geom has no M dimension.
ST_MaxM( geom Geometry) : Double precisionreturn the maximum M-coordinate value for geom as a double precision number.
"); - html += - wxT - ("NULL will be returned if geom isn't a valid Geometry or if geom has no M dimension.
functions for constructing a geometric object given its Well-known Text Representation"); - html += wxT("
back to index
GeomFromText( wkt String [ , SRID Integer] ) : Geometry
"); - html += - wxT("ST_GeomFromText( wkt String [ , SRID Integer] ) : Geometry
construct a geometric object given its Well-known text Representation
ST_WKTToSQL( wkt String ) : GeometrySQL/MM alias name for ST_GeomFromText: SRID=0 is assumed.
PointFromText( wktPoint String [ , SRID Integer] ) : Point
"); - html += - wxT("ST_PointFromText( wktPoint String [ , SRID Integer] ) : Point
construct a Point
LineFromText( wktLineString String [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("ST_LineFromText( wktLineString String [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("LineStringFromText( wktLineString String [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("ST_LineStringFromText( wktLineString String [ , SRID Integer] ) : Linestring
construct a Linestring
PolyFromText( wktPolygon String [ , SRID Integer] ) : Polygon
"); - html += - wxT("ST_PolyFromText( wktPolygon String [ , SRID Integer] ) : Polygon
"); - html += - wxT("PolygonFromText( wktPolygon String [ , SRID Integer] ) : Polygon
"); - html += - wxT - ("ST_PolygonFromText( wktPolygon String [ , SRID Integer] ) : Polygon
construct a Polygon
MPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("ST_MPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("MultiPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("ST_MultiPointFromText( wktMultiPoint String [ , SRID Integer] ) : MultiPoint
construct a MultiPoint
MLineFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("ST_MLineFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("MultiLineStringFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("ST_MultiLineStringFromText( wktMultiLineString String [ , SRID Integer] ) : MultiLinestring
construct a MultiLinestring
MPolyFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_MPolyFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("MultiPolygonFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_MultiPolygonFromText( wktMultiPolygon String [ , SRID Integer] ) : MultiPolygon
construct a MultiPolygon
GeomCollFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("ST_GeomCollFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("GeometryCollectionFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("ST_GeometryCollectionFromText( wktGeometryCollection String [ , SRID Integer] ) : GeometryCollection
construct a GeometryCollection
BdPolyFromText( wktMultilinestring String [ , SRID Integer] ) : Polygon
"); - html += - wxT - ("ST_BdPolyFromText( wktMultilinestring String [ , SRID Integer] ) : Polygon
Construct a Polygon given an arbitrary collection of closed "); - html += - wxT - ("linestrings as a MultiLineString text representation.
see also: BuildArea(), Polygonize()
BdMPolyFromText( wktMultilinestring String [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_BdMPolyFromText( wktMultilinestring String [ , SRID Integer] ) : MultiPolygon
Construct a MultiPolygon given an arbitrary collection of closed "); - html += - wxT - ("linestrings as a MultiLineString text representation.
see also: BuildArea(), Polygonize()
functions for constructing a geometric object given its Well-known Binary Representation"); - html += wxT("
back to index
GeomFromWKB( wkbGeometry Binary [ , SRID Integer] ) : Geometry
"); - html += - wxT - ("ST_GeomFromWKB( wkbGeometry Binary [ , SRID Integer] ) : Geometry
construct a geometric object given its Well-known binary Representation
ST_WKBToSQL( wkbGeometry Binary ) : GeometrySQL/MM alias name for ST_GeomFromWKB: SRID=0 is assumed.
PointFromWKB( wkbPoint Binary [ , SRID Integer] ) : Point
"); - html += - wxT("ST_PointFromWKB( wkbPoint Binary [ , SRID Integer] ) : Point
construct a Point
LineFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("ST_LineFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("LineStringFromWKB( wkbLineString Binary [ , SRID Integer] ) : Linestring
"); - html += - wxT - ("ST_LineStringFromWKB ( wkbLineString Binary [ , SRID Integer] ) : Linestring
construct a Linestring
PolyFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon
"); - html += - wxT("ST_PolyFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon
"); - html += - wxT("PolygonFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon
"); - html += - wxT - ("ST_PolygonFromWKB( wkbPolygon Binary [ , SRID Integer] ) : Polygon
construct a Polygon
MPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("ST_MPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("MultiPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint
"); - html += - wxT - ("ST_MultiPointFromWKB( wkbMultiPoint Binary [ , SRID Integer] ) : MultiPoint
construct a MultiPoint
MLineFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("ST_MLineFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("MultiLineStringFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring
"); - html += - wxT - ("ST_MultiLineStringFromWKB( wkbMultiLineString Binary [ , SRID Integer] ) : MultiLinestring
construct a MultiLinestring
MPolyFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_MPolyFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("MultiPolygonFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_MultiPolygonFromWKB( wkbMultiPolygon Binary [ , SRID Integer] ) : MultiPolygon
construct a MultiPolygon
GeomCollFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("ST_GeomCollFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("GeometryCollectionFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection
"); - html += - wxT - ("ST_GeometryCollectionFromWKB( wkbGeometryCollection Binary [ , SRID Integer] ) : GeometryCollection
construct a GeometryCollection
BdPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : Polygon
"); - html += - wxT - ("ST_BdPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : Polygon
Construct a Polygon given an arbitrary collection of closed "); - html += - wxT - ("linestrings as a MultiLineString binary representation.
see also: BuildArea(), Polygonize()
BdMPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : MultiPolygon
"); - html += - wxT - ("ST_BdMPolyFromWKB( wkbMultilinestring Binary [ , SRID Integer] ) : MultiPolygon
Construct a MultiPolygon given an arbitrary collection of closed "); - html += - wxT - ("linestrings as a MultiLineString binary representation.
see also: BuildArea(), Polygonize()
functions for obtaining the Well-known Text / Well-known Binary Representation of a geometric object"); - html += wxT("
back to index
AsText( geom Geometry ) : String
"); - html += - wxT - ("ST_AsText( geom Geometry ) : String
return the Well-known Text representation
AsWKT( geom Geometry [ , precision Integer ] ) : Stringreturn the Well-known Text representation
always return strictly conformant 2D WKT
AsBinary( geom Geometry ) : Binary
"); - html += - wxT - ("ST_AsBinary( geom Geometry ) : Binary
return the Well-known Binary representation
SQL functions supporting exotic geometric formats"); - html += wxT("
back to index
AsSVG( geom Geometry, [ , relative Integer [ , precision Integer ] ] ) : Stringreturns the SVG [Scalable Vector Graphics] representation
AsKML( geom Geometry [ , precision Integer ] ) : String
"); - html += - wxT - ("AsKML( name String, description String, geom Geometry [ , precision Integer ] ) : String
returns the KML [Keyhole Markup Language] representation
GeomFromKml( KmlGeometry String ) : Geometryconstruct a geometric object given its KML Representation
AsGML( geom Geometry [ , precision Integer ] ) : String
"); - html += - wxT - ("AsGML( version Integer, geom Geometry [ , precision Integer ] ) : String
returns the GML [Geography Markup Language] representation
GeomFromGML( gmlGeometry String ) : Geometryconstruct a geometric object given its GML Representation
AsGeoJSON( geom Geometry [ , precision Integer [ , options Integer ] ] ) : Stringreturns the GeoJSON [Geographic JavaScript Object Notation] representation
GeomFromGeoJSON( GeoJSONGeometry String ) : Geometryconstruct a geometric object given its GeoJSON Representation
AsEWKB( geom Geometry ) : Stringreturns the EWKB [Extended Well Known Binary] representation
GeomFromEWKB( ewkbGeometry String ) : Geometryconstruct a geometric object given its EWKB Representation
AsEWKT( geom Geometry ) : Stringreturns the EWKT [Extended Well Known Text] representation
GeomFromEWKT( ewktGeometry String ) : Geometryconstruct a geometric object given its EWKT Representation
AsFGF( geom Geometry ) : Stringreturns the FGF [FDO Geometry Binary Format] representation
GeomFromFGF( fgfGeometry Binary [ , SRID Integer] ) : Geometryconstruct a geometric object given its FGF binary Representation
ExportDXF( out_dir String , filename String , sql_query String , layer_col_name String , "); - html += - wxT - ("geom_col_name String , label_col_name String , text_height_col_name String , text_rotation_col_name String , geom_filter Geometry [ , precision Integer ] ) : IntegerExports a whole DXF file.
Will return 0 (i.e. FALSE) on failure, any other value (i.e. TRUE) on success.
"); - html += - wxT - ("Please note this SQL function open the doors to many potential security issues, and thus is always disabled by default.
"); - html += - wxT - ("Explicitly setting the environment variable SPATIALITE_SECURITY=relaxed is absolutely required in order to effectively enable this function.
functions on type Geometry"); - html += wxT("
back to index
Dimension( geom Geometry ) : Integer
"); - html += wxT("ST_Dimension( geom Geometry ) : Integer
return the dimension of the geometric object, which is less than or equal to the dimension of the coordinate space
CoordDimension( geom Geometry ) : Stringreturn the dimension model used by the geometric object as:
'XY', 'XYZ', 'XYM' or 'XYZM'
ST_NDims( geom Geometry ) : Integerreturn the number of dimensions used by the geometric object as:
2, 3 or 4
ST_Is3D( geom Geometry ) : IntegerChecks if geom has the Z dimension.
"); - html += - wxT - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); - html += wxT("function invocation on invalid arguments.
ST_IsMeasured( geom Geometry ) : IntegerChecks if geom has the M dimension.
"); - html += - wxT - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); - html += wxT("function invocation on invalid arguments.
GeometryType( geom Geometry ) : String
"); - html += wxT("ST_GeometryType( geom Geometry ) : String
return the name of the instantiable subtype of Geometry of which this geometric object is a member, as a string
SRID( geom Geometry ) : Integer
"); - html += wxT("ST_SRID( geom Geometry ) : Integer
return the Spatial Reference System ID for this geometric object
SetSRID( geom Geometry , SRID Integer ) : Integerdirectly sets the Spatial Reference System ID for this geometric object [no reprojection is applied].
"); - html += - wxT - ("The return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, and -1 for UNKNOWN corresponding to a "); - html += wxT("function invocation on NULL arguments
IsEmpty( geom Geometry ) : Integer
"); - html += wxT("ST_IsEmpty( geom Geometry ) : Integer
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.
"); - html += - wxT("TRUE if this geometric object corresponds to the empty set
IsSimple( geom Geometry ) : Integer
"); - html += wxT("ST_IsSimple( geom Geometry ) : Integer
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.
"); - html += - wxT - ("TRUE if this geometric object is simple, as defined in the Geometry Model
IsValid( geom Geometry ) : Integer
"); - html += wxT("ST_IsValid( geom Geometry ) : Integer
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.
"); - html += - wxT - ("TRUE if this geometric object does not contains any topological error
Boundary( geom Geometry ) : Geometry
"); - html += wxT("ST_Boundary( geom Geometry ) : Geometry
return a geometric object that is the combinatorial boundary of g as defined in the Geometry Model
Envelope( geom Geometry ) : Geometry
"); - html += wxT("ST_Envelope( geom Geometry ) : Geometry
return the rectangle bounding g as a Polygon. "); - html += - wxT - ("The Polygon is defined by the corner points of the bounding box [(MINX, MINY),(MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)].
ST_Expand( geom Geometry , amount Double ) : Geometryreturn the rectangle bounding g as a Polygon.
"); - html += - wxT - ("The bounding rectangle is expanded in all directions by an amount specified by the second argument.
ST_NPoints( geom Geometry ) : Integerreturn the total number of Points (this including any Linestring/Polygon vertex)
ST_NRings( geom Geometry ) : Integerreturn the total number of Rings (this including both Exterior and Interior Rings)
ST_Reverse( geom Geometry ) : geom Geometryreturns a new Geometry [if possible] or NULL
"); - html += wxT("Any Linestring or Ring will be in reverse order.
ST_ForceLHR( geom Geometry ) : geom Geometryreturns a new Geometry [if possible] or NULL
"); - html += - wxT - ("Any Polygon will be oriented accordingly to Left Hand Rule (Exterior Ring clockwise, "); - html += wxT("Interior Rings counter-clockwise).
AddPoint( line Linestring , point Point [ , position Integer ] ) : Linestring
"); - html += - wxT - ("ST_AddPoint( line Linestring , point Point [ , position Integer ] ) : Linestring
Adds a new Point into the input Linestring immediately before \"position\" (zero-based index)
"); - html += - wxT - ("A negative \"position\" (default) means appending the new Point to the end of the input Linestring.
"); - html += wxT("NULL will be returned if any error is encountered.
SetPoint( line Linestring , position Integer , point Point ) : Linestring
"); - html += - wxT - ("ST_SetPoint( line Linestring , position Integer , point Point ) : Linestring
Replaces the Point into the input Linestring at \"position\" (zero-based index)
"); - html += wxT("NULL will be returned if any error is encountered.
Replaces the StartPoint into the input Linestring
"); - html += wxT("NULL will be returned if any error is encountered.
Replaces the EndPoint into the input Linestring
"); - html += wxT("NULL will be returned if any error is encountered.
RemovePoint( line Linestring , position Integer ) : Linestring
"); - html += - wxT - ("ST_RemovePoint( line Linestring , position Integer ) : Linestring
Removes the Point into the input Linestring at \"position\" (zero-based index)
"); - html += wxT("NULL will be returned if any error is encountered.
Functions attempting to repair malformed Geometries"); - html += wxT("
back to index
SanitizeGeometry( geom Geometry ) : geom Geometryreturns a (possibly) sanitized Geometry or NULL
Geometry-compression functions"); - html += wxT("
back to index
CompressGeometry( geom Geometry ) : geom Geometryreturns a compressed Geometry or NULL
UncompressGeometry( geom Geometry ) : geom Geometryreturns an uncompressed Geometry or NULL
Geometry-type casting functions"); - html += wxT("
back to index
CastToPoint( geom Geometry ) : geom Geometryreturns a POINT-type Geometry [if possible] or NULL
CastToLinestring( geom Geometry ) : geom Geometryreturns a LINESTRING-type Geometry [if possible] or NULL
CastToPolygon( geom Geometry ) : geom Geometryreturns a POLYGON-type Geometry [if possible] or NULL
CastToMultiPoint( geom Geometry ) : geom Geometryreturns a MULTIPOINT-type Geometry [if possible] or NULL
CastToMultiLinestring( geom Geometry ) : geom Geometryreturns a MULTILINESTRING-type Geometry [if possible] or NULL
CastToMultiPolygon( geom Geometry ) : geom Geometryreturns a MULTIPOLYGON-type Geometry [if possible] or NULL
CastToGeometryCollection( geom Geometry ) : geom Geometryreturns a GEOMETRYCOLLECTION-type Geometry [if possible] or NULL
CastToMulti( geom Geometry ) : geom Geometry
"); - html += wxT("ST_Multi( geom Geometry ) : geom Geometry
returns a MULTIPOINT-, MULTILINESTRING- or MULTIPOLYGON-type Geometry [if possible]: NULL in any other case
CastToSingle( geom Geometry ) : geom Geometryreturns a POINT-, LINESTRING- or POLYGON-type Geometry [if possible]: NULL in any other case
Space-dimensions casting functions"); - html += wxT("
back to index
CastToXY( geom Geometry ) : geom Geometryreturns a Geometry using the [XY] space dimension
CastToXYZ( geom Geometry ) : geom Geometryreturns a Geometry using the [XYZ] space dimension
CastToXYM( geom Geometry ) : geom Geometryreturns a Geometry using the [XYM] space dimension
CastToXYZM( geom Geometry ) : geom Geometryreturns a Geometry using the [XYZM] space dimension
functions on type Point"); - html += wxT("
back to index
X( pt Point ) : Double precision
"); - html += - wxT - ("ST_X( pt Point ) : Double precision
return the x-coordinate of Point p as a double precision number
Y( pt Point ) : Double precision
"); - html += - wxT - ("ST_Y( pt Point ) : Double precision
return the y-coordinate of Point p as a double precision number
Z( pt Point ) : Double precision
"); - html += - wxT - ("ST_Z( pt Point ) : Double precision
return the z-coordinate of Point p as a double precision number"); - html += wxT("or NULL if no z-coordinate is available
M( pt Point ) : Double precision
"); - html += - wxT - ("ST_M( pt Point ) : Double precision
return the m-coordinate of Point p as a double precision number
"); - html += wxT("or NULL if no m-coordinate is available
functions on type Curve [Linestring or Ring]
StartPoint( c Curve ) : Point
"); - html += - wxT - ("ST_StartPoint( c Curve ) : Point
return a Point containing the first Point of c
EndPoint( c Curve ) : Point
"); - html += - wxT - ("ST_EndPoint( c Curve ) : Point
return a Point containing the last Point of c
NumPoints( line LineString ) : Integer
"); - html += - wxT - ("ST_NumPoints( line LineString ) : Integer
return the number of Points in the LineString
PointN( line LineString , n Integer ) : Point
"); - html += - wxT - ("ST_PointN( line LineString , n Integer ) : Point
return a Point containing Point n of line
GLength( c Curve [ , use_ellipsoid Boolean ] ) : Double precision
"); - html += - wxT - ("ST_Length( c Curve [ , use_ellipsoid Boolean ] ) : Double precision
return the length of c
Perimeter( s Surface [ , use_ellipsoid Boolean ] ) : Double precision
"); - html += - wxT - ("ST_Perimeter( s Surface [ , use_ellipsoid Boolean ] ) : Double precision
return the perimeter of s
GeodesicLength( c Curve ) : Double precisionreturn the geodesic length of c"); - html += - wxT - (" measured on the Ellipsoid [only for geographic SRIDs]
GreatCircleLength( c Curve ) : Double precisionreturn the Great Circle length of c"); - html += wxT(" [only for geographic SRIDs]
IsClosed( c Curve ) : Integer
"); - html += wxT("ST_IsClosed( c Curve ) : Integer
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
"); - html += - wxT - ("return TRUE if c is closed, i.e., if StartPoint(c) = EndPoint(c)
IsRing( c Curve ) : Integer
"); - html += wxT("ST_IsRing( c Curve ) : Integer
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
"); - html += - wxT - ("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.
PointOnSurface( s Surface/Curve ) : Point
"); - html += - wxT - ("ST_PointOnSurface( s Surface ) : Point
return a Point guaranteed to lie on the Surface (or Curve)
Simplify( c Curve , tolerance Double precision ) : Curve
"); - html += - wxT("ST_Simplify( c Curve , tolerance Double precision ) : Curve
"); - html += - wxT("ST_Generalize( c Curve , tolerance Double precision ) : Curve
return a geometric object representing a simplified version of c applying the Douglas-Peukert algorithm with given tolerance
SimplifyPreserveTopology( c Curve , tolerance Double precision ) : Curve
"); - html += - wxT - ("ST_SimplifyPreserveTopology( c Curve , tolerance Double precision ) : Curve
return a geometric object representing a simplified version of c "); - html += - wxT - ("applying the Douglas-Peukert algorithm with given tolerance and respecting topology
functions on type Surface [Polygon or Ring]"); - html += wxT("
back to index
Centroid( s Surface ) : Point
"); - html += - wxT - ("ST_Centroid( s Surface ) : Point
return the centroid of s, which may lie outside s
Area( s Surface [ , use_ellipsoid Boolean ] ) : Double precision
"); - html += - wxT - ("ST_Area( s Surface [ , use_ellipsoid Boolean ] ) : Double precision
return the area of s
functions on type Polygon"); - html += wxT("
back to index
ExteriorRing( polyg Polygon ) : LineString
"); - html += - wxT - ("ST_ExteriorRing( polyg Polygon ) : LineString
return the exteriorRing of p
NumInteriorRing( polyg Polygon ) : Integer
NumInteriorRings( polyg Polygon ) : Integer
"); - html += wxT("ST_NumInteriorRing( polyg Polygon ) : Integer
return the number of interiorRings
InteriorRingN( polyg Polygon , n Integer ) : LineString
"); - html += - wxT("ST_InteriorRingN( polyg Polygon , n Integer ) : LineString
return the nth interiorRing. The order of Rings is not geometrically significant.
functions on type GeomCollection"); - html += wxT("
back to index
NumGeometries( geom GeomCollection ) : Integer
"); - html += - wxT - ("ST_NumGeometries( geom GeomCollection ) : Integer
return the number of geometries
GeometryN( geom GeomCollection , n Integer ) : Geometry
"); - html += - wxT("ST_GeometryN( geom GeomCollection , n Integer ) : Geometry
return the nth geometric object in the collection. The order of the elements in the collection is not geometrically significant.
functions testing approximative spatial relationships via MBRs"); - html += wxT("
back to index
MbrEqual( geom1 Geometry , geom2 Geometry ) : IntegerThe 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.
"); - html += wxT("TRUE if g1 and g2 have equal MBRs
MbrDisjoint( geom1 Geometry , geom2 Geometry ) : IntegerThe 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.
"); - html += - wxT - ("TRUE if the intersection of g1 and g2 MBRs is the empty set
MbrTouches( geom1 Geometry , geom2 Geometry ) : IntegerThe 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.
"); - html += - wxT - ("TRUE if the only Points in common between g1 and g2 MBRs lie in the union of the boundaries of g1 and g2
MbrWithin( geom1 Geometry , geom2 Geometry ) : IntegerThe 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.
"); - html += wxT("TRUE if g1 MBR is completely contained in g2 MBR
MbrOverlaps( geom1 Geometry , geom2 Geometry ) : IntegerThe 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.
"); - html += - wxT - ("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
MbrIntersects( geom1 Geometry , geom2 Geometry ) : IntegerThe 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
"); - html += - wxT - ("convenience predicate: TRUE if the intersection of g1 and g2 MBRs is not empty
ST_EnvIntersects( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += - wxT - ("ST_EnvelopesIntersects( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += - wxT - ("ST_EnvIntersects( geom1 Geometry , x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer
"); - html += - wxT - ("ST_EnvelopesIntersects( geom1 Geometry , x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer
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].
"); - html += - wxT - ("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
"); - html += - wxT - ("convenience predicate: TRUE if the intersection of both MBRs is not empty
MbrContains( geom1 Geometry , geom2 Geometry ) : IntegerThe 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
"); - html += - wxT - ("convenience predicate: TRUE if g2 MBR is completely contained in g1 MBR
functions testing spatial relationships"); - html += wxT("
back to index
Equals( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Equals( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += wxT("TRUE if g1 and g2 are equal
Disjoint( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Disjoint( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += - wxT("TRUE if the intersection of g1 and g2 is the empty set
Touches( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Touches( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += - wxT - ("TRUE if the only Points in common between g1 and g2 lie in the union of the boundaries of g1 and g2
Within( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Within( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += wxT("TRUE if g1 is completely contained in g2
Overlaps( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Overlaps( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += - wxT - ("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
Crosses( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Crosses( geom1 Geometry , geom2 Geometry ) : Integer
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.
"); - html += - wxT - ("TRUE if the intersection of g1 and g2 results in a value whose dimension is less than the maximum dimension of g1 and g2 "); - html += - wxT - ("and the intersection value includes Points interior to both g1 and g2, and the intersection value is not equal to either g1 or g2
Intersects( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += - wxT("ST_Intersects( geom1 Geometry , geom2 Geometry ) : Integer
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
"); - html += - wxT - ("convenience predicate: TRUE if the intersection of g1 and g2 is not empty
Contains( geom1 Geometry , geom2 Geometry ) : Integer
"); - html += wxT("ST_Contains( geom1 Geometry , geom2 Geometry ) : Integer
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
"); - html += - wxT - ("convenience predicate: TRUE if g2 is completely contained in g1
Covers( geom1 Geometry , geom2 Geometry ) : IntegerThe 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
"); - html += - wxT("convenience predicate: TRUE if g1 completely covers g2
CoveredBy( geom1 Geometry , geom2 Geometry ) : IntegerThe 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
"); - html += - wxT - ("convenience predicate: TRUE if g1 is completely covered by g2
Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer
"); - html += - wxT - ("ST_Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer
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.
"); - html += - wxT - ("return TRUE if the spatial relationship specified by the patternMatrix holds
Distance( geom1 Geometry , geom2 Geometry [ , use_ellipsoid Boolean ] ) : Double precision
"); - html += - wxT - ("ST_Distance( geom1 Geometry , geom2 Geometry [ , use_ellipsoid Boolean ] ) : Double precision
return the distance between geom1 and geom2
HausdorffDistance( geom1 Geometry , geom2 Geometry ) : Double precision
"); - html += - wxT - ("ST_HausdorffDistance( geom1 Geometry , geom2 Geometry ) : Double precision
return the Hausdorff Distance between geom1 and geom2
PtDistWithin( geom1 Geometry , geom2 Geometry , range Double precision [ , use_spheroid Integer ] ) : Integerchecks if the distance between geom1 and geom2 is within the given range.
"); - html += - wxT - ("As a special case if both geoms are simple WGS84 POINTs (SRID=4326) distances are expessed in meters.
functions implementing spatial operators"); - html += wxT("
back to index
Intersection( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += - wxT("ST_Intersection( geom1 Geometry , geom2 Geometry ) : Geometry
return a geometric object that is the intersection of geometric objects geom1 and geom2
Difference( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += - wxT("ST_Difference( geom1 Geometry , geom2 Geometry ) : Geometry
return a geometric object that is the closure of the set difference of geom1 and geom2
GUnion( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += wxT("ST_Union( geom1 Geometry , geom2 Geometry ) : Geometry
return a geometric object that is the set union of geom1 and geom2
GUnion( geom Geometry ) : Geometry
"); - html += wxT("ST_Union( geom Geometry ) : Geometry
return a geometric object that is the set union of input values
"); - html += wxT("aggregate function
SymDifference( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += - wxT("ST_SymDifference( geom1 Geometry , geom2 Geometry ) : Geometry
return a geometric object that is the closure of the set symmetric difference of geom1 and geom2 (logical XOR of space)
Buffer( geom Geometry , dist Double precision ) : Geometry
"); - html += - wxT("ST_Buffer( geom Geometry , dist Double precision ) : Geometry
return a geometric object defined by buffering a distance d around geom, "); - html += - wxT - ("where dist is in the distance units for the Spatial Reference of geom
ConvexHull( geom Geometry ) : Geometry
"); - html += wxT("ST_ConvexHull( geom Geometry ) : Geometry
return a geometric object that is the convex hull of geom
OffsetCurve( geom Curve , radius Double precision, left_or_right Integer ) : Curve
"); - html += - wxT - ("ST_OffsetCurve( geom Curve , radius Double precision, left_or_right Integer ) : Curve
return a geometric object representing the corresponding left- (or right-sided) offset curve
"); - html += - wxT - ("NULL if returned whenever is not possible deriving an offset curve from the original geometry
"); - html += - wxT("[a single not-closed LINESTRING is expected as input]
SingleSidedBuffer( geom Curve , radius Double precision, left_or_right Integer ) : Curve
"); - html += - wxT - ("ST_SingleSidedBuffer( geom Curve , radius Double precision, left_or_right Integer ) : Curve
return a geometric object representing the corresponding left- (or right-sided) single-sided buffer
"); - html += - wxT - ("NULL if returned whenever is not possible deriving a single-sided buffer from the original geometry
"); - html += - wxT("[a single not-closed LINESTRING is expected as input]
SharedPaths( geom1 Geometry , geom2 Geometry ) : Geometry
"); - html += - wxT("ST_SharedPaths( geom1 Geometry , geom2 Geometry ) : Geometry
return a geometric object (of the MULTILINESTRING type) representing any common edge shared by both geometries
"); - html += wxT("NULL if returned is no common edge exists
Line_Interpolate_Point( line Curve , fraction Double precision ) : Point
"); - html += - wxT - ("ST_Line_Interpolate_Point( line Curve , fraction Double precision ) : Point
return a point interpolated along a line.
Second argument (between 0.0 and 1.0) representing fraction"); - html += wxT("of total length of linestring the point has to be located.
"); - html += wxT("NULL if returned for invalid arguments
Line_Interpolate_Equidistant_Points( line Curve , distance Double precision ) : Point
"); - html += - wxT - ("ST_Line_Interpolate_Equidistant_Points( line Curve , distance Double precision ) : Point
return a set of equidistant points interpolated along a line; the returned geometry "); - html += - wxT - ("always corresponds to a MULTIPOINT supporting the M coordinate (representing the progressive distance for each interpolated Point).
"); - html += - wxT - ("Second argument represents the regular distance between interpolated points.
"); - html += wxT("NULL if returned for invalid arguments
Line_Locatate_Point( line Curve , point Point ) : Double precision
"); - html += - wxT - ("ST_Line_Locate_Point( line Curve , point Point ) : Double precision
return a number (between 0.0 and 1.0) representing the location of the closest point on LineString"); - html += wxT("to the given Point, as a fraction of total 2d line length.
"); - html += wxT("NULL if returned for invalid arguments
Line_Substring( line Curve , start_fraction Double precision , end_fraction Double precision ) : Curve
"); - html += - wxT - ("ST_Line_Substring( line Curve , start_fraction Double precision , end_fraction Double precision ) : Curve
Return a Linestring being a substring of the input one starting and ending at the given fractions of total 2d length.
"); - html += - wxT - ("Second and third arguments are expected to be in the range between 0.0 and 1.0.
"); - html += wxT("NULL if returned for invalid arguments
ClosestPoint( geom1 Geometry , geom2 Geometry ) : Point
"); - html += - wxT("ST_ClosestPoint( geom1 Geometry , geom2 Geometry ) : Point
Returns the Point on geom1 that is closest to geom2.
"); - html += - wxT - ("NULL is returned for invalid arguments (or if distance is ZERO)
ShortestLine( geom1 Geometry , geom2 Geometry ) : Curve
"); - html += - wxT("ST_ShortestLine( geom1 Geometry , geom2 Geometry ) : Curve
Returns the shortest line between two geometries.
"); - html += - wxT - ("NULL is returned for invalid arguments (or if distance is ZERO)
Snap( geom1 Geometry , geom2 Geometry , tolerance Double precision ) : Geometry
"); - html += - wxT - ("ST_Snap( geom1 Geometry , geom2 Geometry , tolerance Double precision ) : Geometry
Returns a new Geometry representing a modified geom1, so to \"snap\" vertices "); - html += - wxT - ("and segments to geom2 vertices; a snap distance tolerance is used to control where snapping is performed.
"); - html += wxT("NULL is returned for invalid arguments
LineMerge( geom Geometry ) : Geometry
"); - html += wxT("ST_LineMerge( geom Geometry ) : Geometry
a Geometry (actually corresponding to a LINESTRING or MULTILINESTRING) will be returned."); - html += - wxT - ("The input Geometry is expected to represent a LINESTRING or a MULTILINESTRING.
The input Geometry can be an "); - html += - wxT - ("arbitrary collection of sparse line fragments: this function will then try to (possibly) reassemble them into one"); - html += wxT("(or more) Linestring(s).
"); - html += wxT("NULL is returned for invalid arguments
UnaryUnion( geom Geometry ) : Geometry
"); - html += wxT("ST_UnaryUnion( geom Geometry ) : Geometry
Exactely the same as ST_Union, but applied to a single Geometry.
"); - html += - wxT - ("(set union of elementary Geometries within a MULTI- or GEOMETRYCOLLECTION complex Geometry).
"); - html += wxT("NULL will be returned if any error is encountered
functions for coordinate transformations"); - html += wxT("
back to index
Transform( geom Geometry , newSRID Integer ) : Geometry
"); - html += - wxT("ST_Transform( geom Geometry , newSRID Integer ) : Geometry
return a geometric object obtained by reprojecting coordinates into the Reference System identified by newSRID
SridFromAuthCRS( auth_name String , auth_SRID Integer ) : Integerreturn the internal SRID corresponding to auth_name and auth_SRID
-1 will be returned if no such CRS is defined
ShiftCoords( geom Geometry , shiftX Double precision , shiftY Double precision ) : Geometry
"); - html += - wxT - ("ShiftCoordinates( geom Geometry , shiftX Double precision , shiftY Double precision ) : Geometry
return a geometric object obtained by translating coordinates according to shiftX and shiftY values
ST_Translate( geom Geometry , shiftX Double precision , shiftY Double precision , shiftZ Double Precision ) : Geometryreturn a geometric object obtained by translating coordinates according to shiftX, shiftY and shiftZ values
ST_Shift_Longitude( geom Geometry ) : Geometryreturn a geometric object obtained by translating any negative longitude by 360.
"); - html += - wxT - ("Only meaningful for geographic (longitude/latitude) coordinates.
NormalizeLonLat( geom Geometry ) : Geometryreturn a geometric object obtained by normalizing any longitude in the range"); - html += wxT("[-180 / +180] and any latitude in the range [-90 / + 90].
"); - html += - wxT - ("Only meaningful for geographic (longitude/latitude) coordinates.
ScaleCoords( geom Geometry , scaleX Double precision [ , scaleY Double precision ] ) : Geometry
"); - html += - wxT - ("ScaleCoordinates( geom Geometry , scaleX Double precision [ , scaleY Double precision ] ) : Geometry
return a geometric object obtained by scaling coordinates according to scaleX and scaleY values
"); - html += - wxT - ("if only one scale factor is specified, then an isotropic scaling occurs [i.e. the same scale factor is applied to both axis]"); - html += - wxT - ("otherwise an anisotropic scaling occurs [i.e. each axis is scaled according to its own scale factor]
RotateCoords( geom Geometry , angleInDegrees Double precision ) : Geometry
"); - html += - wxT - ("RotateCoordinates( geom Geometry , angleInDegrees Double precision ) : Geometry
return a geometric object obtained by rotating coordinates according to angleInDegrees value
"); - html += wxT("Positive angle = clockwise rotation
ReflectCoords( geom Geometry , xAxis Integer , yAxis Integer ) : Geometry
"); - html += - wxT - ("ReflectCoordinates( geom Geometry , xAxis Integer , yAxis Integer ) : Geometry
return a geometric object obtained by reflecting coordinates according to xAxis and yAxis switches
"); - html += - wxT - ("i.e. if xAxis is 0 (FALSE), then x-coordinates remains untouched; otherwise x-coordinates will be reflected
SwapCoords( geom Geometry ) : Geometry
SwapCoordinates( geom Geometry ) : Geometry
return a geometric object obtained by swapping x- and y-coordinates
functions for Spatial-MetaData and Spatial-Index handling"); - html += wxT("
back to index
InitSpatialMetaData( void ) : Integer
"); - html += wxT("InitSpatialMetaData( transaction Integer ) : Integer
"); - html += wxT("InitSpatialMetaData( mode String ) : Integer
"); - html += - wxT - ("InitSpatialMetaData( transaction Integer , mode String ) : Integer
Creates the geometry_columns and spatial_ref_sys metadata tables"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
"); - html += - wxT - ("the first form (no args) will automatically populate spatial_ref_sys inserting any possible ESPG SRID definition
"); - html += - wxT - ("if the arg 'WGS84' (alias 'WGS84_ONLY') is specified, then only WGS84-releated EPSG SRIDs will be inserted
"); - html += - wxT - ("if the arg 'NONE' (alias 'EMPTY') is specified, no EPSG SRID will be inserted at all
InsertEpsgSrid( srid Integer ) : IntegerAttempts to insert into spatial_ref_sys the EPSG definition uniquely identified by srid
"); - html += - wxT - ("[the corresponding EPSG SRID definition will be copied from the inlined dataset defined in libspatialite
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for success or 0 for failure
AddGeometryColumn( table String , column String , srid Integer , geom_type String , dimension String [ , not_null Integer ] ) : IntegerCreates a new geometry column updating the Spatial Metadata tables and creating any required trigger in order to enforce constraints
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
RecoverGeometryColumn( table String , column String , srid Integer , geom_type String , dimension String ) : IntegerValidates an existing ordinary column in order to possibly transform it in a real geometry column, "); - html += - wxT - ("thus updating the Spatial Metadata tables and creating any required trigger in order to enforce constraints
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
DiscardGeometryColumn( table String , column String ) : IntegerRemoves a geometry column from Spatial MetaData tables and drops any related trigger
"); - html += - wxT - ("the column itself still continues to exist untouched as an ordinary, unconstrained column
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
RegisterVirtualGeometry( table String ) : IntegerRegisters a VirtualShape table into Spatial MetaData tables; the VirtualShape table should be already created in some previous step.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
DropVirtualGeometry( table String ) : IntegerRemoves a VirtualShape table from Spatial MetaData tables, dropping the VirtualShape table as well.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
CreateSpatialIndex( table String , column String ) : IntegerBuilds an RTree Spatial Index on a geometry column, "); - html += - wxT - ("creating any required trigger required in order to enforce full data coherency between the main table and Spatial Index
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
DisableSpatialIndex( table String , column String ) : IntegerDisables an RTree Spatial Index, removing any related trigger
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
CheckShadowedRowid( table String ) : IntegerChecks if some table has a physical column named \"rowid\" (caseless) shadowing the real ROWID.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
CheckSpatialIndex( void ) : Integer
"); - html += - wxT("CheckSpatialIndex( table String , column String ) : Integer
Checks an RTree Spatial Index for validity and consistency
"); - html += - wxT - ("- if no arguments are passed, then any RTree defined into geometry_columns will be checked
"); - html += - wxT - ("- otherwise only the RTree corresponding to table and column will be checked
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
RecoverSpatialIndex( [ no_check Integer ] ) : Integer
"); - html += - wxT - ("RecoverSpatialIndex( table String , column String [ , no_check Integer ] ) : Integer
Recovers a (possibly broken) RTree Spatial Index
"); - html += - wxT - ("- if no arguments are passed, then any RTree defined into geometry_columns will be recovered
"); - html += - wxT - ("- otherwise only the RTree corresponding to table and column will be recovered
"); - html += - wxT("- the optional argument no_check will be interpreted as follows:
"); - html += - wxT - ("  * if no_check = FALSE (default) the RTree will be checked first: "); - html += wxT("and only an invalid RTree will be then actually rebuilt
"); - html += - wxT - ("  * if no_check = TRUE the RTree will be unconditionally rebuilt from scratch anyway
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
InvalidateLayerStatistics( void ) : Integer
"); - html += - wxT - ("InvalidateLayerStatistics( table String [, column String ] ) : Integer
Immediately and unconditionally invalidates the internal Layer Statistics
"); - html += - wxT - ("- if no arguments are passed, then internal statics will be invalidated for any possible Geometry Column "); - html += wxT("defined in the current DB
"); - html += - wxT - ("- otherwise statistics will be invalidated only for Geometry Columns corresponding to the given table
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
UpdateLayerStatistics( void ) : Integer
"); - html += - wxT - ("UpdateLayerStatistics( table String [, column String ] ) : Integer
Updates the internal Layer Statistics [Feature Count and Total Extent]
"); - html += - wxT - ("- if no arguments are passed, then internal statics will be updated for any possible Geometry Column "); - html += wxT("defined in the current DB
"); - html += - wxT - ("- otherwise statistics will be updated only for Geometry Columns corresponding to the given table
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
GetLayerExtent( table String [ , column String [ , mode Boolean] ] ) : GeometryReturn the Envelope corresponding to the Total Extent of some Layer; "); - html += - wxT - ("if the Table/Layer only contains a single Geometry column passing the column name isn't strictly required.
"); - html += - wxT - ("NULL will be returned if any error occurs or if the required table isn't a Layer.
CreateTopologyTables( SRID Integer , dims String ) : Integer
"); - html += - wxT - ("CreateTopologyTables( prefix String , SRID Integer , dims String ) : Integer
Creates a set of Topology tables.
"); - html += - wxT - ("
  • the SRIDargument is mandatory
  • the dims argument must be 'XY' or 'XYZ': 2 or 3 are valid aliases
  • "); - html += - wxT - ("
  • the optionalargument prefix can be used to support more Topology sets on the same DB: "); - html += - wxT - ("if omitted a \"topo_\" prefix will be assumed by default

"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure).
CreateRasterCoveragesTable( void ) : IntegerCreates the raster_coverages table required by RasterLite-2
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE (failure).
functions for MetaCatalog and related Statistics"); - html += wxT("
back to index
CreateMetaCatalogTables( transaction Integer ) : IntegerCreates both splite_metacatalog and splite_metacatalog_statistics tables; "); - html += - wxT - ("splite_metacatalog will be populated so to describe every table/column currently defined within the DB.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE
UpdateMetaCatalogTables( transaction Integer , table_name String, column_name String ) : Integer"); - html += - wxT - ("UpdateMetaCatalogTables( transaction Integer , master_table String , table_name String, column_name String ) : IntegerUpdates the splite_metacatalog_statistics table by computing the statistic summary for the required table/column.
"); - html += - wxT - ("the second form (four args) will use a MasterTable in order to identify all table/columns to be updated.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE
functions supporting SLD/SE Styled Layers"); - html += wxT("
back to index
CreateStylingTables( ) : Integer
"); - html += wxT("CreateStylingTables( relaxed Integer ) : Integer
Creates a set of tables supporting SLD/SE Styled Layers.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterExternalGraphic( xlink_href String , resource BLOB ) : Integer
"); - html += - wxT - ("RagisterExternalGraphic( xlink_href String , resource BLOB , title String , abstract String , file_name String ) : Integer
Inserts (or updates) an External Graphic Resource.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterVectorStyledLayer( f_table_name String , f_geometry_column String , style BLOB ) : Integer
"); - html += - wxT - ("RegisterVectorStyledLayer( f_table_name String , f_geometry_column String , style_id Integer , style BLOB ) : Integer
Inserts (or updates) a Vector Styled Layer definition.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterRasterStyledLayer( coverage_name String , style BLOB ) : Integer
"); - html += - wxT - ("RegisterRasterStyledLayer( coverage_name String , style_id Integer , style BLOB ) : Integer
Inserts (or updates) a Raster Styled Layer definition.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterStyledGroup( group_name String , f_table_name String , f_geometry_colum String [ , paint_order Integer ] ) : Integer
"); - html += - wxT - ("RegisterStyledGroup( group_name String, coverage_name String [ , paint_order Integer ] ) : Integer
Inserts (or updates) a Styled Group definition.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
SetStyledGroupInfos( group_name String , title String , abstract String ) : IntegerInserts (or updates) the descriptive infos associated to a Styled Group
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterGroupStyle( group_name String , style BLOB ) : Integer
"); - html += - wxT - ("RegisterGroupStyle( group_name String , style_id Integer , style BLOB ) : Integer
Inserts (or updates) a Group Style definition.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
functions implementing ISO Metadata"); - html += wxT("
back to index
CreateIsoMetadataTables( ) : Integer
"); - html += wxT("CreateIsoMetadataTables( relaxed Integer ) : Integer
Creates a set of tables supporting ISO Metadata.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
RegisterIsoMetadata( scope String , metadata BLOB ) : Integer
"); - html += - wxT - ("RegisterIsoMetadata( scope String , metadata BLOB , id Integer ) : Integer
"); - html += - wxT - ("RagisterIsoMetadata( scope String , metadata BLOB , fileIdentifier String ) : Integer
Inserts (or updates) an ISO Metadata definition.
"); - html += - wxT - ("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.
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE (success) or 0 for FALSE "); - html += wxT("(failure): -1 will be returned on invalid arguments.
GetIsoMetadataId( fileIdentifier String ) : IntegerReturn the unique \"id\" corresponding to the ISO Metadata definition identified by fileIdentifier.
"); - html += - wxT - ("If no corresponding ISO Metadata definition exists, this function will always return ZERO; -1 will be returned for invalid arguments.
functions implementing FDO/OGR compatibily"); - html += wxT("
back to index
CheckSpatialMetaData( void ) : IntegerChecks the Spatial Metadata type, then returning:
"); - html += - wxT - ("0 if the geometry_columns and spatial_ref_sys table does not exist, "); - html += - wxT - ("or if their actual layout doesn't corresponds to any known implementation
"); - html += - wxT - ("1 if both tables exist, and their layout is the one used by SpatiaLite legacy (older versions including 3.0.1)
"); - html += - wxT - ("2 if both tables exist, and their layout is the one used by FDO/OGR
"); - html += - wxT - ("3 if both tables exist, and their layout is the one currently used by SpatiaLite (3.1.0 or any subsequent version)
AutoFDOStart( void ) : IntegerThis function will inspect the Spatial Metadata, then automatically creating/refreshing a VirtualFDO"); - html += - wxT - (" wrapper for each FDO/OGR geometry table
the return type is Integer [how many VirtualFDO tables have been created]
AutoFDOStop( void ) : IntegerThis function will inspect the Spatial Metadata, then automatically destroying any VirtualFDO"); - html += - wxT - (" wrapper found
the return type is Integer [how many VirtualFDO tables have been destroyed]
InitFDOSpatialMetaData( void ) : IntegerCreates the geometry_columns and spatial_ref_sys metadata tables"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
"); - html += - wxT - ("Please note: Spatial Metadata created using this function will have the FDO/OGR layout, and not the SpatiaLite's own
AddFDOGeometryColumn( table String , column String , srid Integer , geom_type String , dimension Integer , geometry_type String ) : IntegerCreates a new geometry column updating the FDO/OGR Spatial Metadata tables
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
RecoverFDOGeometryColumn( table String , column String , srid Integer , geom_type String , dimension Integer , geometry_type String ) : IntegerValidates an existing ordinary column in order to possibly transform it in a real geometry column, "); - html += wxT("thus updating the FDO/OGR Spatial Metadata tables
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
DiscardFDOGeometryColumn( table String , column String ) : IntegerRemoves a geometry column from FDO/OGR Spatial MetaData tables
"); - html += - wxT - ("the column itself still continues to exist untouched as an ordinary column
"); - html += - wxT - ("the return type is Integer, with a return value of 1 for TRUE or 0 for FALSE
functions for MbrCache-based queries"); - html += wxT("
back to index
FilterMbrWithin( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : IntegerRetrieves from an MbrCache any entity whose MBR falls within"); - html += - wxT - (" the rectangle identified by extreme points x1 y1 and x2 y2
FilterMbrContains( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : IntegerRetrieves from an MbrCache any entity whose MBR contains"); - html += - wxT - (" the rectangle identified by extreme points x1 y1 and x2 y2
FilterMbrIntersects( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : IntegerRetrieves from an MbrCache any entity whose MBR intersects"); - html += - wxT - (" the rectangle identified by extreme points x1 y1 and x2 y2
functions for R*Tree-based queries (Geometry Callbacks)"); - html += wxT("
back to index
RTreeWithin( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer*DEPRECATED* (alias-name for RTreeIntersects)
RTreeContains( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : Integer*DEPRECATED* (alias-name for RTreeIntersects)
RTreeIntersects( x1 Double precision , y1 Double precision , x2 Double precision , y2 Double precision ) : IntegerRetrieves from an R*Tree any entity whose MBR intersects"); - html += - wxT - (" the rectangle identified by extreme points x1 y1 and x2 y2
RTreeDistWithin( x Double precision , y Double precision , radius Double precision ) : IntegerRetrieves from an R*Tree any entity whose MBR intersects"); - html += - wxT - (" the square square circumscribed on the given circle (x y center, radius)
SQL functions supporting XmlBLOB"); - html += wxT("
back to index
XB_Create( xmlPayload BLOB ) : XmlBLOB
"); - html += - wxT("XB_Create( xmlPayload BLOB , compressed Boolean ) : XmlBLOB
"); - html += - wxT - ("XB_Create( xmlPayload BLOB , compressed Boolean , schemaURI Text ) : XmlBLOB
"); - html += - wxT - ("XB_Create( xmlPayload BLOB , compressed Boolean , internalSchemaURI Boolean ) : XmlBLOB
Construct an XmlBLOB object starting from an XmlDocument.
"); - html += - wxT - ("NULL will be returned for not well-formed XmlDocuments, or when XML validation is required but XmlDocument fails to pass validation for any reason.
XB_GetPayload( xmlObject BLOB [ , indent Integer ] ) : StringExtracts a generic BLOB from an XmlBLOB object, exactly corresponding to the original XmlDocument and fully preserving the original character encoding.
XB_GetDocument( xmlObject BLOB [ , indent Integer ] ) : StringExtracts an XmlDocument from an XmlBLOB object; the returned XmlDocument will always be UTF-8 encoded (TEXT), irrespectively from the original internal encoding declaration.
XB_SchemaValidate( xmlObject BLOB , schemaURI Text [ , compressed Boolean ] ) : XmlBLOB
"); - html += - wxT - ("XB_SchemaValidate( xmlObject BLOB , internalSchemaURI Boolean [ , compressed Boolean ] ) : XmlBLOB
Construct an XML validated XmlBLOB object starting from an XmlDocument.
"); - html += - wxT - ("NULL will be returned if the input XmlBLOB fails to pass validation for any reason.
XB_Compress( xmlObject BLOB ) : XmlBLOBA new compressed XmlBLOB object will be returned.
XB_Uncompress( xmlObject BLOB ) : XmlBLOBA new uncompressed XmlBLOB object will be returned.
XB_IsValid( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsCompressed( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsSchemaValidated( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsIsoMetadata( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsSldSeVectorStyle( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsSldSeRasterStyle( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_IsSvg( xmlObject BLOB ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_GetDocumentSize( xmlObject BLOB ) : IntegerWill return the size in bytes of the corresponding uncompressed XmlDocument.
XB_GetEncoding( xmlObject BLOB ) : StringWill return the character encoding internally declared by the XmlDocument corresponding to the input XmlBLOB.
XB_GetSchemaURI( xmlObject BLOB ) : StringWill return the Schema URI effectively used to validate an XmlBLOB.
XB_GetInternalSchemaURI( xmlPayload BLOB ) : StringWill return the Schema URI internally declared by the input XmlDocument.
XB_GetFileId( xmlObject BLOB ) : StringWill return the FileId defined within the XmlBLOB (if any).
XB_SetFileId( xmlObject BLOB , fileId String ) : XmlBLOBWill return a new XmlBLOB by replacing the FileIdentifier value.
XB_AddFileId( xmlObject BLOB , fileId String , IdNameSpacePrefix String , IdNameSpaceURI String , CsNameSpacePrefix String , CsNameSpaceURI String ) : XmlBLOBWill return a new XmlBLOB by inserting a FileIdentifier value.
XB_GetParentId( xmlObject BLOB ) : StringWill return the ParentId defined within the XmlBLOB (if any).
XB_SetParentId( xmlObject BLOB , parentId String ) : XmlBLOBWill return a new XmlBLOB by replacing the ParentIdentifier value.
XB_AddParentId( xmlObject BLOB , parentId String , IdNameSpacePrefix String , IdNameSpaceURI String , CsNameSpacePrefix String , CsNameSpaceURI String ) : XmlBLOBWill return a new XmlBLOB by inserting a ParentIdentifier value.
XB_GetTitle( xmlObject BLOB ) : StringWill return the Title defined within the XmlBLOB (if any).
XB_GetAbstract( xmlObject BLOB ) : StringWill return the Abstract defined within the XmlBLOB (if any).
XB_GetGeometry( xmlObject BLOB ) : GeometryWill return the Geometry defined within the XmlBLOB (if any).
XB_GetLastParseError( void ) : StringWill return the most recent XML parsing error (if any).
XB_GetLastValidateError( void ) : StringWill return the most recent XML validating error (if any).
XB_IsValidXPathExpression( expr Text ) : IntegerThe return type is Integer, with a return value of 1 for TRUE, 0 for FALSE, "); - html += - wxT - ("and -1 for UNKNOWN corresponding to a function invocation on NULL arguments.
XB_GetLastXPathError( void ) : StringWill return the most recent XPath error (if any).
XB_CacheFlush( void ) : BooleanReset the internal XML Schema cache to its initial empty state.
XB_CacheFlush( void ) : BooleanReset the internal XML Schema cache to its initial empty state.
XB_LoadXML( filepath-or-URL String ) : BLOBIf \"filepath-or-URL\" corresponds to some valid local pathname, and the corresponding file (expected to contain a well-formed XML Document) "); - html += - wxT - ("can be actually accessed in read mode, then the whole file content will be returned as a BLOB value.
"); - html += - wxT - ("This function is even able to acces a remote XML Document identified by an URL.
Otherwise NULL will be returned.
"); - html += - wxT - ("Please note: SQLite doesn't support BLOB values bigger than SQLITE_MAX_LENGTH (usually, 1 GB).
"); - html += - wxT - ("Please note well: this SQL function open the doors to many potential security issues, and thus is always disabled by default.
"); - html += - wxT - ("Explicitly setting the environment variable \"SPATIALITE_SECURITY=relaxed\" is absolutely required in order to effectively enable this function.
"); - html += wxT("Please see: CountUnsafeTriggers().
XB_StoreXML( XmlObject XmlBLOB , filepath String ) : Integer
"); - html += - wxT - ("XB_StoreXML( XmlObject XmlBLOB , filepath String , indent Integer ) : Integer
If \"XmlObject\" is of the XmlBLOB-type, and if \"filepath\" corresponds to some valid pathname "); - html += - wxT - ("(accessible in write/create mode), then the corresponding file will be created/overwritten so to "); - html += - wxT - ("contain the corresponding XML Document (fully preserving the original character encoding).
"); - html += - wxT - ("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; "); - html += - wxT - ("ZERO will cause the whole XmlDocument to be returned as a single line. (default setting is negative indenting, i.e. not reformatting at all).
"); - html += - wxT - ("The return type is Integer, with a return value of 1 for success, 0 for failure and -1 for invalid arguments.
"); - html += - wxT - ("Please note well: this SQL function open the doors to many potential security issues, and thus is always disabled by default.
"); - html += - wxT - ("Explicitly setting the environment variable \"SPATIALITE_SECURITY=relaxed\" is absolutely required in order to effectively enable this function.
"); - html += wxT("Please see: CountUnsafeTriggers().
"); - html += wxT("back to index"); - html += wxT(""); - html += wxT(""); -} Index: Makefile-static-mingw32 ================================================================== --- Makefile-static-mingw32 +++ Makefile-static-mingw32 @@ -1,22 +1,24 @@ # SandroFurieri (c) 2008 # Makefile ( Mingw & wxwidgets) for spatialite-GUI SRC = Main.cpp TableTree.cpp QueryView.cpp ResultSetView.cpp BlobExplorer.cpp \ - Dialogs.cpp Shapefiles.cpp Network.cpp Exif.cpp TextCsv.cpp \ + Dialogs.cpp Shapefiles.cpp Exif.cpp TextCsv.cpp Postgres.cpp \ Objects.cpp QueryViewComposer.cpp MalformedGeoms.cpp DialogsGraph.cpp \ Raster.cpp Styles.cpp RasterSymbolizers.cpp VectorSymbolizers1.cpp \ VectorSymbolizers2.cpp Wfs.cpp SqlFilterComposer.cpp \ WmsDialog.cpp LayerTree.cpp MapPanel.cpp MapView.cpp \ - QuickStyles.cpp \ + QuickStylesVector.cpp QuickStylesTopology.cpp QuickStylesRaster.cpp \ + HtmlHelp.cpp \ win_resource/resource.rc OBJ = Main.o TableTree.o QueryView.o ResultSetView.o BlobExplorer.o \ - Dialogs.o Shapefiles.o Network.o Exif.o TextCsv.o Objects.o \ + Dialogs.o Shapefiles.o Exif.o TextCsv.o Objects.o Postgres.o \ QueryViewComposer.o MalformedGeoms.o DialogsGraph.o \ Raster.o Styles.o RasterSymbolizers.o VectorSymbolizers1.o \ - VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o \ - WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStyles.o \ + VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o HtmlHelp.o \ + WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStylesVector.o \ + QuickStylesTopology.o QuickStylesRaster.o \ win_resource/resource.o EXE = ./static_bin/spatialite_gui.exe INCLUDE = Classdef.h # Define default flags: @@ -38,11 +40,12 @@ /mingw32/local/lib/libpng.a /mingw32/local/lib/libjpeg.a \ /mingw32/local/lib/libsqlite3.a /mingw32/local/lib/libcurl.a \ /mingw32/local/lib/libwebp.a /mingw32/local/lib/libgif.a \ /mingw32/local/lib/libssl.a /mingw32/local/lib/libcrypto.a \ /mingw32/local/lib/libz.a /mingw32/local/lib/liblzma.a \ - /mingw32/local/lib/libCharLS.a /mingw32/local/lib/libopenjp2.a + /mingw32/local/lib/libCharLS.a /mingw32/local/lib/libopenjp2.a \ + /mingw32/local/lib/libvirtualpg.a EXTRALIB2 = -lgdi32 -lmsimg32 -lws2_32 -lwldap32 CXX = g++ -static REZ = $(shell /mingw32/local/bin/wx-config --rescomp) @@ -94,13 +97,10 @@ $(CXX) -c DialogsGraph.cpp $(CXXFLAGS) $(EXTRAFLAGS) Shapefiles.o: Shapefiles.cpp $(INCLUDE) $(CXX) -c Shapefiles.cpp $(CXXFLAGS) $(EXTRAFLAGS) -Network.o: Network.cpp $(INCLUDE) - $(CXX) -c Network.cpp $(CXXFLAGS) $(EXTRAFLAGS) - Exif.o: Exif.cpp $(INCLUDE) $(CXX) -c Exif.cpp $(CXXFLAGS) $(EXTRAFLAGS) TextCsv.o: TextCsv.cpp $(INCLUDE) $(CXX) -c TextCsv.cpp $(CXXFLAGS) $(EXTRAFLAGS) @@ -124,11 +124,23 @@ $(CXX) -c MapPanel.cpp $(CXXFLAGS) $(EXTRAFLAGS) MapView.o: MapView.cpp $(INCLUDE) $(CXX) -c MapView.cpp $(CXXFLAGS) $(EXTRAFLAGS) -QuickStyles.o: QuickStyles.cpp $(INCLUDE) - $(CXX) -c QuickStyles.cpp $(CXXFLAGS) $(EXTRAFLAGS) +QuickStylesVector.o: QuickStylesVector.cpp $(INCLUDE) + $(CXX) -c QuickStylesVector.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +QuickStylesTopology.o: QuickStylesTopology.cpp $(INCLUDE) + $(CXX) -c QuickStylesTopology.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +QuickStylesRaster.o: QuickStylesRaster.cpp $(INCLUDE) + $(CXX) -c QuickStylesRaster.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +Postgres.o: Postgres.cpp $(INCLUDE) + $(CXX) -c Postgres.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +HtmlHelp.o: HtmlHelp.cpp $(INCLUDE) + $(CXX) -c HtmlHelp.cpp $(CXXFLAGS) $(EXTRAFLAGS) win_resource/resource.o: win_resource/resource.rc echo $(CXXFLAGS) $(REZ) $(CXXFLAGS) -i win_resource/resource.rc -o win_resource/resource.o Index: Makefile-static-mingw64 ================================================================== --- Makefile-static-mingw64 +++ Makefile-static-mingw64 @@ -1,22 +1,24 @@ # SandroFurieri (c) 2008 # Makefile ( Mingw & wxwidgets) for spatialite-GUI SRC = Main.cpp TableTree.cpp QueryView.cpp ResultSetView.cpp BlobExplorer.cpp \ - Dialogs.cpp Shapefiles.cpp Network.cpp Exif.cpp TextCsv.cpp \ + Dialogs.cpp Shapefiles.cpp Exif.cpp TextCsv.cpp Postgres.cpp \ Objects.cpp QueryViewComposer.cpp MalformedGeoms.cpp DialogsGraph.cpp \ Raster.cpp Styles.cpp RasterSymbolizers.cpp VectorSymbolizers1.cpp \ VectorSymbolizers2.cpp Wfs.cpp SqlFilterComposer.cpp \ WmsDialog.cpp LayerTree.cpp MapPanel.cpp MapView.cpp \ - QuickStyles.cpp \ + QuickStylesVector.cpp QuickStylesTopology.cpp QuickStylesRaster.cpp \ + HtmlHelp.cpp \ win_resource/resource.rc OBJ = Main.o TableTree.o QueryView.o ResultSetView.o BlobExplorer.o \ - Dialogs.o Shapefiles.o Network.o Exif.o TextCsv.o Objects.o \ + Dialogs.o Shapefiles.o Exif.o TextCsv.o Objects.o Postgres.o \ QueryViewComposer.o MalformedGeoms.o DialogsGraph.o \ Raster.o Styles.o RasterSymbolizers.o VectorSymbolizers1.o \ - VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o \ - WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStyles.o \ + VectorSymbolizers2.o Wfs.o SqlFiltersComposer.o HtmlHelp.o \ + WmsDialog.o LayerTree.o MapPanel.o MapView.o QuickStylesVector.o \ + QuickStylesTopology.o QuickStylesRaster.o \ win_resource/resource.o EXE = ./static_bin/spatialite_gui.exe INCLUDE = Classdef.h # Define default flags: @@ -38,11 +40,12 @@ /mingw64/local/lib/libpng.a /mingw64/local/lib/libjpeg.a \ /mingw64/local/lib/libsqlite3.a /mingw64/local/lib/libcurl.a \ /mingw64/local/lib/libwebp.a /mingw64/local/lib/libgif.a \ /mingw64/local/lib/libssl.a /mingw64/local/lib/libcrypto.a \ /mingw64/local/lib/libz.a /mingw64/local/lib/liblzma.a \ - /mingw64/local/lib/libCharLS.a /mingw64/local/lib/libopenjp2.a + /mingw64/local/lib/libCharLS.a /mingw64/local/lib/libopenjp2.a \ + /mingw64/local/lib/libvirtualpg.a EXTRALIB2 = -lgdi32 -lmsimg32 -lws2_32 -lwldap32 CXX = g++ -static REZ = $(shell /mingw64/local/bin/wx-config --rescomp) @@ -94,13 +97,10 @@ $(CXX) -c DialogsGraph.cpp $(CXXFLAGS) $(EXTRAFLAGS) Shapefiles.o: Shapefiles.cpp $(INCLUDE) $(CXX) -c Shapefiles.cpp $(CXXFLAGS) $(EXTRAFLAGS) -Network.o: Network.cpp $(INCLUDE) - $(CXX) -c Network.cpp $(CXXFLAGS) $(EXTRAFLAGS) - Exif.o: Exif.cpp $(INCLUDE) $(CXX) -c Exif.cpp $(CXXFLAGS) $(EXTRAFLAGS) TextCsv.o: TextCsv.cpp $(INCLUDE) $(CXX) -c TextCsv.cpp $(CXXFLAGS) $(EXTRAFLAGS) @@ -124,11 +124,23 @@ $(CXX) -c MapPanel.cpp $(CXXFLAGS) $(EXTRAFLAGS) MapView.o: MapView.cpp $(INCLUDE) $(CXX) -c MapView.cpp $(CXXFLAGS) $(EXTRAFLAGS) -QuickStyles.o: QuickStyles.cpp $(INCLUDE) - $(CXX) -c QuickStyles.cpp $(CXXFLAGS) $(EXTRAFLAGS) +QuickStylesVector.o: QuickStylesVector.cpp $(INCLUDE) + $(CXX) -c QuickStylesVector.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +QuickStylesTopology.o: QuickStylesTopology.cpp $(INCLUDE) + $(CXX) -c QuickStylesTopology.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +QuickStylesRaster.o: QuickStylesRaster.cpp $(INCLUDE) + $(CXX) -c QuickStylesRaster.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +Postgres.o: Postgres.cpp $(INCLUDE) + $(CXX) -c Postgres.cpp $(CXXFLAGS) $(EXTRAFLAGS) + +HtmlHelp.o: HtmlHelp.cpp $(INCLUDE) + $(CXX) -c HtmlHelp.cpp $(CXXFLAGS) $(EXTRAFLAGS) win_resource/resource.o: win_resource/resource.rc echo $(CXXFLAGS) $(REZ) $(CXXFLAGS) -i win_resource/resource.rc -o win_resource/resource.o Index: Makefile.am ================================================================== --- Makefile.am +++ Makefile.am @@ -5,28 +5,30 @@ AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ AM_CPPFLAGS += -I$(top_srcdir) spatialite_gui_SOURCES = Classdef.h BlobExplorer.cpp \ Dialogs.cpp DialogsGraph.cpp WmsDialog.cpp Exif.cpp \ - Main.cpp MalformedGeoms.cpp Network.cpp \ + Main.cpp MalformedGeoms.cpp \ Objects.cpp QueryView.cpp QueryViewComposer.cpp \ ResultSetView.cpp Shapefiles.cpp TableTree.cpp \ TextCsv.cpp Wfs.cpp Raster.cpp Styles.cpp \ RasterSymbolizers.cpp VectorSymbolizers1.cpp \ VectorSymbolizers2.cpp SqlFiltersComposer.cpp \ MapPanel.cpp MapView.cpp LayerTree.cpp \ - QuickStyles.cpp + QuickStylesVector.cpp QuickStylesTopology.cpp \ + QuickStylesRaster.cpp HtmlHelp.cpp Postgres.cpp LDADD = @WX_LIBS@ @LIBSPATIALITE_LIBS@ \ - @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ -lgeos_c + @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ \ + @LIBVIRTUALPG_LIBS@ @LIBXML2_LIBS@ \ + @PG_LDFLAGS@ @PG_LIB@ -lgeos_c -EXTRA_DIST = Makefile-static-MinGW \ - Makefile-static-mingw32 \ - Makefile-static-mingw64 \ - Makefile-static-Linux \ - Makefile-static-MacOsX \ - indent_me +EXTRA_DIST = Makefile-static-mingw32 \ + Makefile-static-mingw64 \ + helpgen/helpgen.c \ + helpgen/READ_ME.txt \ + indent_me AUTOMAKE_OPTIONS = dist-zip foreign SUBDIRS = icons win_resource mac_resource gnome_resource Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -107,19 +107,21 @@ CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_spatialite_gui_OBJECTS = BlobExplorer.$(OBJEXT) Dialogs.$(OBJEXT) \ DialogsGraph.$(OBJEXT) WmsDialog.$(OBJEXT) Exif.$(OBJEXT) \ - Main.$(OBJEXT) MalformedGeoms.$(OBJEXT) Network.$(OBJEXT) \ - Objects.$(OBJEXT) QueryView.$(OBJEXT) \ - QueryViewComposer.$(OBJEXT) ResultSetView.$(OBJEXT) \ - Shapefiles.$(OBJEXT) TableTree.$(OBJEXT) TextCsv.$(OBJEXT) \ - Wfs.$(OBJEXT) Raster.$(OBJEXT) Styles.$(OBJEXT) \ - RasterSymbolizers.$(OBJEXT) VectorSymbolizers1.$(OBJEXT) \ - VectorSymbolizers2.$(OBJEXT) SqlFiltersComposer.$(OBJEXT) \ - MapPanel.$(OBJEXT) MapView.$(OBJEXT) LayerTree.$(OBJEXT) \ - QuickStyles.$(OBJEXT) + Main.$(OBJEXT) MalformedGeoms.$(OBJEXT) Objects.$(OBJEXT) \ + QueryView.$(OBJEXT) QueryViewComposer.$(OBJEXT) \ + ResultSetView.$(OBJEXT) Shapefiles.$(OBJEXT) \ + TableTree.$(OBJEXT) TextCsv.$(OBJEXT) Wfs.$(OBJEXT) \ + Raster.$(OBJEXT) Styles.$(OBJEXT) RasterSymbolizers.$(OBJEXT) \ + VectorSymbolizers1.$(OBJEXT) VectorSymbolizers2.$(OBJEXT) \ + SqlFiltersComposer.$(OBJEXT) MapPanel.$(OBJEXT) \ + MapView.$(OBJEXT) LayerTree.$(OBJEXT) \ + QuickStylesVector.$(OBJEXT) QuickStylesTopology.$(OBJEXT) \ + QuickStylesRaster.$(OBJEXT) HtmlHelp.$(OBJEXT) \ + Postgres.$(OBJEXT) spatialite_gui_OBJECTS = $(am_spatialite_gui_OBJECTS) spatialite_gui_LDADD = $(LDADD) spatialite_gui_DEPENDENCIES = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -317,10 +319,12 @@ LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ LIBS = @LIBS@ LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ LIBTOOL = @LIBTOOL@ +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ LIBWEBP_LIBS = @LIBWEBP_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ @@ -343,10 +347,14 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PGCONFIG = @PGCONFIG@ +PG_CFLAGS = @PG_CFLAGS@ +PG_LDFLAGS = @PG_LDFLAGS@ +PG_LIB = @PG_LIB@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ @@ -411,28 +419,30 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ -I$(top_srcdir) spatialite_gui_SOURCES = Classdef.h BlobExplorer.cpp \ Dialogs.cpp DialogsGraph.cpp WmsDialog.cpp Exif.cpp \ - Main.cpp MalformedGeoms.cpp Network.cpp \ + Main.cpp MalformedGeoms.cpp \ Objects.cpp QueryView.cpp QueryViewComposer.cpp \ ResultSetView.cpp Shapefiles.cpp TableTree.cpp \ TextCsv.cpp Wfs.cpp Raster.cpp Styles.cpp \ RasterSymbolizers.cpp VectorSymbolizers1.cpp \ VectorSymbolizers2.cpp SqlFiltersComposer.cpp \ MapPanel.cpp MapView.cpp LayerTree.cpp \ - QuickStyles.cpp + QuickStylesVector.cpp QuickStylesTopology.cpp \ + QuickStylesRaster.cpp HtmlHelp.cpp Postgres.cpp LDADD = @WX_LIBS@ @LIBSPATIALITE_LIBS@ \ - @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ @LIBXML2_LIBS@ -lgeos_c + @LIBRASTERLITE2_LIBS@ @LIBFREEXL_LIBS@ \ + @LIBVIRTUALPG_LIBS@ @LIBXML2_LIBS@ \ + @PG_LDFLAGS@ @PG_LIB@ -lgeos_c -EXTRA_DIST = Makefile-static-MinGW \ - Makefile-static-mingw32 \ - Makefile-static-mingw64 \ - Makefile-static-Linux \ - Makefile-static-MacOsX \ - indent_me +EXTRA_DIST = Makefile-static-mingw32 \ + Makefile-static-mingw64 \ + helpgen/helpgen.c \ + helpgen/READ_ME.txt \ + indent_me AUTOMAKE_OPTIONS = dist-zip foreign SUBDIRS = icons win_resource mac_resource gnome_resource all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -549,20 +559,23 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BlobExplorer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dialogs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialogsGraph.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exif.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HtmlHelp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LayerTree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MalformedGeoms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MapPanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MapView.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Network.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Objects.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Postgres.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryView.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QueryViewComposer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStyles.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesRaster.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesTopology.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QuickStylesVector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Raster.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RasterSymbolizers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResultSetView.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shapefiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SqlFiltersComposer.Po@am__quote@ Index: MalformedGeoms.cpp ================================================================== --- MalformedGeoms.cpp +++ MalformedGeoms.cpp @@ -2,11 +2,11 @@ / MalformedGeoms.cpp / identifying malformed geometries / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by Index: MapPanel.cpp ================================================================== --- MapPanel.cpp +++ MapPanel.cpp @@ -2,11 +2,11 @@ / MapPanel.cpp / the Map Panel of spatialite_gui - a SQLite /SpatiaLite GUI tool / / version 2.0, 2017 January 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2017 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -33,25 +33,17 @@ #include #include "icons/icon_map.xpm" #include "icons/linestrings_on.xpm" -#include "icons/linestrings_off.xpm" #include "icons/points_on.xpm" -#include "icons/points_off.xpm" #include "icons/polygons_on.xpm" -#include "icons/polygons_off.xpm" #include "icons/vector.xpm" -#include "icons/vector_off.xpm" #include "icons/topo_geo.xpm" -#include "icons/topo_geo_off.xpm" #include "icons/topo_net.xpm" -#include "icons/topo_net_off.xpm" #include "icons/coverage.xpm" -#include "icons/coverage_off.xpm" #include "icons/wms.xpm" -#include "icons/wms_off.xpm" #include "icons/icon_info.xpm" #include "icons/map_add.xpm" #include "icons/map_table.xpm" #include "icons/identify.xpm" #include "icons/zoom_in.xpm" @@ -784,10 +776,11 @@ wxBitmap bmp; switch (pL->GetLayerType()) { case MAP_LAYER_VECTOR: case MAP_LAYER_VECTOR_VIEW: + case MAP_LAYER_VECTOR_SHP: switch (pL->GetGeometryType()) { case 1: case 1001: case 2001: @@ -841,11 +834,13 @@ }; renderer->SetGraphic(bmp); Layers->SetCellValue(count, 0, pL->GetDbPrefix()); Layers->SetCellTextColour(count, 0, color); Layers->SetCellRenderer(count, 1, renderer); - if (pL->GetLayerType() == MAP_LAYER_VECTOR) + if (pL->GetLayerType() == MAP_LAYER_VECTOR + || pL->GetLayerType() == MAP_LAYER_VECTOR_VIEW + || pL->GetLayerType() == MAP_LAYER_VECTOR_SHP) { wxString prefixName = pL->GetLayerPrefix(); prefixName += wxT("."); prefixName += pL->GetLayerName(); Layers->SetCellValue(count, 2, prefixName); @@ -2595,11 +2590,13 @@ boxSizer->Add(nameSizer, 0, wxALIGN_RIGHT | wxALL, 0); wxStaticText *nameLabel = new wxStaticText(this, wxID_STATIC, wxT("&Full Name:")); nameSizer->Add(nameLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxString name = Layer->GetDbPrefix(); - if (Layer->GetType() == MAP_LAYER_VECTOR) + if (Layer->GetType() == MAP_LAYER_VECTOR + || Layer->GetType() == MAP_LAYER_VECTOR_VIEW + || Layer->GetType() == MAP_LAYER_VECTOR_SHP) name += wxT(".") + Layer->GetVectorPrefix(); name += wxT(".") + Layer->GetName(); wxTextCtrl *nameCtrl = new wxTextCtrl(this, ID_MAPLAYER_NAME, name, wxDefaultPosition, wxSize(550, 22), wxTE_READONLY); @@ -2663,10 +2660,12 @@ case MAP_LAYER_WMS: datasource = wxT("WMS Layer GetMap URL:\n"); datasource += wxString::FromUTF8(Layer->GetWmsGetMapURL()); break; case MAP_LAYER_VECTOR: + case MAP_LAYER_VECTOR_VIEW: + case MAP_LAYER_VECTOR_SHP: datasource = wxT("Vector Coverage\n"); datasource += wxT("SpatiaLite "); if (Layer->GetVectorPrefix().IsSameAs(wxT("table")) == true) datasource += wxT("GeoTable: ") + wxString::FromUTF8(Layer->GetTableName()) + @@ -3760,10 +3759,11 @@ CachedLinks = new CachedFrame(); CachedLinkSeeds = new CachedFrame(); } QuickStyle = NULL; QuickStyleTopology = NULL; + QuickStyleRaster = NULL; Prev = NULL; Next = NULL; } MapLayer::~MapLayer() @@ -3813,10 +3813,12 @@ delete CachedFaceSeeds; if (QuickStyle != NULL) delete QuickStyle; if (QuickStyleTopology != NULL) delete QuickStyleTopology; + if (QuickStyleRaster != NULL) + delete QuickStyleRaster; } void MapLayer::Invalidate() { // @@ -3888,10 +3890,38 @@ return true; } } return false; } + +bool MapLayer::UpdateQuickStyle(QuickStyleRasterObj * style) +{ +// +// updating the current Quick Syle +// + bool ret; + if (QuickStyleRaster == NULL) + { + QuickStyleRaster = style->Clone(); + QuickStyleRaster->UpdateXmlStyle(); + Invalidate(); + return true; + } else + { + ret = style->Compare(QuickStyleRaster); + if (ret == false) + { + if (QuickStyleRaster != NULL) + delete QuickStyleRaster; + QuickStyleRaster = style->Clone(); + QuickStyleRaster->UpdateXmlStyle(); + Invalidate(); + return true; + } + } + return false; +} void MapLayer::PrepareGraphicsContext(int width, int height, double minx, double miny, double maxx, double maxy, const char *style) { @@ -3928,11 +3958,12 @@ CachedLinks->Reset(width, height, minx, miny, maxx, maxy, style); if (CachedLinkSeeds->IsValid(width, height, minx, miny, maxx, maxy, style) != true) CachedLinkSeeds->Reset(width, height, minx, miny, maxx, maxy, style); } - if (Type == MAP_LAYER_VECTOR || Type == MAP_LAYER_TOPOLOGY + if (Type == MAP_LAYER_VECTOR || Type == MAP_LAYER_VECTOR_VIEW + || Type == MAP_LAYER_VECTOR_SHP || Type == MAP_LAYER_TOPOLOGY || Type == MAP_LAYER_NETWORK) { // Labels if (CachedLabels->IsValid(width, height, minx, miny, maxx, maxy, style) != true) Index: MapView.cpp ================================================================== --- MapView.cpp +++ MapView.cpp @@ -2,11 +2,11 @@ / MapView.cpp / the Map View of spatialite_gui - a SQLite /SpatiaLite GUI tool / / version 2.0, 2017 January 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2017 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -201,10 +201,24 @@ // // this window has changed its size // PrepareMap(); } + +int MyMapView::GetImageWidth() +{ +// will return the current image Width + wxSize sz = GetClientSize(); + return sz.GetWidth(); +} + +int MyMapView::GetImageHeight() +{ +// will return the current image Width + wxSize sz = GetClientSize(); + return sz.GetHeight(); +} void MyMapView::OnPaint(wxPaintEvent & WXUNUSED(event)) { // // this window needs to be repainted @@ -542,10 +556,30 @@ MapPanel->UpdateMapScale(); MapPanel->UpdateMapCoords(coords); MapPanel->UpdateMapSRID(); } + +void MyMapView::DoPrepareBBox(wxString & bbox) +{ +// preparing the current frame BBOX + char *buf = + sqlite3_mprintf("BuildMBR(%f, %f, %f, %f, %d), ", FrameMinX, FrameMinY, + FrameMaxX, FrameMaxY, MapSRID); + bbox = wxString::FromUTF8(buf); + sqlite3_free(buf); +} + +void MyMapView::GetBBox(int *srid, double *minx, double *miny, double *maxx, double *maxy) +{ +// returning the current fram BBOX +*srid = MapSRID; + *minx = FrameMinX; + *miny = FrameMinY; + *maxx = FrameMaxX; + *maxy = FrameMaxY; +} void MyMapView::Invalidate() { // resetting to initial state ValidMap = false; @@ -2311,11 +2345,11 @@ } #endif lyr->IncrementRetryCount(); view->DoPaintLayer(lyr); - mother->ReleaseThread(index, lyr); + mother->ReleaseThread(index); lyr->SetLocked(false); if (lyr->IsReady() == true) { canvas->SetChanged(true); wxCommandEvent evt_step(wxEVT_COMMAND_BUTTON_CLICKED, ID_PAINT_MAP_STEP); @@ -2867,19 +2901,31 @@ int len; rl2CanvasPtr canvas; sqlite3_stmt *stmt = NULL; const char *sql; int ret; + unsigned char *quickStyle = NULL; if (lyr == NULL) return; layer = lyr->GetLayer(); if (layer == NULL) return; config = layer->GetRasterConfig(); if (config == NULL) return; + +// attempting to apply a QuickStyle + if (layer->GetQuickStyleRaster() != NULL) + { + if (strcasecmp + (layer->GetQuickStyleRaster()->GetUUID(), config->GetStyle()) == 0) + { + // applying the Quick Style + quickStyle = layer->GetQuickStyleRaster()->CloneXmlStyle(); + } + } wxString prefix = layer->GetDbPrefix(); len = prefix.Len(); if (len == 0) db_prefix = NULL; @@ -2927,11 +2973,11 @@ canvas = layer->CreateCanvas(); rl2_map_image_paint_from_raster(MapPanel->GetSqlite(), MapPanel->GetRL2PrivateData(), canvas, db_prefix, layer_name, blob, blob_sz, - config->GetStyle()); + config->GetStyle(), quickStyle); layer->Validate(canvas); rl2_destroy_canvas(canvas); } } } @@ -3047,11 +3093,11 @@ canvas = layer->CreateCanvas(); const void *data = MapPanel->GetRL2PrivateData(); if (layer->GetType() == MAP_LAYER_TOPOLOGY) rl2_map_image_paint_from_vector_ex(MapPanel->GetSqlite(), data, canvas, db_prefix, - layer_name, blob, blob_sz, + layer_name, blob, blob_sz, 0, styleName, quickStyle, config->AreNodesVisible(), config->AreEdgesVisible(), config->AreFacesVisible(), config->AreEdgeSeedsVisible @@ -3059,20 +3105,20 @@ config->AreFaceSeedsVisible ()); else if (layer->GetType() == MAP_LAYER_NETWORK) rl2_map_image_paint_from_vector_ex(MapPanel->GetSqlite(), data, canvas, db_prefix, - layer_name, blob, blob_sz, + layer_name, blob, blob_sz, 0, styleName, quickStyle, config->AreNodesVisible(), config->AreLinksVisible(), 0, config->AreLinkSeedsVisible (), 0); else rl2_map_image_paint_from_vector(MapPanel->GetSqlite(), data, canvas, db_prefix, layer_name, - blob, blob_sz, + blob, blob_sz, 0, styleName, quickStyle); layer->Validate(canvas); rl2_destroy_canvas(canvas); } } @@ -3286,11 +3332,11 @@ // updating the Screen wxImage img = wxImage(FrameWidth, FrameHeight); img.SetData(rgb, false); img.SetAlpha(alpha, false); - BlinkBitmap = img; + BlinkBitmap = wxBitmap(img); DynamicBlink = true; ResetScreenBitmap(); DynamicBlink = false; } @@ -3343,11 +3389,10 @@ void MyMapView::RebuildLayerTree(MyLayerTree * LayerTree) { // // rebuilding from scratch the Map Layers Tree // - MapLayerObject *obj; wxTreeItemId layer; ::wxBeginBusyCursor(); LayerTree->Hide(); LayerTree->DeleteChildren(LayerTree->GetRoot()); @@ -4486,11 +4531,11 @@ } } return -1; } -void MapViewPaintParams::ReleaseThread(int index, SingleLayerPainter * lyr) +void MapViewPaintParams::ReleaseThread(int index) { // releasing a Thread slot if (UnusedThreads == NULL) return; if (index >= 0 && index < NumThreads) DELETED Network.cpp Index: Network.cpp ================================================================== --- Network.cpp +++ Network.cpp @@ -1,2682 +0,0 @@ -/* -/ Network.cpp -/ methods related to Network building -/ -/ version 1.7, 2013 May 8 -/ -/ Author: Sandro Furieri a-furieri@lqt.it -/ -/ Copyright (C) 2008-2013 Alessandro Furieri -/ -/ This program is free software: you can redistribute it and/or modify -/ it under the terms of the GNU General Public License as published by -/ the Free Software Foundation, either version 3 of the License, or -/ (at your option) any later version. -/ -/ This program is distributed in the hope that it will be useful, -/ but WITHOUT ANY WARRANTY; without even the implied warranty of -/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/ GNU General Public License for more details. -/ -/ You should have received a copy of the GNU General Public License -/ along with this program. If not, see . -/ -*/ - -#include "Classdef.h" -#include - -#if defined(_WIN32) && !defined(__MINGW32__) -#define strcasecmp _stricmp -#endif - -#define MAX_BLOCK 1048576 - -void - MyFrame::BuildNetwork(wxString & table, wxString & from, wxString & to, - bool isNoGeometry, wxString & geometry, wxString & name, - bool cost_length, wxString & cost, bool bidirectional, - bool one_way, wxString & one_way_from_to, - wxString & one_way_to_from, bool aStarSupported, - wxString & dataTableName, wxString & virtualTableName) -{ -// -// trying to build a Network -// - int ret; - sqlite3_stmt *stmt; - Network *p_graph = NULL; - wxString sql; - char xsql[2048]; - char **results; - int n_rows; - int n_columns; - int i; - char *errMsg = NULL; - char *col_name; - int type; - bool ok_from_column = false; - bool ok_to_column = false; - bool ok_cost_column = false; - bool ok_geom_column = false; - bool ok_name_column = false; - bool ok_oneway_tofrom = false; - bool ok_oneway_fromto = false; - bool from_null = false; - bool from_int = false; - bool from_double = false; - bool from_text = false; - bool from_blob = false; - bool to_null = false; - bool to_int = false; - bool to_double = false; - bool to_text = false; - bool to_blob = false; - bool cost_null = false; - bool cost_text = false; - bool cost_blob = false; - bool tofrom_null = false; - bool tofrom_double = false; - bool tofrom_text = false; - bool tofrom_blob = false; - bool fromto_null = false; - bool fromto_double = false; - bool fromto_text = false; - bool fromto_blob = false; - bool geom_null = false; - bool geom_not_linestring = false; - int col_n; - int fromto_n = 0; - int tofrom_n = 0; - sqlite3_int64 rowid; - sqlite3_int64 id_from = -1; - sqlite3_int64 id_to = -1; - char code_from[1024]; - char code_to[1024]; - double node_from_x; - double node_from_y; - double node_to_x; - double node_to_y; - double cost_val; - int fromto; - int tofrom; - wxString endMsg; - wxString msg; - bool wr; - bool aStarLength; - double a_star_length; - double a_star_coeff; - double min_a_star_coeff = DBL_MAX; - char *xname; - char *xname2; - - if (isNoGeometry == true) - { - BuildNetwork(table, from, to, name, cost, bidirectional, one_way, - one_way_from_to, one_way_to_from, dataTableName, - virtualTableName); - return; - } - - ::wxBeginBusyCursor(); -// checking for table existence - sql = - wxT("SELECT tbl_name FROM sqlite_master WHERE Lower(tbl_name) = Lower('"); - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaSingleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2); - free(xname2); - sql += wxT("') AND type = 'table'"); - strcpy(xsql, sql.ToUTF8()); - ret = - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, - &errMsg); - if (ret != SQLITE_OK) - { -// some error occurred - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (n_rows == 0) - { - // required table does not exists - wxMessageBox(wxT("ERROR: table ") + table + wxT(" does not exists"), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - goto abort; - } else - sqlite3_free_table(results); -// checking for columns existence - sql = wxT("PRAGMA table_info("); - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(")"); - strcpy(xsql, sql.ToUTF8()); - ret = - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, - &errMsg); - if (ret != SQLITE_OK) - { -// some error occurred - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (n_rows > 1) - { - for (i = 1; i <= n_rows; i++) - { - char xcol[256]; - col_name = results[(i * n_columns) + 1]; - strcpy(xcol, from.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_from_column = true; - strcpy(xcol, to.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_to_column = true; - if (cost_length == false) - { - strcpy(xcol, cost.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_cost_column = true; - } - strcpy(xcol, geometry.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_geom_column = true; - if (name.Len() > 0) - { - strcpy(xcol, name.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_name_column = true; - } - if (one_way == true) - { - strcpy(xcol, one_way_from_to.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_oneway_tofrom = true; - } - if (one_way == true) - { - strcpy(xcol, one_way_to_from.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_oneway_fromto = true; - } - } - sqlite3_free_table(results); - } - if (ok_from_column == true && ok_to_column == true && ok_geom_column == true) - ; - else - goto abort; - if (name.Len() > 0 && ok_name_column == false) - goto abort; - if (cost_length == false && ok_cost_column == false) - goto abort; - if (one_way == true && ok_oneway_tofrom == false) - goto abort; - if (one_way == true && ok_oneway_fromto == false) - goto abort; -// checking column types - p_graph = new Network(); - xname = (char *) malloc((from.Len() * 4) + 1); - strcpy(xname, from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("SELECT ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((to.Len() * 4) + 1); - strcpy(xname, to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((geometry.Len() * 4) + 1); - strcpy(xname, geometry.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", GeometryType(") + wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - col_n = 3; - if (cost_length == false) - { - xname = (char *) malloc((cost.Len() * 4) + 1); - strcpy(xname, cost.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - col_n++; - } - if (one_way == true) - { - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); - strcpy(xname, one_way_to_from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - tofrom_n = col_n; - col_n++; - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); - strcpy(xname, one_way_from_to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - fromto_n = col_n; - col_n++; - } - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - n_columns = sqlite3_column_count(stmt); - while (1) - { - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE) - break; - if (ret == SQLITE_ROW) - { - // the NodeFrom type - type = sqlite3_column_type(stmt, 0); - if (type == SQLITE_NULL) - from_null = true; - if (type == SQLITE_INTEGER) - { - from_int = true; - id_from = sqlite3_column_int64(stmt, 0); - p_graph->InsertNode(id_from); - } - if (type == SQLITE_FLOAT) - from_double = true; - if (type == SQLITE_TEXT) - { - from_text = true; - strcpy(code_from, (char *) sqlite3_column_text(stmt, 0)); - p_graph->InsertNode(code_from); - } - if (type == SQLITE_BLOB) - from_blob = true; - // the NodeTo type - type = sqlite3_column_type(stmt, 1); - if (type == SQLITE_NULL) - to_null = true; - if (type == SQLITE_INTEGER) - { - to_int = true; - id_to = sqlite3_column_int64(stmt, 1); - p_graph->InsertNode(id_to); - } - if (type == SQLITE_FLOAT) - to_double = true; - if (type == SQLITE_TEXT) - { - to_text = true; - strcpy(code_to, (char *) sqlite3_column_text(stmt, 1)); - p_graph->InsertNode(code_to); - } - if (type == SQLITE_BLOB) - to_blob = true; - // the Geometry type - type = sqlite3_column_type(stmt, 2); - if (type == SQLITE_NULL) - geom_null = true; - else if (strcmp("LINESTRING", (char *) sqlite3_column_text(stmt, 2)) - != 0) - geom_not_linestring = true; - col_n = 3; - if (cost_length == false) - { - // the Cost type - type = sqlite3_column_type(stmt, col_n); - col_n++; - if (type == SQLITE_NULL) - cost_null = true; - if (type == SQLITE_TEXT) - cost_text = true; - if (type == SQLITE_BLOB) - cost_blob = true; - } - if (one_way == true) - { - // the FromTo type - type = sqlite3_column_type(stmt, col_n); - col_n++; - if (type == SQLITE_NULL) - fromto_null = true; - if (type == SQLITE_FLOAT) - fromto_double = true; - if (type == SQLITE_TEXT) - fromto_text = true; - if (type == SQLITE_BLOB) - fromto_blob = true; - // the ToFrom type - type = sqlite3_column_type(stmt, col_n); - col_n++; - if (type == SQLITE_NULL) - tofrom_null = true; - if (type == SQLITE_FLOAT) - tofrom_double = true; - if (type == SQLITE_TEXT) - tofrom_text = true; - if (type == SQLITE_BLOB) - tofrom_blob = true; - } - } else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); - ret = 1; - if (from_null == true) - ret = 0; - if (from_blob == true) - ret = 0; - if (from_double == true) - ret = 0; - if (to_null == true) - ret = 0; - if (to_blob == true) - ret = 0; - if (to_double == true) - ret = 0; - if (geom_null == true) - ret = 0; - if (geom_not_linestring == true) - ret = 0; - if (cost_length == false) - { - if (cost_null == true) - ret = 0; - if (cost_blob == true) - ret = 0; - if (cost_text == true) - ret = 0; - } - if (one_way == true) - { - if (fromto_null == true) - ret = 0; - if (fromto_blob == true) - ret = 0; - if (fromto_text == true) - ret = 0; - if (fromto_double == true) - ret = 0; - if (tofrom_null == true) - ret = 0; - if (tofrom_blob == true) - ret = 0; - if (tofrom_text == true) - ret = 0; - if (tofrom_double == true) - ret = 0; - } - if (!ret) - goto abort; - if (from_int == true && to_int == true) - { - // each node is identified by an INTEGER id - p_graph->SetNodeCode(false); - } else if (from_text == true && to_text == true) - { - // each node is identified by a TEXT code - p_graph->SetNodeCode(true); - } else - goto abort; - p_graph->InitNodes(); -// checking topologic consistency - xname = (char *) malloc((from.Len() * 4) + 1); - strcpy(xname, from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("SELECT ROWID, ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((to.Len() * 4) + 1); - strcpy(xname, to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2) + wxT(", "); - free(xname2); - xname = (char *) malloc((geometry.Len() * 4) + 1); - strcpy(xname, geometry.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += - wxT("X(StartPoint(") + wxString::FromUTF8(xname2) + - wxT(")), Y(StartPoint("); - sql += wxString::FromUTF8(xname2) + wxT(")), "); - sql += - wxT("X(EndPoint(") + wxString::FromUTF8(xname2) + wxT(")), Y(EndPoint("); - sql += wxString::FromUTF8(xname2) + wxT("))"); - free(xname2); - if (aStarSupported == true) - { - // supporting A* algorithm - if (cost_length == false) - { - xname = (char *) malloc((cost.Len() * 4) + 1); - strcpy(xname, cost.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((geometry.Len() * 4) + 1); - strcpy(xname, geometry.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - col_n = 9; - aStarLength = true; - } else - { - xname = (char *) malloc((geometry.Len() * 4) + 1); - strcpy(xname, geometry.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - col_n = 9; - aStarLength = false; - min_a_star_coeff = 1.0; - } - } else - { - // A* algorithm unsupported - if (cost_length == false) - { - xname = (char *) malloc((cost.Len() * 4) + 1); - strcpy(xname, cost.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - col_n = 8; - } else - { - xname = (char *) malloc((geometry.Len() * 4) + 1); - strcpy(xname, geometry.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", GLength(") + wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - col_n = 9; - } - aStarLength = false; - } - if (one_way == true) - { - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); - strcpy(xname, one_way_to_from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - tofrom_n = col_n; - col_n++; - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); - strcpy(xname, one_way_from_to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - fromto_n = col_n; - col_n++; - } - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - n_columns = sqlite3_column_count(stmt); - while (1) - { - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE) - break; - if (ret == SQLITE_ROW) - { - fromto = true; - tofrom = true; - if (p_graph->IsNodeCode() == true) - { - id_from = -1; - id_to = -1; - } else - { - *code_from = '\0'; - *code_to = '\0'; - } - // fetching the ROWID - rowid = sqlite3_column_int64(stmt, 0); - // fetching the NodeFrom value - if (p_graph->IsNodeCode() == true) - strcpy(code_from, (char *) sqlite3_column_text(stmt, 1)); - else - id_from = sqlite3_column_int64(stmt, 1); - // fetching the NodeTo value - if (p_graph->IsNodeCode() == true) - strcpy(code_to, (char *) sqlite3_column_text(stmt, 2)); - else - id_to = sqlite3_column_int64(stmt, 2); - // fetching the NodeFromX value - node_from_x = sqlite3_column_double(stmt, 3); - // fetching the NodeFromY value - node_from_y = sqlite3_column_double(stmt, 4); - // fetching the NodeFromX value - node_to_x = sqlite3_column_double(stmt, 5); - // fetching the NodeFromY value - node_to_y = sqlite3_column_double(stmt, 6); - // fetching the Cost value - cost_val = sqlite3_column_double(stmt, 7); - if (one_way == true) - { - // fetching the OneWay-FromTo value - fromto = sqlite3_column_int(stmt, fromto_n); - // fetching the OneWay-ToFrom value - tofrom = sqlite3_column_int(stmt, tofrom_n); - } - if (cost_val <= 0.0) - p_graph->SetError(); - if (aStarLength == true) - { - // supporting A* - fetching the arc length - a_star_length = sqlite3_column_double(stmt, 8); - a_star_coeff = cost_val / a_star_length; - if (a_star_coeff < min_a_star_coeff) - min_a_star_coeff = a_star_coeff; - } - if (bidirectional == true) - { - if (fromto) - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_from, code_to, node_from_x, - node_from_y, node_to_x, node_to_y, - cost_val); - else - p_graph->AddArc(rowid, id_from, id_to, node_from_x, - node_from_y, node_to_x, node_to_y, - cost_val); - } - if (tofrom) - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_to, code_from, node_to_x, - node_to_y, node_from_x, node_from_y, - cost_val); - else - p_graph->AddArc(rowid, id_to, id_from, node_to_x, node_to_y, - node_from_x, node_from_y, cost_val); - } - } else - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_from, code_to, node_from_x, - node_from_y, node_to_x, node_to_y, cost_val); - else - p_graph->AddArc(rowid, id_from, id_to, node_from_x, node_from_y, - node_to_x, node_to_y, cost_val); - } - if (p_graph->IsError() == true) - { - sqlite3_finalize(stmt); - goto abort; - } - } else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); - ::wxEndBusyCursor(); - wr = - CreateNetwork(p_graph, table, from, to, geometry, name, - aStarSupported, min_a_star_coeff, dataTableName, - virtualTableName); - if (wr == true) - { - endMsg = - wxT("OK: VirtualNetwork table '") + table + - wxT("_net' successfully created"); - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, - this); - } else - { - endMsg = - wxT("DB ERROR: VirtualNetwork table '") + table + - wxT("_net' was not created"); - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - } - if (p_graph) - delete p_graph; - InitTableTree(); - return; -abort: - ::wxEndBusyCursor(); - msg = - wxT - ("It's impossible to build a Network using the given configuration;\nsome fatal error occurred\n\n"); - msg += wxT("please note: using the 'spatialite_network' command-line tool\n"); - msg += - wxT - ("you can obtain a full detailed report explaining causes for this failure"); - wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - if (p_graph) - delete p_graph; -} - -void - MyFrame::BuildNetwork(wxString & table, wxString & from, wxString & to, - wxString & name, wxString & cost, bool bidirectional, - bool one_way, wxString & one_way_from_to, - wxString & one_way_to_from, wxString & dataTableName, - wxString & virtualTableName) -{ -// -// trying to build a Network - NO-GEOMETRY -// - int ret; - sqlite3_stmt *stmt; - Network *p_graph = NULL; - wxString sql; - char xsql[2048]; - char **results; - int n_rows; - int n_columns; - int i; - char *errMsg = NULL; - char *col_name; - int type; - bool ok_from_column = false; - bool ok_to_column = false; - bool ok_cost_column = false; - bool ok_name_column = false; - bool ok_oneway_tofrom = false; - bool ok_oneway_fromto = false; - bool from_null = false; - bool from_int = false; - bool from_double = false; - bool from_text = false; - bool from_blob = false; - bool to_null = false; - bool to_int = false; - bool to_double = false; - bool to_text = false; - bool to_blob = false; - bool cost_null = false; - bool cost_text = false; - bool cost_blob = false; - bool tofrom_null = false; - bool tofrom_double = false; - bool tofrom_text = false; - bool tofrom_blob = false; - bool fromto_null = false; - bool fromto_double = false; - bool fromto_text = false; - bool fromto_blob = false; - int col_n; - int fromto_n = 0; - int tofrom_n = 0; - sqlite3_int64 rowid; - sqlite3_int64 id_from = -1; - sqlite3_int64 id_to = -1; - char code_from[1024]; - char code_to[1024]; - double cost_val; - int fromto; - int tofrom; - wxString endMsg; - wxString msg; - bool wr; - char *xname; - char *xname2; - - ::wxBeginBusyCursor(); -// checking for table existence - sql = - wxT("SELECT tbl_name FROM sqlite_master WHERE Lower(tbl_name) = Lower('"); - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaSingleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2); - free(xname2); - sql += wxT("') AND type = 'table'"); - strcpy(xsql, sql.ToUTF8()); - ret = - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, - &errMsg); - if (ret != SQLITE_OK) - { -// some error occurred - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (n_rows == 0) - { - // required table does not exists - wxMessageBox(wxT("ERROR: table ") + table + wxT(" does not exists"), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - goto abort; - } else - sqlite3_free_table(results); -// checking for columns existence - sql = wxT("PRAGMA table_info("); - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(")"); - strcpy(xsql, sql.ToUTF8()); - ret = - sqlite3_get_table(SqliteHandle, xsql, &results, &n_rows, &n_columns, - &errMsg); - if (ret != SQLITE_OK) - { -// some error occurred - wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (n_rows > 1) - { - for (i = 1; i <= n_rows; i++) - { - char xcol[256]; - col_name = results[(i * n_columns) + 1]; - strcpy(xcol, from.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_from_column = true; - strcpy(xcol, to.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_to_column = true; - strcpy(xcol, cost.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_cost_column = true; - if (name.Len() > 0) - { - strcpy(xcol, name.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_name_column = true; - } - if (one_way == true) - { - strcpy(xcol, one_way_from_to.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_oneway_tofrom = true; - } - if (one_way == true) - { - strcpy(xcol, one_way_to_from.ToUTF8()); - if (strcasecmp(xcol, col_name) == 0) - ok_oneway_fromto = true; - } - } - sqlite3_free_table(results); - } - if (ok_from_column == true && ok_to_column == true) - ; - else - goto abort; - if (name.Len() > 0 && ok_name_column == false) - goto abort; - if (ok_cost_column == false) - goto abort; - if (one_way == true && ok_oneway_tofrom == false) - goto abort; - if (one_way == true && ok_oneway_fromto == false) - goto abort; -// checking column types - p_graph = new Network(); - xname = (char *) malloc((from.Len() * 4) + 1); - strcpy(xname, from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("SELECT ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((to.Len() * 4) + 1); - strcpy(xname, to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((cost.Len() * 4) + 1); - strcpy(xname, cost.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - col_n = 3; - if (one_way == true) - { - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); - strcpy(xname, one_way_to_from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - tofrom_n = col_n; - col_n++; - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); - strcpy(xname, one_way_from_to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - fromto_n = col_n; - col_n++; - } - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - n_columns = sqlite3_column_count(stmt); - while (1) - { - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE) - break; - if (ret == SQLITE_ROW) - { - // the NodeFrom type - type = sqlite3_column_type(stmt, 0); - if (type == SQLITE_NULL) - from_null = true; - if (type == SQLITE_INTEGER) - { - from_int = true; - id_from = sqlite3_column_int64(stmt, 0); - p_graph->InsertNode(id_from); - } - if (type == SQLITE_FLOAT) - from_double = true; - if (type == SQLITE_TEXT) - { - from_text = true; - strcpy(code_from, (char *) sqlite3_column_text(stmt, 0)); - p_graph->InsertNode(code_from); - } - if (type == SQLITE_BLOB) - from_blob = true; - // the NodeTo type - type = sqlite3_column_type(stmt, 1); - if (type == SQLITE_NULL) - to_null = true; - if (type == SQLITE_INTEGER) - { - to_int = true; - id_to = sqlite3_column_int64(stmt, 1); - p_graph->InsertNode(id_to); - } - if (type == SQLITE_FLOAT) - to_double = true; - if (type == SQLITE_TEXT) - { - to_text = true; - strcpy(code_to, (char *) sqlite3_column_text(stmt, 1)); - p_graph->InsertNode(code_to); - } - if (type == SQLITE_BLOB) - to_blob = true; - // the Cost type - type = sqlite3_column_type(stmt, 2); - if (type == SQLITE_NULL) - cost_null = true; - if (type == SQLITE_TEXT) - cost_text = true; - if (type == SQLITE_BLOB) - cost_blob = true; - col_n = 3; - if (one_way == true) - { - // the FromTo type - type = sqlite3_column_type(stmt, col_n); - col_n++; - if (type == SQLITE_NULL) - fromto_null = true; - if (type == SQLITE_FLOAT) - fromto_double = true; - if (type == SQLITE_TEXT) - fromto_text = true; - if (type == SQLITE_BLOB) - fromto_blob = true; - // the ToFrom type - type = sqlite3_column_type(stmt, col_n); - col_n++; - if (type == SQLITE_NULL) - tofrom_null = true; - if (type == SQLITE_FLOAT) - tofrom_double = true; - if (type == SQLITE_TEXT) - tofrom_text = true; - if (type == SQLITE_BLOB) - tofrom_blob = true; - } - } else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); - ret = 1; - if (from_null == true) - ret = 0; - if (from_blob == true) - ret = 0; - if (from_double == true) - ret = 0; - if (to_null == true) - ret = 0; - if (to_blob == true) - ret = 0; - if (to_double == true) - ret = 0; - if (cost_null == true) - ret = 0; - if (cost_blob == true) - ret = 0; - if (cost_text == true) - ret = 0; - if (one_way == true) - { - if (fromto_null == true) - ret = 0; - if (fromto_blob == true) - ret = 0; - if (fromto_text == true) - ret = 0; - if (fromto_double == true) - ret = 0; - if (tofrom_null == true) - ret = 0; - if (tofrom_blob == true) - ret = 0; - if (tofrom_text == true) - ret = 0; - if (tofrom_double == true) - ret = 0; - } - if (!ret) - goto abort; - if (from_int == true && to_int == true) - { - // each node is identified by an INTEGER id - p_graph->SetNodeCode(false); - } else if (from_text == true && to_text == true) - { - // each node is identified by a TEXT code - p_graph->SetNodeCode(true); - } else - goto abort; - p_graph->InitNodes(); -// checking topological consistency - xname = (char *) malloc((from.Len() * 4) + 1); - strcpy(xname, from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("SELECT ROWID, ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((to.Len() * 4) + 1); - strcpy(xname, to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - xname = (char *) malloc((cost.Len() * 4) + 1); - strcpy(xname, cost.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - col_n = 4; - if (one_way == true) - { - xname = (char *) malloc((one_way_to_from.Len() * 4) + 1); - strcpy(xname, one_way_to_from.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - tofrom_n = col_n; - col_n++; - xname = (char *) malloc((one_way_from_to.Len() * 4) + 1); - strcpy(xname, one_way_from_to.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(", ") + wxString::FromUTF8(xname2); - free(xname2); - fromto_n = col_n; - col_n++; - } - xname = (char *) malloc((table.Len() * 4) + 1); - strcpy(xname, table.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxT(" FROM ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("SQL error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - n_columns = sqlite3_column_count(stmt); - while (1) - { - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE) - break; - if (ret == SQLITE_ROW) - { - fromto = true; - tofrom = true; - if (p_graph->IsNodeCode() == true) - { - id_from = -1; - id_to = -1; - } else - { - *code_from = '\0'; - *code_to = '\0'; - } - // fetching the ROWID - rowid = sqlite3_column_int64(stmt, 0); - // fetching the NodeFrom value - if (p_graph->IsNodeCode() == true) - strcpy(code_from, (char *) sqlite3_column_text(stmt, 1)); - else - id_from = sqlite3_column_int64(stmt, 1); - // fetching the NodeTo value - if (p_graph->IsNodeCode() == true) - strcpy(code_to, (char *) sqlite3_column_text(stmt, 2)); - else - id_to = sqlite3_column_int64(stmt, 2); - // fetching the Cost value - cost_val = sqlite3_column_double(stmt, 3); - if (one_way == true) - { - // fetching the OneWay-FromTo value - fromto = sqlite3_column_int(stmt, fromto_n); - // fetching the OneWay-ToFrom value - tofrom = sqlite3_column_int(stmt, tofrom_n); - } - if (cost_val <= 0.0) - p_graph->SetError(); - if (bidirectional == true) - { - if (fromto) - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_from, code_to, cost_val); - else - p_graph->AddArc(rowid, id_from, id_to, cost_val); - } - if (tofrom) - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_to, code_from, cost_val); - else - p_graph->AddArc(rowid, id_to, id_from, cost_val); - } - } else - { - if (p_graph->IsNodeCode() == true) - p_graph->AddArc(rowid, code_from, code_to, cost_val); - else - p_graph->AddArc(rowid, id_from, id_to, cost_val); - } - if (p_graph->IsError() == true) - { - sqlite3_finalize(stmt); - goto abort; - } - } else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); - ::wxEndBusyCursor(); - wr = - CreateNetwork(p_graph, table, from, to, name, dataTableName, - virtualTableName); - if (wr == true) - { - endMsg = - wxT("OK: VirtualNetwork table '") + table + - wxT("_net' successfully created"); - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, - this); - } else - { - endMsg = - wxT("DB ERROR: VirtualNetwork table '") + table + - wxT("_net' was not created"); - wxMessageBox(endMsg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - } - if (p_graph) - delete p_graph; - InitTableTree(); - return; -abort: - ::wxEndBusyCursor(); - msg = - wxT - ("It's impossible to build a Network using the given configuration;\nsome fatal error occurred\n\n"); - msg += wxT("please note: using the 'spatialite_network' command-line tool\n"); - msg += - wxT - ("you can obtain a full detailed report explaining causes for this failure"); - wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - if (p_graph) - delete p_graph; -} - -void - MyFrame::OutputNetNode(unsigned char *auxbuf, int *size, int ind, - bool node_code, int max_node_length, NetNode * pN, - int endian_arch, bool aStarSupported) -{ -// -// exporting a Node into NETWORK-DATA -// - int n_star; - int i; - NetArc **arc_array; - NetArc *pA; - unsigned char *out = auxbuf; - *out++ = GAIA_NET_NODE; - gaiaExport32(out, ind, 1, endian_arch); // the Node internal index - out += 4; - if (node_code) - { - // Nodes are identified by a TEXT Code - memset(out, '\0', max_node_length); - strcpy((char *) out, pN->GetCode().ToUTF8()); - out += max_node_length; - } else - { - // Nodes are identified by an INTEGER Id - gaiaExportI64(out, pN->GetId(), 1, endian_arch); - out += 8; - } - if (aStarSupported) - { - // in order to support the A* algorithm [X,Y] are required for each node - gaiaExport64(out, pN->GetX(), 1, endian_arch); - out += 8; - gaiaExport64(out, pN->GetY(), 1, endian_arch); - out += 8; - } - arc_array = pN->PrepareOutcomings(&n_star); - gaiaExport16(out, n_star, 1, endian_arch); // # of outcoming arcs - out += 2; - for (i = 0; i < n_star; i++) - { - // exporting the outcoming arcs - pA = *(arc_array + i); - *out++ = GAIA_NET_ARC; - gaiaExportI64(out, pA->GetRowId(), 1, endian_arch); // the Arc rowid - out += 8; - gaiaExport32(out, pA->GetTo()->GetInternalIndex(), 1, endian_arch); // the ToNode internal index - out += 4; - gaiaExport64(out, pA->GetCost(), 1, endian_arch); // the Arc Cost - out += 8; - *out++ = GAIA_NET_END; - } - if (arc_array) - delete[]arc_array; - *out++ = GAIA_NET_END; - *size = out - auxbuf; -} - -bool MyFrame::CreateNetwork(Network * p_graph, wxString & table, - wxString & from, wxString & to, - wxString & geometry, wxString & name, - bool aStarSupported, double aStarCoeff, - wxString & dataTableName, - wxString & virtualTableName) -{ -// -// creates the NETWORK-DATA table -// - int ret; - wxString sql; - char xsql[1024]; - char *errMsg = NULL; - unsigned char *auxbuf = new unsigned char[MAX_BLOCK]; - unsigned char *buf = new unsigned char[MAX_BLOCK]; - unsigned char *out; - sqlite3_stmt *stmt; - int i; - int size; - int endian_arch = gaiaEndianArch(); - NetNode *pN; - int pk = 0; - int nodes_cnt = 0; - int len; - bool net_data_exists = false; - bool net_exists = false; - bool delete_existing = false; - char *xname; - char *xname2; - net_data_exists = TableAlreadyExists(dataTableName); - net_exists = TableAlreadyExists(virtualTableName); - if (net_data_exists == true || net_exists == true) - { - // asking permission to overwrite existing tables - wxString msg; - if (net_data_exists == true) - msg += - wxT("A table named '") + dataTableName + wxT("' already exists\n"); - if (net_exists == true) - msg += - wxT("A table named '") + virtualTableName + wxT("' already exists\n"); - msg += wxT("\nDo you allow DROPping existing table(s) ?"); - wxMessageDialog confirm(this, msg, wxT("Confirm overwrite"), - wxYES_NO | wxICON_QUESTION); - ret = confirm.ShowModal(); - if (ret == wxID_YES) - delete_existing = true; - } - ::wxBeginBusyCursor(); - for (i = 0; i < p_graph->GetNumNodes(); i++) - { - // setting the internal index to each Node - pN = p_graph->GetSortedNode(i); - pN->SetInternalIndex(i); - } -// starts a transaction - ret = sqlite3_exec(SqliteHandle, "BEGIN", NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("BEGIN error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (delete_existing == true) - { - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); - strcpy(xname, virtualTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - } -// creating the NETWORK-DATA table - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("CREATE TABLE ") + wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(" (Id INTEGER PRIMARY KEY, NetworkData BLOB NOT NULL)"); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("CREATE TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } -// preparing the SQL statement - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = - wxT("INSERT INTO ") + wxString::FromUTF8(xname2) + - wxT(" (Id, NetworkData) VALUES (?, ?)"); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("INSERT error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - if (pk == 0) - { - // preparing the HEADER block - out = buf; - if (aStarSupported) - *out++ = GAIA_NET64_A_STAR_START; - else - *out++ = GAIA_NET64_START; - *out++ = GAIA_NET_HEADER; - gaiaExport32(out, p_graph->GetNumNodes(), 1, endian_arch); // how many Nodes are there - out += 4; - if (p_graph->IsNodeCode() == true) - *out++ = GAIA_NET_CODE; // Nodes are identified by a TEXT code - else - *out++ = GAIA_NET_ID; // Nodes are identified by an INTEGER id - if (p_graph->IsNodeCode() == true) - *out++ = p_graph->GetMaxCodeLength(); // max TEXT code length - else - *out++ = 0x00; - // inserting the main Table name - *out++ = GAIA_NET_TABLE; - len = table.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the Table Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, table.ToUTF8()); - out += len; - // inserting the NodeFrom column name - *out++ = GAIA_NET_FROM; - len = from.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the NodeFrom column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, from.ToUTF8()); - out += len; - // inserting the NodeTo column name - *out++ = GAIA_NET_TO; - len = to.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the NodeTo column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, to.ToUTF8()); - out += len; - // inserting the Geometry column name - *out++ = GAIA_NET_GEOM; - len = geometry.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the Geometry column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, geometry.ToUTF8()); - out += len; - // inserting the Name column name - may be empty - *out++ = GAIA_NET_NAME; - if (name.Len() == 0) - len = 1; - else - len = name.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the Name column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - if (name.Len() > 0) - strcpy((char *) out, name.ToUTF8()); - out += len; - if (aStarSupported) - { - // inserting the A* Heuristic Coeff - *out++ = GAIA_NET_A_STAR_COEFF; - gaiaExport64(out, aStarCoeff, 1, endian_arch); - out += 8; - } - *out++ = GAIA_NET_END; - // INSERTing the Header block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - pk++; - // preparing a new block - out = buf; - *out++ = GAIA_NET_BLOCK; - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block - out += 2; - nodes_cnt = 0; - } - for (i = 0; i < p_graph->GetNumNodes(); i++) - { - // looping on each Node - pN = p_graph->GetSortedNode(i); - OutputNetNode(auxbuf, &size, i, p_graph->IsNodeCode(), - p_graph->GetMaxCodeLength(), pN, endian_arch, - aStarSupported); - if (size >= (MAX_BLOCK - (out - buf))) - { - // inserting the last block - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - pk++; - // preparing a new block - out = buf; - *out++ = GAIA_NET_BLOCK; - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block - out += 2; - nodes_cnt = 0; - } - // inserting the current Node into the block - nodes_cnt++; - memcpy(out, auxbuf, size); - out += size; - } - if (nodes_cnt) - { - // inserting the last block - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); -// creating the VirtualNetwork NET-table - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); - strcpy(xname, virtualTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("CREATE VIRTUAL TABLE ") + wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(" USING VirtualNetwork("); - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("CREATE VIRTUAL TABLE error: ") + - wxString::FromUTF8(errMsg), wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } -// commits the transaction - ret = sqlite3_exec(SqliteHandle, "COMMIT", NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("COMMIT error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (buf) - delete[]buf; - if (auxbuf) - delete[]auxbuf; - ::wxEndBusyCursor(); - return true; -abort: - ::wxEndBusyCursor(); - if (buf) - delete[]buf; - if (auxbuf) - delete[]auxbuf; - return true; - return false; -} - -bool MyFrame::CreateNetwork(Network * p_graph, wxString & table, - wxString & from, wxString & to, wxString & name, - wxString & dataTableName, - wxString & virtualTableName) -{ -// -// creates the NETWORK-DATA table . NO-GEOMETRY -// - int ret; - wxString sql; - char xsql[1024]; - char *errMsg = NULL; - unsigned char *auxbuf = new unsigned char[MAX_BLOCK]; - unsigned char *buf = new unsigned char[MAX_BLOCK]; - unsigned char *out; - sqlite3_stmt *stmt; - int i; - int size; - int endian_arch = gaiaEndianArch(); - NetNode *pN; - int pk = 0; - int nodes_cnt = 0; - int len; - bool net_data_exists = false; - bool net_exists = false; - bool delete_existing = false; - char *xname; - char *xname2; - net_data_exists = TableAlreadyExists(dataTableName); - net_exists = TableAlreadyExists(virtualTableName); - if (net_data_exists == true || net_exists == true) - { - // asking permission to overwrite existing tables - wxString msg; - if (net_data_exists == true) - msg += - wxT("A table named '") + dataTableName + wxT("' already exists\n"); - if (net_exists == true) - msg += - wxT("A table named '") + virtualTableName + wxT("' already exists\n"); - msg += wxT("\nDo you allow DROPping existing table(s) ?"); - wxMessageDialog confirm(this, msg, wxT("Confirm overwrite"), - wxYES_NO | wxICON_QUESTION); - ret = confirm.ShowModal(); - if (ret == wxID_YES) - delete_existing = true; - } - ::wxBeginBusyCursor(); - for (i = 0; i < p_graph->GetNumNodes(); i++) - { - // setting the internal index to each Node - pN = p_graph->GetSortedNode(i); - pN->SetInternalIndex(i); - } -// starts a transaction - ret = sqlite3_exec(SqliteHandle, "BEGIN", NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("BEGIN error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (delete_existing == true) - { - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); - strcpy(xname, virtualTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("DROP TABLE IF EXISTS ") + wxString::FromUTF8(xname2); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("DROP TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - } -// creating the NETWORK-DATA table - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("CREATE TABLE ") + wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(" (Id INTEGER PRIMARY KEY, NetworkData BLOB NOT NULL)"); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("CREATE TABLE error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } -// preparing the SQL statement - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = - wxT("INSERT INTO ") + wxString::FromUTF8(xname2) + - wxT(" (Id, NetworkData) VALUES (?, ?)"); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_prepare_v2(SqliteHandle, xsql, strlen(xsql), &stmt, NULL); - if (ret != SQLITE_OK) - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("INSERT error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - goto abort; - } - if (pk == 0) - { - // preparing the HEADER block - out = buf; - *out++ = GAIA_NET64_START; - *out++ = GAIA_NET_HEADER; - gaiaExport32(out, p_graph->GetNumNodes(), 1, endian_arch); // how many Nodes are there - out += 4; - if (p_graph->IsNodeCode() == true) - *out++ = GAIA_NET_CODE; // Nodes are identified by a TEXT code - else - *out++ = GAIA_NET_ID; // Nodes are identified by an INTEGER id - if (p_graph->IsNodeCode() == true) - *out++ = p_graph->GetMaxCodeLength(); // max TEXT code length - else - *out++ = 0x00; - // inserting the main Table name - *out++ = GAIA_NET_TABLE; - len = table.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the Table Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, table.ToUTF8()); - out += len; - // inserting the NodeFrom column name - *out++ = GAIA_NET_FROM; - len = from.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the NodeFrom column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, from.ToUTF8()); - out += len; - // inserting the NodeTo column name - *out++ = GAIA_NET_TO; - len = to.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the NodeTo column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - strcpy((char *) out, to.ToUTF8()); - out += len; - // inserting the Geometry column name - *out++ = GAIA_NET_GEOM; - len = 1; - gaiaExport16(out, len, 1, endian_arch); // the Geometry column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - out += len; - // inserting the Name column name - may be empty - *out++ = GAIA_NET_NAME; - if (name.Len() == 0) - len = 1; - else - len = name.Len() + 1; - gaiaExport16(out, len, 1, endian_arch); // the Name column Name length, including last '\0' - out += 2; - memset(out, '\0', len); - if (name.Len() > 0) - strcpy((char *) out, name.ToUTF8()); - out += len; - *out++ = GAIA_NET_END; - // INSERTing the Header block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - pk++; - // preparing a new block - out = buf; - *out++ = GAIA_NET_BLOCK; - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block - out += 2; - nodes_cnt = 0; - } - for (i = 0; i < p_graph->GetNumNodes(); i++) - { - // looping on each Node - pN = p_graph->GetSortedNode(i); - OutputNetNode(auxbuf, &size, i, p_graph->IsNodeCode(), - p_graph->GetMaxCodeLength(), pN, endian_arch, 0); - if (size >= (MAX_BLOCK - (out - buf))) - { - // inserting the last block - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - pk++; - // preparing a new block - out = buf; - *out++ = GAIA_NET_BLOCK; - gaiaExport16(out, 0, 1, endian_arch); // how many Nodes are into this block - out += 2; - nodes_cnt = 0; - } - // inserting the current Node into the block - nodes_cnt++; - memcpy(out, auxbuf, size); - out += size; - } - if (nodes_cnt) - { - // inserting the last block - gaiaExport16(buf + 1, nodes_cnt, 1, endian_arch); // how many Nodes are into this block - sqlite3_reset(stmt); - sqlite3_clear_bindings(stmt); - sqlite3_bind_int64(stmt, 1, pk); - sqlite3_bind_blob(stmt, 2, buf, out - buf, SQLITE_STATIC); - ret = sqlite3_step(stmt); - if (ret == SQLITE_DONE || ret == SQLITE_ROW) - ; - else - { - wxString err = wxString::FromUTF8(sqlite3_errmsg(SqliteHandle)); - wxMessageBox(wxT("sqlite3_step error: ") + err, wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_finalize(stmt); - goto abort; - } - } - sqlite3_finalize(stmt); -// creating the VirtualNetwork NET-table - xname = (char *) malloc((virtualTableName.Len() * 4) + 1); - strcpy(xname, virtualTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql = wxT("CREATE VIRTUAL TABLE ") + wxString::FromUTF8(xname2); - free(xname2); - sql += wxT(" USING VirtualNetwork("); - xname = (char *) malloc((dataTableName.Len() * 4) + 1); - strcpy(xname, dataTableName.ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); - sql += wxString::FromUTF8(xname2) + wxT(")"); - free(xname2); - strcpy(xsql, sql.ToUTF8()); - ret = sqlite3_exec(SqliteHandle, xsql, NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("CREATE VIRTUAL TABLE error: ") + - wxString::FromUTF8(errMsg), wxT("spatialite_gui"), - wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } -// commits the transaction - ret = sqlite3_exec(SqliteHandle, "COMMIT", NULL, NULL, &errMsg); - if (ret != SQLITE_OK) - { - wxMessageBox(wxT("COMMIT error: ") + wxString::FromUTF8(errMsg), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - sqlite3_free(errMsg); - goto abort; - } - if (buf) - delete[]buf; - if (auxbuf) - delete[]auxbuf; - ::wxEndBusyCursor(); - return true; -abort: - ::wxEndBusyCursor(); - if (buf) - delete[]buf; - if (auxbuf) - delete[]auxbuf; - return true; - return false; -} - -int cmp_prenodes_code(const void *p1, const void *p2) -{ -// -// compares two preliminary nodes by CODE [for QSORT] -// - NetNodePre *pP1 = *((NetNodePre **) p1); - NetNodePre *pP2 = *((NetNodePre **) p2); - return pP1->GetCode().Cmp(pP2->GetCode()); -} - -int cmp_prenodes_id(const void *p1, const void *p2) -{ -// -// compares two preliminary nodes by ID [for QSORT] -// - NetNodePre *pP1 = *((NetNodePre **) p1); - NetNodePre *pP2 = *((NetNodePre **) p2); - if (pP1->GetId() == pP2->GetId()) - return 0; - if (pP1->GetId() > pP2->GetId()) - return 1; - return -1; -} - -int cmp_nodes2_code(const void *p1, const void *p2) -{ -// -// compares two nodes by CODE [for BSEARCH] -// - NetNode *pN1 = (NetNode *) p1; - NetNode *pN2 = *((NetNode **) p2); - return pN1->GetCode().Cmp(pN2->GetCode()); -} - -int cmp_nodes2_id(const void *p1, const void *p2) -{ -// -// compares two nodes by ID [for BSEARCH] -// - NetNode *pN1 = (NetNode *) p1; - NetNode *pN2 = *((NetNode **) p2); - if (pN1->GetId() == pN2->GetId()) - return 0; - if (pN1->GetId() > pN2->GetId()) - return 1; - return -1; -} - -int cmp_nodes1_code(const void *p1, const void *p2) -{ -// -// compares two nodes by CODE [for QSORT] -// - NetNode *pN1 = *((NetNode **) p1); - NetNode *pN2 = *((NetNode **) p2); - return pN1->GetCode().Cmp(pN2->GetCode()); -} - -int cmp_nodes1_id(const void *p1, const void *p2) -{ -// -// compares two nodes by ID [for QSORT ] -// - NetNode *pN1 = *((NetNode **) p1); - NetNode *pN2 = *((NetNode **) p2); - if (pN1->GetId() == pN2->GetId()) - return 0; - if (pN1->GetId() > pN2->GetId()) - return 1; - return -1; -} - -NetNodePre::NetNodePre(sqlite3_int64 id) -{ -// -// Network Node [preliminary] constructor -// - Id = id; - Code = wxT(""); - Next = NULL; -} - -NetNodePre::NetNodePre(const char *code) -{ -// -// Network Node [preliminary] constructor -// - Id = -1; - Code = wxString::FromUTF8(code); - Code.Truncate(30); - Next = NULL; -} - -NetNode::NetNode(sqlite3_int64 id) -{ -// -// Network Node [final] constructor -// - InternalIndex = -1; - Id = id; - Code = wxT(""); - X = DBL_MAX; - Y = DBL_MAX; - First = NULL; - Last = NULL; - Next = NULL; -} - -NetNode::NetNode(wxString & code) -{ -// -// Network Node [final] constructor -// - InternalIndex = -1; - Id = -1; - Code = code; - X = DBL_MAX; - Y = DBL_MAX; - First = NULL; - Last = NULL; - Next = NULL; -} - -NetNode::~NetNode() -{ -// Network Node [final] destructor - NetArcRef *pAR; - NetArcRef *pARn; - pAR = First; - while (pAR) - { - pARn = pAR->GetNext(); - delete pAR; - pAR = pARn; - } -} - -void NetNode::AddOutcoming(NetArc * pA) -{ -// -// adds an outcoming Arc to a Node -// - NetArcRef *pAR = new NetArcRef(pA); - if (!First) - First = pAR; - if (Last) - Last->SetNext(pAR); - Last = pAR; -} - -NetArc **NetNode::PrepareOutcomings(int *count) -{ -// -// preparing the outcoming arc array -// - NetArc **arc_array; - int n = 0; - int i; - bool ok; - NetArcRef *pAR; - NetArc *pA0; - NetArc *pA1; - pAR = First; - while (pAR) - { - // counting how many outcoming arcs are there - n++; - pAR = pAR->GetNext(); - } - if (!n) - { - *count = 0; - return NULL; - } - arc_array = new NetArc *[n]; - i = 0; - pAR = First; - while (pAR) - { - // populating the arcs array - *(arc_array + i++) = pAR->GetReference(); - pAR = pAR->GetNext(); - } - ok = true; - while (ok == true) - { - // bubble sorting the arcs by Cost - ok = false; - for (i = 1; i < n; i++) - { - pA0 = *(arc_array + i - 1); - pA1 = *(arc_array + i); - if (pA0->GetCost() > pA1->GetCost()) - { - // swapping the arcs - *(arc_array + i - 1) = pA1; - *(arc_array + i) = pA0; - ok = true; - } - } - } - *count = n; - return arc_array; -} - -NetArc::NetArc(sqlite3_int64 rowid, NetNode * from, NetNode * to, double cost) -{ -// -// Network Arc constructor -// - RowId = rowid; - From = from; - To = to; - Cost = cost; - Next = NULL; -} - -Network::Network() -{ -// -// Network constructor -// - FirstPre = NULL; - LastPre = NULL; - NumPreNodes = 0; - SortedPreNodes = NULL; - NumPreNodes = 0; - SortedPreNodes = NULL; - FirstArc = NULL; - LastArc = NULL; - FirstNode = NULL; - LastNode = NULL; - NumNodes = 0; - SortedNodes = NULL; - Error = false; - NodeCode = false; - MaxCodeLength = 0; -} - -Network::~Network() -{ -// -// Network destructor -// - NetArc *pA; - NetArc *pAn; - NetNode *pN; - NetNode *pNn; - CleanPreNodes(); - pA = FirstArc; - while (pA) - { - pAn = pA->GetNext(); - delete pA; - pA = pAn; - } - pN = FirstNode; - while (pN) - { - pNn = pN->GetNext(); - delete pN; - pN = pNn; - } - if (SortedNodes) - delete[]SortedNodes; -} - -void Network::CleanPreNodes() -{ -// -// cleaning up the preliminary Nodes list -// - NetNodePre *pP; - NetNodePre *pPn; - pP = FirstPre; - while (pP) - { - pPn = pP->GetNext(); - delete pP; - pP = pPn; - } - FirstPre = NULL; - LastPre = NULL; - NumPreNodes = 0; - if (SortedPreNodes) - delete[]SortedPreNodes; - SortedPreNodes = NULL; -} - -void Network::InsertNode(sqlite3_int64 id) -{ -// -// inserts a Node into the preliminary list -// - NetNodePre *pP = new NetNodePre(id); - if (!FirstPre) - FirstPre = pP; - if (LastPre) - LastPre->SetNext(pP); - LastPre = pP; -} - -void Network::InsertNode(const char *code) -{ -// -// inserts a Node into the preliminary list -// - NetNodePre *pP = new NetNodePre(code); - if (!FirstPre) - FirstPre = pP; - if (LastPre) - LastPre->SetNext(pP); - LastPre = pP; -} - -void Network::AddNode(sqlite3_int64 id) -{ -// -// inserts a Node into the final list -// - NetNode *pN = new NetNode(id); - if (!FirstNode) - FirstNode = pN; - if (LastNode) - LastNode->SetNext(pN); - LastNode = pN; -} - -void Network::AddNode(wxString & code) -{ -// -// inserts a Node into the final list -// - int len; - NetNode *pN = new NetNode(code); - len = pN->GetCode().Len() + 1; - if (len > MaxCodeLength) - MaxCodeLength = len; - if (!FirstNode) - FirstNode = pN; - if (LastNode) - LastNode->SetNext(pN); - LastNode = pN; -} - -NetNode *Network::ProcessNode(sqlite3_int64 id, double x, double y, - NetNode ** pOther) -{ -// -// inserts a new node or retrieves an already defined one -// - NetNode *pN = Find(id); - *pOther = NULL; - if (pN) - { - // this Node already exists into the sorted list - if (pN->GetX() == DBL_MAX && pN->GetY() == DBL_MAX) - { - pN->SetX(x); - pN->SetY(y); - } else - { - if (pN->GetX() == x && pN->GetY() == y) - ; - else - *pOther = pN; - } - return pN; - } -// unexpected error; undefined Node - return NULL; -} - -NetNode *Network::ProcessNode(wxString & code, double x, double y, - NetNode ** pOther) -{ -// -// inserts a new node or retrieves an already defined one -// - NetNode *pN = Find(code); - *pOther = NULL; - if (pN) - { - // this Node already exists into the sorted list - if (pN->GetX() == DBL_MAX && pN->GetY() == DBL_MAX) - { - pN->SetX(x); - pN->SetY(y); - } else - { - if (pN->GetX() == x && pN->GetY() == y) - ; - else - *pOther = pN; - } - return pN; - } -// unexpected error; undefined Node - return NULL; -} - -NetNode *Network::ProcessNode(sqlite3_int64 id, NetNode ** pOther) -{ -// -// inserts a new node or retrieves an already defined one -// - NetNode *pN = Find(id); - *pOther = NULL; - return pN; -} - -NetNode *Network::ProcessNode(wxString & code, NetNode ** pOther) -{ -// -// inserts a new node or retrieves an already defined one -// - NetNode *pN = Find(code); - *pOther = NULL; - return pN; -} - -void - Network::AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, - sqlite3_int64 id_to, double node_from_x, double node_from_y, - double node_to_x, double node_to_y, double cost) -{ -// -// inserting an arc into the memory structures -// - NetNode *pFrom; - NetNode *pTo; - NetNode *pN2; - NetArc *pA; - pFrom = ProcessNode(id_from, node_from_x, node_from_y, &pN2); - if (pN2) - Error = true; - pTo = ProcessNode(id_to, node_to_x, node_to_y, &pN2); - if (pN2) - Error = true; - if (!pFrom) - Error = true; - if (!pTo) - Error = true; - if (pFrom == pTo) - Error = true; - if (Error == true) - return; - pA = new NetArc(rowid, pFrom, pTo, cost); - if (!FirstArc) - FirstArc = pA; - if (LastArc) - LastArc->SetNext(pA); - LastArc = pA; -// updating Node connections - pFrom->AddOutcoming(pA); -} - -void - Network::AddArc(sqlite3_int64 rowid, const char *code_from, - const char *code_to, double node_from_x, double node_from_y, - double node_to_x, double node_to_y, double cost) -{ -// -// inserting an arc into the memory structures -// - NetNode *pFrom; - NetNode *pTo; - NetNode *pN2; - NetArc *pA; - wxString stCode = wxString::FromUTF8(code_from); - pFrom = ProcessNode(stCode, node_from_x, node_from_y, &pN2); - if (pN2) - Error = true; - stCode = wxString::FromUTF8(code_to); - pTo = ProcessNode(stCode, node_to_x, node_to_y, &pN2); - if (pN2) - Error = true; - if (!pFrom) - Error = true; - if (!pTo) - Error = true; - if (pFrom == pTo) - Error = true; - if (Error == true) - return; - pA = new NetArc(rowid, pFrom, pTo, cost); - if (!FirstArc) - FirstArc = pA; - if (LastArc) - LastArc->SetNext(pA); - LastArc = pA; -// updating Node connections - pFrom->AddOutcoming(pA); -} - -void - Network::AddArc(sqlite3_int64 rowid, sqlite3_int64 id_from, - sqlite3_int64 id_to, double cost) -{ -// -// inserting an arc into the memory structures -// - NetNode *pFrom; - NetNode *pTo; - NetNode *pN2; - NetArc *pA; - pFrom = ProcessNode(id_from, &pN2); - if (pN2) - Error = true; - pTo = ProcessNode(id_to, &pN2); - if (pN2) - Error = true; - if (!pFrom) - Error = true; - if (!pTo) - Error = true; - if (pFrom == pTo) - Error = true; - if (Error == true) - return; - pA = new NetArc(rowid, pFrom, pTo, cost); - if (!FirstArc) - FirstArc = pA; - if (LastArc) - LastArc->SetNext(pA); - LastArc = pA; -// updating Node connections - pFrom->AddOutcoming(pA); -} - -void - Network::AddArc(sqlite3_int64 rowid, const char *code_from, - const char *code_to, double cost) -{ -// -// inserting an arc into the memory structures -// - NetNode *pFrom; - NetNode *pTo; - NetNode *pN2; - NetArc *pA; - wxString stCode = wxString::FromUTF8(code_from); - pFrom = ProcessNode(stCode, &pN2); - if (pN2) - Error = true; - stCode = wxString::FromUTF8(code_to); - pTo = ProcessNode(stCode, &pN2); - if (pN2) - Error = true; - if (!pFrom) - Error = true; - if (!pTo) - Error = true; - if (pFrom == pTo) - Error = true; - if (Error == true) - return; - pA = new NetArc(rowid, pFrom, pTo, cost); - if (!FirstArc) - FirstArc = pA; - if (LastArc) - LastArc->SetNext(pA); - LastArc = pA; -// updating Node connections - pFrom->AddOutcoming(pA); -} - -void Network::Sort() -{ -// -// updating the Nodes sorted list -// - int i; - NetNode *pN; - NumNodes = 0; - if (SortedNodes) - { - // we must free the already existent sorted list - delete[]SortedNodes; - } - SortedNodes = NULL; - pN = FirstNode; - while (pN) - { - NumNodes++; - pN = pN->GetNext(); - } - if (!NumNodes) - return; - SortedNodes = new NetNode *[NumNodes]; - i = 0; - pN = FirstNode; - while (pN) - { - *(SortedNodes + i++) = pN; - pN = pN->GetNext(); - } - if (NodeCode == true) - { - // Nodes are identified by a TEXT code - qsort(SortedNodes, NumNodes, sizeof(NetNode *), cmp_nodes1_code); - } else - { - // Nodes are identified by an INTEGER id - qsort(SortedNodes, NumNodes, sizeof(NetNode *), cmp_nodes1_id); - } -} - -NetNode *Network::GetSortedNode(sqlite3_int64 x) -{ -// -// return a sorted Node [by position] -// - if (x >= 0 && x < NumNodes) - return *(SortedNodes + x); - return NULL; -} - -NetNode *Network::Find(sqlite3_int64 id) -{ -// -// searching a Node into the sorted list -// - NetNode **ret; - NetNode pN(id); - if (!SortedNodes) - return NULL; -// Nodes are identified by an INTEGER id - ret = - (NetNode **) bsearch(&pN, SortedNodes, NumNodes, sizeof(NetNode *), - cmp_nodes2_id); - if (!ret) - return NULL; - return *ret; -} - -NetNode *Network::Find(wxString & code) -{ -// -// searching a Node into the sorted list -// - NetNode **ret; - NetNode pN(code); - if (!SortedNodes) - return NULL; -// Nodes are identified by a TEXT code - ret = - (NetNode **) bsearch(&pN, SortedNodes, NumNodes, sizeof(NetNode *), - cmp_nodes2_code); - if (!ret) - return NULL; - return *ret; -} - -void Network::InitNodes() -{ -// -// prepares the final Nodes list -// - sqlite3_int64 last_id; - wxString last_code; - int i; - NetNodePre *pP; - NumPreNodes = 0; -// sorting preliminary nodes - if (SortedPreNodes) - { - // we must free the already existent sorted list - delete[]SortedPreNodes; - } - SortedPreNodes = NULL; - pP = FirstPre; - while (pP) - { - NumPreNodes++; - pP = pP->GetNext(); - } - if (!NumPreNodes) - return; - SortedPreNodes = new NetNodePre *[NumPreNodes]; - i = 0; - pP = FirstPre; - while (pP) - { - *(SortedPreNodes + i++) = pP; - pP = pP->GetNext(); - } - if (NodeCode == true) - { - // Nodes are identified by a TEXT code - qsort(SortedPreNodes, NumPreNodes, sizeof(NetNodePre *), - cmp_prenodes_code); - } else - { - // Nodes are identified by an INTEGER id - qsort(SortedPreNodes, NumPreNodes, sizeof(NetNodePre *), cmp_prenodes_id); - } -// creating the final Nodes linked list - last_id = -1; - last_code = wxT(""); - for (i = 0; i < NumPreNodes; i++) - { - pP = *(SortedPreNodes + i); - if (NodeCode == true) - { - // Nodes are identified by a TEXT code - if (pP->GetCode().Cmp(last_code) != 0) - AddNode(pP->GetCode()); - } else - { - // Nodes are identified by an INTEGER id - if (pP->GetId() != last_id) - AddNode(pP->GetId()); - } - last_id = pP->GetId(); - last_code = pP->GetCode(); - } -// sorting the final Nodes list - Sort(); -// cleaning up the preliminary Nodes structs - CleanPreNodes(); -} Index: Objects.cpp ================================================================== --- Objects.cpp +++ Objects.cpp @@ -2,11 +2,11 @@ / Objects.cpp / miscellaneous ancillary classes implementation / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -108,10 +108,82 @@ MainName = name; ColName = column; PathOrURL = path_or_url; Restricted = true; } + +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly) +{ +// +// constructor - TreeItemData +// + Type = type; + Host = host; + HostAddr = hostaddr; + Port = port; + DbName = dbname; + User = user; + ReadOnly = readOnly; +} + +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema) +{ +// +// constructor - TreeItemData +// + Type = type; + Host = host; + HostAddr = hostaddr; + Port = port; + DbName = dbname; + User = user; + Schema = schema; +} + +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema, + wxString & name, wxString & virtName, bool readOnly, bool pk, + bool select, bool insertUpdateDelete) +{ +// +// constructor - TreeItemData +// + Type = type; + Host = host; + HostAddr = hostaddr; + Port = port; + DbName = dbname; + User = user; + Schema = schema; + Name = name; + VirtName = virtName; + ReadOnly = readOnly; + PK = pk; + Select = select; + InsertUpdateDelete = insertUpdateDelete; +} + +MyObject::MyObject(int type, wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, wxString & schema, + wxString & name, wxString & column, wxString & virtName) +{ +// +// constructor - TreeItemData +// + Type = type; + Host = host; + HostAddr = hostaddr; + Port = port; + DbName = dbname; + User = user; + Schema = schema; + Name = name; + Column = column; + VirtName = virtName; +} bool MyObject::IsEditable() { // // testing for an EDITABLE TABLE or VIEW object @@ -406,10 +478,34 @@ // if (Type == MY_FOREIGN_KEY_FLD) return true; return false; } + +bool MyObject::IsPostgreSQL() +{ +// +// testing for PostgreSQL related nodes +// + bool ok = false; + switch (Type) + { + case MY_POSTGRES_CONN: + case MY_POSTGRES_SCHEMA: + case MY_POSTGRES_TABLE: + case MY_POSTGRES_VIEW: + case MY_POSTGIS_VIEW: + case MY_POSTGRES_COLUMN: + case MY_POSTGIS_GEOMETRY: + ok = true; + break; + default: + ok = false; + break; + }; + return ok; +} void MyVariant::Copy(MyVariant * other) { // // transfers a BLOB value @@ -1011,17 +1107,15 @@ int i; char **results; int rows; int columns; char *errMsg = NULL; - const char *name; wxString Name; char *sql; char xname[1024]; int ret; int is_virtual = 0; - char *xtable; if (table.StartsWith(wxT("vgpkg_")) == true) { wxString clean; table.StartsWith(wxT("vgpkg_"), &clean); @@ -1089,17 +1183,15 @@ int i; char **results; int rows; int columns; char *errMsg = NULL; - const char *name; wxString Name; char *sql; char xname[1024]; int ret; int is_virtual = 0; - char *xtable; if (table.StartsWith(wxT("fdo_")) == true) { wxString clean; table.StartsWith(wxT("fdo_"), &clean); @@ -4017,10 +4109,67 @@ GeoPackageVirtualGeometry = false; FdoOgrGeometry = false; FdoOgrVirtualGeometry = false; Next = NULL; } + +TableViewItem::TableViewItem(wxString & db, wxString & name) +{ +// constructor + DbName = db; + Name = name; + View = false; + Virtual = false; + Geometry = false; + GeoPackageGeometry = false; + GeoPackageVirtualGeometry = false; + FdoOgrGeometry = false; + FdoOgrVirtualGeometry = false; + Next = NULL; +} + +bool TableViewItem::IsPostgresTable(MyPostgres * list) +{ +// testing for some PostgreSQL table or view + MyPostgresConn *pC = list->GetFirst(); + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (Name.Cmp(pT->GetVirtName()) == 0) + return true; + if (Name.Cmp(pT->GetPostGisName()) == 0) + return true; + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + if (Name.Cmp(pV->GetVirtName()) == 0) + return true; + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } + return false; +} + +bool TableViewItem::IsTmpMetadata() +{ +// testing for some TEMPORARY METADATA TABLE + if (DbName.Cmp(wxT("temp")) == 0 + && (Name.Cmp(wxT("postgis_geometry_columns")) == 0 + || Name.Cmp(wxT("tmp_vector_coverages")) == 0)) + return true; + return false; +} TableViewList::TableViewList() { // constructor First = NULL; @@ -4049,10 +4198,21 @@ { // adding a new item to the list TableViewItem *item = new TableViewItem(name, isView, isVirtual); if (First == NULL) First = item; + if (Last != NULL) + Last->SetNext(item); + Last = item; +} + +void TableViewList::Add(wxString & db, wxString & name) +{ +// adding a new item to the list + TableViewItem *item = new TableViewItem(db, name); + if (First == NULL) + First = item; if (Last != NULL) Last->SetNext(item); Last = item; } ADDED Postgres.cpp Index: Postgres.cpp ================================================================== --- Postgres.cpp +++ Postgres.cpp @@ -0,0 +1,2639 @@ +/* +/ Postgres.cpp +/ helper functions for PostgreSQL connections +/ +/ version 2.1, 2018 May 5 +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2018 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include "Classdef.h" + +#include "wx/spinctrl.h" +#include "wx/utils.h" +#include "wx/filename.h" + +void MyFrame::GetPQlibVersion(wxString & ver) +{ +// +// returns the PQlib (PostgreSQL client) version +// + int ver_num = vpgPQlibVersion(); + int major = ver_num / 10000; + int minor = (ver_num - (major * 10000)) / 100; + int revision = ver_num - (major * 10000) - (minor * 100); + char version[128]; + sprintf(version, "%d.%02d.%02d", major, minor, revision); + ver = wxString::FromUTF8(version); +} + +bool MyFrame::HasPostgreSqlConnections() +{ +// checks for any current PostgreSQL connection + if (PostgresList.GetFirst() == NULL) + return false; + return true; +} + +void MyFrame::DoLoadLibPQ(wxString & path) +{ +// +// attempting to load LibPQ - dynamic late binding +// + if (DynamicLibPQ.IsLoaded() == true) + DynamicLibPQ.Unload(); + if (DynamicLibPQ.Load(path, wxDL_QUIET)) + { + // retievinig the pointers of ALL APIs + bool valid = true; + bool ok; + VirtualPQapi.PQclear = + (void (*)(PGresult *)) DynamicLibPQ.GetSymbol(wxT("PQclear"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQconnectdb = + (PGconn * + (*)(const char *conninfo)) DynamicLibPQ.GetSymbol(wxT("PQconnectdb"), + &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQerrorMessage = + (char *(*)(const PGconn * conn)) + DynamicLibPQ.GetSymbol(wxT("PQerrorMessage"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQexec = + (PGresult * + (*)(PGconn * conn, + const char *command)) DynamicLibPQ.GetSymbol(wxT("PQexec"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQfinish = + (void (*)(PGconn * conn)) DynamicLibPQ.GetSymbol(wxT("PQfinish"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQgetisnull = + (int (*)(const PGresult * res, int row_number, int column_number)) + DynamicLibPQ.GetSymbol(wxT("PQgetisnull"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQgetvalue = + (char *(*)(const PGresult * res, int row_number, int column_number)) + DynamicLibPQ.GetSymbol(wxT("PQgetvalue"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQlibVersion = + (int (*)(void)) DynamicLibPQ.GetSymbol(wxT("PQlibVersion"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQnfields = + (int (*)(const PGresult * res)) DynamicLibPQ.GetSymbol(wxT("PQnfields"), + &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQntuples = + (int (*)(const PGresult * res)) DynamicLibPQ.GetSymbol(wxT("PQntuples"), + &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQresultStatus = + (ExecStatusType(*)(const PGresult * res)) + DynamicLibPQ.GetSymbol(wxT("PQresultStatus"), &ok); + if (ok == false) + valid = false; + VirtualPQapi.PQstatus = + (ConnStatusType(*)(const PGconn * conn)) + DynamicLibPQ.GetSymbol(wxT("PQstatus"), &ok); + if (ok == false) + valid = false; + if (valid == true) + { + if (virtualpg_extension_init(SqliteHandle, &VirtualPQapi) == + SQLITE_OK) + { + // OK, anything is good + PathLibPQ = path; + VirtualPQapiOK = true; + return; + } + } + } + PathLibPQ = wxT(""); +} + +void MyFrame::DoLocateLibPQ(wxString & extpath) +{ +// +// attempting to load LibPQ - path selected by the user +// + int ret; + wxString path = wxDynamicLibrary::CanonicalizeName(wxT("libpq")); + wxFileName name(path); + wxString suffix = + wxT("Dynamic Library (*.") + name.GetExt() + wxT(")|*.") + name.GetExt(); + wxFileDialog fileDialog(this, wxT("libPQ manual search"), wxT(""), path, + suffix, wxFD_OPEN | wxFD_FILE_MUST_EXIST, + wxDefaultPosition, wxDefaultSize, wxT("filedlg")); + ret = fileDialog.ShowModal(); + if (ret == wxID_OK) + { + path = fileDialog.GetPath(); + DoLoadLibPQ(path); + extpath = path; + } +} + +void MyFrame::DoPostgreSqlConnection() +{ +// +// establishing a connection to PostgreSQL +// + if (VirtualPQapiOK == false) + { + // + // LibPQ isn't yet loaded + // + int ret = wxMessageBox(wxT + ("The PostgreSQL client library (LibPQ) isn't yet loaded.\n\n" + "Do you wish to attempt loading it right now ?"), + wxT("spatialite_gui"), + wxYES_NO | wxICON_QUESTION, this); + if (ret == wxYES) + { + // trying to load LibPQ + wxString path; + DoLocateLibPQ(path); + if (VirtualPQapiOK == true) + { + wxMessageBox(wxT + ("The PostgreSQL client library (LibPQ) has been correctly loaded\n\n" + "Full PostgreSQL support is now available."), + wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, + this); + goto ok; + } + if (path.Len() > 0) + wxMessageBox(wxT + ("Unable to load a valid PostgreSQL client library (LibPQ) from:\n\n") + + path + + wxT + ("\n\nFull PostgreSQL support still continues to be disabled."), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + } + return; + } + +ok: + PostgresConnectionDialog dlg; + dlg.Create(this); + int ret = dlg.ShowModal(); + if (ret == wxID_OK) + { + char *conninfo = sqlite3_mprintf(" "); + char *prev; + if (dlg.GetHost() != NULL) + { + prev = conninfo; + conninfo = sqlite3_mprintf("%s host=%s", prev, dlg.GetHost()); + sqlite3_free(prev); + } + if (dlg.GetHostAddr() != NULL) + { + prev = conninfo; + conninfo = sqlite3_mprintf("%s hostaddr=%s", prev, dlg.GetHostAddr()); + sqlite3_free(prev); + } + prev = conninfo; + conninfo = sqlite3_mprintf("%s port=%d", prev, dlg.GetPort()); + sqlite3_free(prev); + if (dlg.GetDbName() != NULL) + { + prev = conninfo; + conninfo = sqlite3_mprintf("%s dbname=%s", prev, dlg.GetDbName()); + sqlite3_free(prev); + } + if (dlg.GetUser() != NULL) + { + prev = conninfo; + conninfo = sqlite3_mprintf("%s user=%s", prev, dlg.GetUser()); + sqlite3_free(prev); + } + if (dlg.GetPassword() != NULL) + { + prev = conninfo; + conninfo = sqlite3_mprintf("%s password=%s", prev, dlg.GetPassword()); + sqlite3_free(prev); + } + wxString host = wxString::FromUTF8(dlg.GetHost()); + wxString hostaddr = wxString::FromUTF8(dlg.GetHostAddr()); + int port = dlg.GetPort(); + wxString dbname = wxString::FromUTF8(dlg.GetDbName()); + wxString user = wxString::FromUTF8(dlg.GetUser()); + bool readOnly = dlg.IsReadOnly(); + bool textDates = dlg.IsTextDates(); + bool ret = false; + if (DoCheckPostgres(host, hostaddr, port, dbname, user) == true) + wxMessageBox(wxT + ("A PostgreSQL Connection with the same arguments alreay exists !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + else + ret = + DoInitPostgres(host, hostaddr, dlg.GetPort(), dbname, user, readOnly, + textDates, conninfo + 2); + sqlite3_free(conninfo); + if (ret) + InitTableTree(); + } +} + +bool MyFrame::DoCheckPostgres(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user) +{ +// +// testing for already existing PostgreSQL connections +// + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 + && pC->GetUser().Cmp(user) == 0) + return true; + pC = pC->GetNext(); + } + return false; +} + +void MyFrame::DoInitVirtualPQapi() +{ +// +// initializing the Virtual LibPQ API +// +#ifdef LIBPQ_DEFERRED +/* +/ not directly linked to libpq +/ libpq will be eventually loaded only when required (late binding) +*/ + VirtualPQapi.PQclear = NULL; + VirtualPQapi.PQconnectdb = NULL; + VirtualPQapi.PQerrorMessage = NULL; + VirtualPQapi.PQexec = NULL; + VirtualPQapi.PQfinish = NULL; + VirtualPQapi.PQgetisnull = NULL; + VirtualPQapi.PQgetvalue = NULL; + VirtualPQapi.PQlibVersion = NULL; + VirtualPQapi.PQnfields = NULL; + VirtualPQapi.PQntuples = NULL; + VirtualPQapi.PQresultStatus = NULL; + VirtualPQapi.PQstatus = NULL; + VirtualPQapiOK = false; +#else +/* directly linked to libpq */ + VirtualPQapi.PQclear = PQclear; + VirtualPQapi.PQconnectdb = PQconnectdb; + VirtualPQapi.PQerrorMessage = PQerrorMessage; + VirtualPQapi.PQexec = PQexec; + VirtualPQapi.PQfinish = PQfinish; + VirtualPQapi.PQgetisnull = PQgetisnull; + VirtualPQapi.PQgetvalue = PQgetvalue; + VirtualPQapi.PQlibVersion = PQlibVersion; + VirtualPQapi.PQnfields = PQnfields; + VirtualPQapi.PQntuples = PQntuples; + VirtualPQapi.PQresultStatus = PQresultStatus; + VirtualPQapi.PQstatus = PQstatus; + VirtualPQapiOK = false; +#endif +} + +void MyFrame::DoInitVirtualPG() +{ +// +// attempting to initialize the VirtalPG extension +// + if (virtualpg_extension_init(SqliteHandle, &VirtualPQapi) == SQLITE_OK) + VirtualPQapiOK = true; +} + +bool MyFrame::DoInitPostgres(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, bool readOnly, + bool textDates, const char *conninfo) +{ +// +// attempting to initialize a PostgreSQL connection +// + PGconn *pg_conn; + PGresult *res; + int nRows; + int nFields; + const char *obj; + const char *schema_name; + const char *table_name; + const char *geometry; + const char *type; + int srid; + int dims; + int r; + MyPostgresConn *conn; + MyPostgresSchema *pS; + + ::wxBeginBusyCursor(); + pg_conn = vpgPQconnectdb(conninfo); + if (vpgPQstatus(pg_conn) != CONNECTION_OK) + { + char *msg = sqlite3_mprintf("Connection to Postgres failed: %s", + vpgPQerrorMessage(pg_conn)); + wxMessageBox(wxString::FromUTF8(msg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(msg); + vpgPQfinish(pg_conn); + ::wxEndBusyCursor(); + return false; + } + + conn = + PostgresList.Insert(host, hostaddr, port, dbname, user, readOnly, + textDates); + +// retrieving all PosgreSQL Tables and Views + const char *sql = + "SELECT 'table' AS obj, t.schemaname, t.tablename, g.f_geometry_column, " + "g.type, g.srid, g.coord_dimension " + "FROM pg_tables AS t LEFT JOIN geometry_columns AS g ON " + "(g.f_table_schema = t.schemaname AND g.f_table_name = t.tablename) " + "WHERE t.schemaname NOT IN ('information_schema', 'pg_catalog') " + "UNION SELECT 'view' AS obj, schemaname, viewname, '', '', -1, -1 FROM pg_views " + "WHERE schemaname NOT IN ('information_schema', 'pg_catalog') " + "ORDER BY 1, 2, 3"; + res = vpgPQexec(pg_conn, sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto err; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 7) + { + for (r = 0; r < nRows; r++) + { + obj = vpgPQgetvalue(res, r, 0); + schema_name = vpgPQgetvalue(res, r, 1); + table_name = vpgPQgetvalue(res, r, 2); + geometry = vpgPQgetvalue(res, r, 3); + type = vpgPQgetvalue(res, r, 4); + srid = atoi(vpgPQgetvalue(res, r, 5)); + dims = atoi(vpgPQgetvalue(res, r, 6)); + wxString Schema = wxString::FromUTF8(schema_name); + wxString Table = wxString::FromUTF8(table_name); + wxString Geometry = wxString::FromUTF8(geometry); + wxString Type = wxString::FromUTF8(type); + if (strcmp(obj, "view") == 0) + conn->Add(Schema, Table); + else + conn->Add(Schema, Table, Geometry, Type, srid, dims); + } + } + vpgPQclear(res); + + pS = conn->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + InitPostgresPks(pg_conn, pS, pT); + DoCheckGrantPermissions(pg_conn, conn->GetUser(), pS, pT); + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + DoCheckGrantPermissions(pg_conn, conn->GetUser(), pS, pV); + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + vpgPQfinish(pg_conn); + + conn->SetConnectionString(conninfo); + DoSetUniqueVirtNames(); + DoCreatePostgresTables(); + ::wxEndBusyCursor(); + return true; + +err: +// something has gone the wrong way + if (res != NULL) + vpgPQclear(res); + vpgPQfinish(pg_conn); + ::wxEndBusyCursor(); + return false; +} + +void MyFrame::DoSetUniqueVirtNames() +{ +// +// ensuring to set Unique Names to all PostgreSQL Tables and Views +// + wxString baseName; + wxString uniqueName; + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (pT->GetVirtName().Len() == 0) + { + baseName = wxT("vpg_") + pT->GetName(); + PostgresList.MakeUniqueVirtName(baseName, uniqueName); + pT->SetVirtName(uniqueName); + } + if (pT->GetFirst() != NULL) + { + if (pT->GetPostGisName().Len() == 0) + { + baseName = wxT("vpg_") + pT->GetName() + wxT("_postgis"); + PostgresList.MakeUniqueVirtName(baseName, uniqueName); + pT->SetPostGisName(uniqueName); + } + } + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + if (pV->GetVirtName().Len() == 0) + { + baseName = wxT("vpg_") + pV->GetName(); + PostgresList.MakeUniqueVirtName(baseName, uniqueName); + pV->SetVirtName(uniqueName); + } + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } +} + +void MyFrame::DoCreatePostgresTables() +{ +// +// attempting to create any required PostgreSQL/PostGIS table +// + char *sql; + char *virt_name; + char *xvirt_name; + char *geom_name; + char *geo_type; + char *connection_string; + char *schema; + char *table; + int ret; + char *errMsg = NULL; + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + const char *readOnly = "-"; + const char *textDates = "-"; + if (pC->IsReadOnly() == false) + readOnly = "W"; + if (pC->IsTextDates() == false) + textDates = "J"; + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + // creating some VirtualPG Table + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pT->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + connection_string = + (char *) malloc((pC->GetConnectionString().Len() * 4) + 1); + strcpy(connection_string, pC->GetConnectionString().ToUTF8()); + schema = (char *) malloc((pS->GetName().Len() * 4) + 1); + strcpy(schema, pS->GetName().ToUTF8()); + table = (char *) malloc((pT->GetName().Len() * 4) + 1); + strcpy(table, pT->GetName().ToUTF8()); + sql = + sqlite3_mprintf + ("CREATE VIRTUAL TABLE IF NOT EXISTS main.\"%s\" " + "USING VirtualPostgres(%Q, %Q, %Q, %Q, %Q)", xvirt_name, + connection_string, schema, table, readOnly, textDates); + free(xvirt_name); + free(connection_string); + free(schema); + free(table); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + if (pT->GetFirst() != NULL) + { + // creating some SpatiaLite-like Spatial View based on a PostgreSQL Table + virt_name = + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = + sqlite3_mprintf + ("CREATE VIEW IF NOT EXISTS main.\"%s\" AS\n", xvirt_name); + free(xvirt_name); + sql = DoCreatePostGisSpatialView(pT, sql); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostGIS wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + char a[1024]; + char b[1024]; + strcpy(a, pS->GetName().ToUTF8()); + strcpy(b, pT->GetPostGisName().ToUTF8()); + if (pC->IsReadOnly() == false && pT->HasPK() == true + && pT->CanInsertUpdateDelete() == true) + { + // creating all required Triggers so to get a Writable View + DoCreatePostGisSpatialViewTriggers(pC, pS, pT); + } + // registering all Spatial Views + MyPostGisGeometry *pG = pT->GetFirst(); + while (pG != NULL) + { + // registering a Spatial View + virt_name = + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + geom_name = + (char *) malloc((pG->GetName().Len() * 4) + 1); + strcpy(geom_name, pG->GetName().ToUTF8()); + geo_type = + (char *) malloc((pG->GetGeomType().Len() * 4) + 1); + strcpy(geo_type, pG->GetGeomType().ToUTF8()); + sql = + sqlite3_mprintf + ("INSERT INTO temp.postgis_geometry_columns " + "(f_table_name, f_geometry_column, coord_dimension, srid, geometry_type) " + "VALUES (%Q, %Q, %d, %d, %Q)", virt_name, geom_name, + pG->GetDims(), pG->GetSrid(), geo_type); + free(virt_name); + free(geom_name); + free(geo_type); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), + wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } + pG = pG->GetNext(); + } + } + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + // creating some VirtualPG View + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pV->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + connection_string = + (char *) malloc((pC->GetConnectionString().Len() * 4) + 1); + strcpy(connection_string, pC->GetConnectionString().ToUTF8()); + schema = (char *) malloc((pS->GetName().Len() * 4) + 1); + strcpy(schema, pS->GetName().ToUTF8()); + table = (char *) malloc((pV->GetName().Len() * 4) + 1); + strcpy(table, pV->GetName().ToUTF8()); + sql = + sqlite3_mprintf + ("CREATE VIRTUAL TABLE IF NOT EXISTS main.\"%s\" " + "USING VirtualPostgres(%Q, %Q, %Q, '-', textDates)", + xvirt_name, connection_string, schema, table, textDates); + free(xvirt_name); + free(connection_string); + free(schema); + free(table); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } +} + +char *MyFrame::DoCreatePostGisSpatialView(MyPostgresTable * table, + char *prev_sql) +{ +// +// auto-writing the CREATE VIEW for some PostGIS geometry +// + int ret; + int i; + char **results; + int rows; + int columns; + char *sql = prev_sql; + char *prev; + char *xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); + strcpy(xtable, table->GetVirtName().ToUTF8()); + char *sql2 = sqlite3_mprintf("PRAGMA table_info(%Q)", xtable); + free(xtable); + ret = sqlite3_get_table(SqliteHandle, sql2, &results, &rows, &columns, NULL); + sqlite3_free(sql2); + if (ret != SQLITE_OK) + return sql; + if (rows < 1) + ; + else + { + prev = sql; + sql = sqlite3_mprintf("%sSELECT ROWID AS ROWID", prev); + sqlite3_free(prev); + for (i = 1; i <= rows; i++) + { + prev = sql; + const char *name = results[(i * columns) + 1]; + char *xname = gaiaDoubleQuotedSql(name); + wxString col = wxString::FromUTF8(name); + MyPostGisGeometry *geom = table->Find(col); + if (geom != NULL) + { + if (geom->IsMultiType() == true) + sql = + sqlite3_mprintf + ("%s, CastToMulti(GeomFromEWKB(\"%s\")) AS \"%s\"", prev, + xname, xname); + else + sql = + sqlite3_mprintf("%s, GeomFromEWKB(\"%s\") AS \"%s\"", + prev, xname, xname); + } else + { + sql = sqlite3_mprintf("%s, \"%s\" AS \"%s\"", prev, xname, xname); + } + free(xname); + sqlite3_free(prev); + } + } + sqlite3_free_table(results); + + prev = sql; + xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); + strcpy(xtable, table->GetVirtName().ToUTF8()); + char *xxtable = gaiaDoubleQuotedSql(xtable); + free(xtable); + sql = sqlite3_mprintf("%s\nFROM MAIN.\"%s\"", prev, xxtable); + free(xxtable); + sqlite3_free(prev); + return sql; +} + +void MyFrame::DoCheckGrantPermissions(void *conn, wxString & user, + MyPostgresSchema * schema, + MyPostgresTable * table) +{ +// +// testing Grant permissions for some PostgreSQL Table or View +// + PGconn *pg_conn = (PGconn *) conn; + PGresult *res; + int nRows; + int nFields; + int r; + bool canSelect = false; + bool canInsert = false; + bool canUpdate = false; + bool canDelete = false; + bool canInsertUpdateDelete = false; + char *cuser = (char *) malloc(user.Len() * 4 + 1); + strcpy(cuser, user.ToUTF8()); + char *cschema = (char *) malloc(schema->GetName().Len() * 4 + 1); + strcpy(cschema, schema->GetName().ToUTF8()); + char *ctable = (char *) malloc(table->GetName().Len() * 4 + 1); + strcpy(ctable, table->GetName().ToUTF8()); + char *name = sqlite3_mprintf("%s.%s", cschema, ctable); +// testing for SELECT + char *sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'select')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canSelect = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for INSERT + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'insert')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canInsert = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for UPDATE + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'update')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canUpdate = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for DELETE + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'delete')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canDelete = true; + } + } + vpgPQclear(res); + res = NULL; + + if (canInsert == true && canUpdate == true && canDelete == true) + canInsertUpdateDelete = true; + table->SetGrants(canSelect, canInsertUpdateDelete); +end: + if (res != NULL) + vpgPQclear(res); + free(cuser); + free(cschema); + free(ctable); + sqlite3_free(name); +} + +void MyFrame::DoCheckGrantPermissions(void *conn, wxString & user, + MyPostgresSchema * schema, + MyPostgresView * view) +{ +// +// testing Grant permissions for some PostgreSQL Table or View +// + PGconn *pg_conn = (PGconn *) conn; + PGresult *res; + int nRows; + int nFields; + int r; + bool canSelect = false; + bool canInsert = false; + bool canUpdate = false; + bool canDelete = false; + bool canInsertUpdateDelete = false; + char *cuser = (char *) malloc(user.Len() * 4 + 1); + strcpy(cuser, user.ToUTF8()); + char *cschema = (char *) malloc(schema->GetName().Len() * 4 + 1); + strcpy(cschema, schema->GetName().ToUTF8()); + char *ctable = (char *) malloc(view->GetName().Len() * 4 + 1); + strcpy(ctable, view->GetName().ToUTF8()); + char *name = sqlite3_mprintf("%s.%s", cschema, ctable); +// testing for SELECT + char *sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'select')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canSelect = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for INSERT + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'insert')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canInsert = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for UPDATE + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'update')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canUpdate = true; + } + } + vpgPQclear(res); + res = NULL; +// testing for DELETE + sql = + sqlite3_mprintf("SELECT has_table_privilege(%Q, %Q, 'delete')", cuser, + name); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto end; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *permission = vpgPQgetvalue(res, r, 0); + if (strcmp(permission, "t") == 0) + canDelete = true; + } + } + vpgPQclear(res); + res = NULL; + + if (canInsert == true && canUpdate == true && canDelete == true) + canInsertUpdateDelete = true; + view->SetGrants(canSelect, canInsertUpdateDelete); +end: + if (res != NULL) + vpgPQclear(res); + free(cuser); + free(cschema); + free(ctable); + sqlite3_free(name); +} + +void MyFrame::DoCreatePostGisSpatialViewTriggers(MyPostgresConn * conn, + MyPostgresSchema * schema, + MyPostgresTable * table) +{ +// +// auto-writing the CREATE TRIGGERS for some PostGIS geometry (writable view) +// + char *sql; + char *prev; + char *ctrigger; + char *xtrigger; + char *ctable; + char *xtable; + char *cview; + char *xview; + char name[1024]; + char *xname; + char *where; + int first; + MyPostgresCol *pC; + MyPostgresColumns *cols; + char *errMsg = NULL; + int ret; + + InitPostgresPkColumns(conn, schema, table); + cols = DoGetPostgresColumns(table); + +// preparing the INSERT Trigger + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); + strcpy(ctable, table->GetVirtName().ToUTF8()); + xtable = gaiaDoubleQuotedSql(ctable); + free(ctable); + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); + strcpy(cview, table->GetPostGisName().ToUTF8()); + xview = gaiaDoubleQuotedSql(cview); + ctrigger = sqlite3_mprintf("%s_trgins", cview); + free(cview); + xtrigger = gaiaDoubleQuotedSql(ctrigger); + sqlite3_free(ctrigger); + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " + "INSERT ON \"%s\"\nBEGIN\n\tINSERT OR REPLACE INTO \"%s\"\n\t\t(", + xtrigger, xview, xtable); + free(xtrigger); + free(xtable); + free(xview); + pC = cols->GetFirst(); + first = 1; + while (pC != NULL) + { + prev = sql; + if (first) + { + first = 0; + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + sql = sqlite3_mprintf("%s\"%s\"", prev, xname); + free(xname); + } else + { + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + sql = sqlite3_mprintf("%s, \"%s\"", prev, xname); + free(xname); + } + sqlite3_free(prev); + pC = pC->GetNext(); + } + prev = sql; + sql = sqlite3_mprintf("%s)\n\tVALUES (", prev); + sqlite3_free(prev); + pC = cols->GetFirst(); + first = 1; + while (pC != NULL) + { + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + MyPostGisGeometry *geom = table->Find(pC->GetName()); + prev = sql; + if (first) + { + first = 0; + if (geom != NULL) + sql = sqlite3_mprintf("%sAsEWKB(NEW.\"%s\")", prev, xname); + else + sql = sqlite3_mprintf("%sNEW.\"%s\"", prev, xname); + } else + { + if (geom != NULL) + sql = sqlite3_mprintf("%s, AsEWKB(NEW.\"%s\")", prev, xname); + else + sql = sqlite3_mprintf("%s, NEW.\"%s\"", prev, xname); + } + free(xname); + sqlite3_free(prev); + pC = pC->GetNext(); + } + prev = sql; + sql = sqlite3_mprintf("%s);\nEND", prev); + sqlite3_free(prev); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } +// preparing the UPDATE Trigger + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); + strcpy(ctable, table->GetVirtName().ToUTF8()); + xtable = gaiaDoubleQuotedSql(ctable); + free(ctable); + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); + strcpy(cview, table->GetPostGisName().ToUTF8()); + xview = gaiaDoubleQuotedSql(cview); + ctrigger = sqlite3_mprintf("%s_trgupd", cview); + free(cview); + xtrigger = gaiaDoubleQuotedSql(ctrigger); + sqlite3_free(ctrigger); + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " + "UPDATE OF ", xtrigger); + free(xtrigger); + pC = cols->GetFirst(); + first = 1; + while (pC != NULL) + { + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + prev = sql; + if (first) + { + first = 0; + sql = sqlite3_mprintf("%s\"%s\"", prev, xname); + } else + sql = sqlite3_mprintf("%s, \"%s\"", prev, xname); + free(xname); + sqlite3_free(prev); + pC = pC->GetNext(); + } + prev = sql; + sql = + sqlite3_mprintf("%s\n\tON \"%s\"\nBEGIN\n\tUPDATE \"%s\" SET ", prev, xview, + xtable); + sqlite3_free(prev); + free(xtable); + free(xview); + pC = cols->GetFirst(); + first = 1; + while (pC != NULL) + { + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + MyPostGisGeometry *geom = table->Find(pC->GetName()); + prev = sql; + if (first) + { + first = 0; + if (geom != NULL) + sql = + sqlite3_mprintf("%s\"%s\" = AsEWKB(NEW.\"%s\")", prev, xname, + xname); + else + sql = sqlite3_mprintf("%s\"%s\" = NEW.\"%s\"", prev, xname, xname); + } else + { + if (geom != NULL) + sql = + sqlite3_mprintf("%s, \"%s\" = AsEWKB(NEW.\"%s\")", prev, xname, + xname); + else + sql = + sqlite3_mprintf("%s, \"%s\" = NEW.\"%s\"", prev, xname, xname); + } + free(xname); + sqlite3_free(prev); + pC = pC->GetNext(); + } + prev = sql; + where = cols->BuildWhere(); + sql = sqlite3_mprintf("%s\n\t%s;\nEND", prev, where); + sqlite3_free(prev); + sqlite3_free(where); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } +// preparing the DELETE Trigger + ctable = (char *) malloc(table->GetVirtName().Len() * 4 + 1); + strcpy(ctable, table->GetVirtName().ToUTF8()); + xtable = gaiaDoubleQuotedSql(ctable); + free(ctable); + cview = (char *) malloc(table->GetPostGisName().Len() * 4 + 1); + strcpy(cview, table->GetPostGisName().ToUTF8()); + xview = gaiaDoubleQuotedSql(cview); + ctrigger = sqlite3_mprintf("%s_trgdel", cview); + free(cview); + xtrigger = gaiaDoubleQuotedSql(ctrigger); + sqlite3_free(ctrigger); + where = cols->BuildWhere(); + sql = sqlite3_mprintf("CREATE TRIGGER \"%s\"\n\tINSTEAD OF " + "DELETE ON \"%s\"\nBEGIN\n\tDELETE FROM \"%s\" %s;\nEND", + xtrigger, xview, xtable, where); + sqlite3_free(where); + free(xtrigger); + free(xtable); + free(xview); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("CREATE TRIGGER error: ") + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } + + delete cols; +} + +MyPostgresColumns *MyFrame::DoGetPostgresColumns(MyPostgresTable * table) +{ +// +// fetching all Columns for a given VirtualPG Table +// + MyPostgresColumns *cols = NULL; + int ret; + int i; + char **results; + int rows; + int columns; + char *xtable = (char *) malloc((table->GetVirtName().Len() * 4) + 1); + strcpy(xtable, table->GetVirtName().ToUTF8()); + char *sql = sqlite3_mprintf("PRAGMA table_info(%Q)", xtable); + free(xtable); + ret = sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return NULL; + if (rows < 1) + ; + else + { + cols = new MyPostgresColumns(); + for (i = 1; i <= rows; i++) + { + const char *name = results[(i * columns) + 1]; + wxString sName = wxString::FromUTF8(name); + cols->Add(sName); + } + } + sqlite3_free_table(results); + + MyPostgresPK *pK = table->GetFirstPK(); + while (pK != NULL) + { + // marking all PK Columns + cols->SetPK(pK->GetName()); + pK = pK->GetNext(); + } + + if (cols->GetFirst() == NULL) + { + // empyt list !!! + delete cols; + return NULL; + } + return cols; +} + +void MyFrame::DoDropPostgresTables() +{ +// +// attempting to drop any PostgreSQL/PostGIS table +// + char *sql; + char *virt_name; + char *xvirt_name; + char *geom_name; + int ret; + char *errMsg = NULL; + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (pT->GetFirst() != NULL) + { + // dropping some SpatiaLite-like Spatial View based on a PostgreSQL Table + virt_name = + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = + sqlite3_mprintf("DROP VIEW IF EXISTS main.\"%s\"", + xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostGIS wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + MyPostGisGeometry *pG = pT->GetFirst(); + while (pG != NULL) + { + // removing from POSTGIS_GEOMETRY_COLUMNS + virt_name = + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + geom_name = + (char *) malloc((pG->GetName().Len() * 4) + 1); + strcpy(geom_name, pG->GetName().ToUTF8()); + sql = + sqlite3_mprintf + ("DELETE FROM temp.postgis_geometry_columns " + "WHERE f_table_name = %Q AND f_geometry_column = %Q", + virt_name, geom_name); + free(virt_name); + free(geom_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostGIS wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), + wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } + pG = pG->GetNext(); + } + } + // dropping some VirtualPG Table + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pT->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = + sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + // dropping some VirtualPG View + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pV->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = + sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } +} + +bool MyFrame::DoClosePostgreSqlConn(wxString & host, wxString & hostaddr, + int port, wxString & dbname, + wxString & user) +{ +// +// attempting to close a single connection to PostgreSQL +// + char *sql; + char *virt_name; + char *xvirt_name; + char *geom_name; + int ret; + char *errMsg = NULL; + MyPostgresConn *conn = NULL; + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 + && pC->GetUser().Cmp(user) == 0) + conn = pC; + pC = pC->GetNext(); + } + if (conn == NULL) + return false; + + pC = conn; + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (pT->GetFirst() != NULL) + { + // dropping some SpatiaLite-like Spatial View based on a PostgreSQL Table + virt_name = (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = + sqlite3_mprintf("DROP VIEW IF EXISTS main.\"%s\"", xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostGIS wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + MyPostGisGeometry *pG = pT->GetFirst(); + while (pG != NULL) + { + // removing from POSTGIS_GEOMETRY_COLUMNS + virt_name = + (char *) malloc((pT->GetPostGisName().Len() * 4) + 1); + strcpy(virt_name, pT->GetPostGisName().ToUTF8()); + geom_name = (char *) malloc((pG->GetName().Len() * 4) + 1); + strcpy(geom_name, pG->GetName().ToUTF8()); + sql = + sqlite3_mprintf("DELETE FROM temp.postgis_geometry_columns " + "WHERE f_table_name = %Q AND f_geometry_column = %Q", + virt_name, geom_name); + free(virt_name); + free(geom_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostGIS wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + } + pG = pG->GetNext(); + } + } + // dropping some VirtualPG Table + virt_name = (char *) malloc((pT->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pT->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + // dropping some VirtualPG View + virt_name = (char *) malloc((pV->GetVirtName().Len() * 4) + 1); + strcpy(virt_name, pV->GetVirtName().ToUTF8()); + xvirt_name = gaiaDoubleQuotedSql(virt_name); + free(virt_name); + sql = sqlite3_mprintf("DROP TABLE IF EXISTS main.\"%s\"", xvirt_name); + free(xvirt_name); + ret = sqlite3_exec(SqliteHandle, sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("PostgreSQL wrapper: ") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + } + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } +// removing the connection from the list + PostgresList.Remove(conn); + return true; +} + +bool MyFrame::DoCheckPostGisGeometry(wxString & virtName, wxString & columnName) +{ +// +// checking for a PostGIS Geometry column (wrapping View) +// + MyPostgresConn *pC = PostgresList.GetFirst(); + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (pT->GetPostGisName().Cmp(virtName) == 0) + { + MyPostGisGeometry *pG = pT->GetFirst(); + while (pG != NULL) + { + if (pG->GetName().Cmp(columnName) == 0) + return true; + pG = pG->GetNext(); + } + } + pT = pT->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } + return false; +} + +void MyFrame::InitPostgresPkColumns(MyPostgresConn * conn, + MyPostgresSchema * schema, + MyPostgresTable * table) +{ +// +// attempting to initialize the PK columns for a PostgreSQL Table +// + PGconn *pg_conn; + PGresult *res; + int nRows; + int nFields; + const char *obj; + const char *schema_name; + const char *table_name; + const char *geometry; + const char *type; + int r; + char *connection_string; + + if (table->IsPkAlreadyChecked() == true) + return; // already initialized + +// attempting to establish a connection to Postgres + connection_string = + (char *) malloc((conn->GetConnectionString().Len() * 4) + 1); + strcpy(connection_string, conn->GetConnectionString().ToUTF8()); + + pg_conn = vpgPQconnectdb(connection_string); + if (vpgPQstatus(pg_conn) != CONNECTION_OK) + { + char *msg = sqlite3_mprintf("Connection to Postgres failed: %s", + vpgPQerrorMessage(pg_conn)); + wxMessageBox(wxString::FromUTF8(msg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(msg); + vpgPQfinish(pg_conn); + free(connection_string); + return; + } + free(connection_string); + +// querying the PK columns + char *pg_schema = (char *) malloc(schema->GetName().Len() * 4 + 1); + strcpy(pg_schema, schema->GetName().ToUTF8()); + char *pg_table = (char *) malloc(table->GetName().Len() * 4 + 1); + strcpy(pg_table, table->GetName().ToUTF8()); + char *sql = + sqlite3_mprintf + ("SELECT a.attname FROM pg_index AS i " + "JOIN pg_attribute AS a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)) " + "WHERE i.indrelid = '%s.%s'::regclass AND i.indisprimary", pg_schema, + pg_table); + free(pg_schema); + free(pg_table); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + goto err; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *col_name = vpgPQgetvalue(res, r, 0); + wxString column = wxString::FromUTF8(col_name); + table->AddPK(column); + } + } + vpgPQclear(res); + vpgPQfinish(pg_conn); + table->SetPkChecked(); + return; + +err: +// something has gone the wrong way + if (res != NULL) + vpgPQclear(res); + vpgPQfinish(pg_conn); +} + +void MyFrame::InitPostgresPks(void *conn, + MyPostgresSchema * schema, + MyPostgresTable * table) +{ +// +// attempting to initialize the PK columns for a PostgreSQL Table +// + PGconn *pg_conn = (PGconn *) conn; + PGresult *res; + int nRows; + int nFields; + const char *obj; + const char *schema_name; + const char *table_name; + const char *geometry; + const char *type; + int r; + char *connection_string; + + if (table->IsPkAlreadyChecked() == true) + return; // already initialized + +// querying the PK columns + char *pg_schema = (char *) malloc(schema->GetName().Len() * 4 + 1); + strcpy(pg_schema, schema->GetName().ToUTF8()); + char *pg_table = (char *) malloc(table->GetName().Len() * 4 + 1); + strcpy(pg_table, table->GetName().ToUTF8()); + char *sql = + sqlite3_mprintf + ("SELECT a.attname FROM pg_index AS i " + "JOIN pg_attribute AS a ON (a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey)) " + "WHERE i.indrelid = '%s.%s'::regclass AND i.indisprimary", pg_schema, + pg_table); + free(pg_schema); + free(pg_table); + res = vpgPQexec(pg_conn, sql); + sqlite3_free(sql); + if (vpgPQresultStatus(res) != PGRES_TUPLES_OK) + return; + nRows = vpgPQntuples(res); + nFields = vpgPQnfields(res); + if (nRows > 0 && nFields == 1) + { + for (r = 0; r < nRows; r++) + { + const char *col_name = vpgPQgetvalue(res, r, 0); + wxString column = wxString::FromUTF8(col_name); + table->AddPK(column); + } + } + vpgPQclear(res); + table->SetPkChecked(); +} + +char *MyFrame::DropPostgreSqlOrphans() +{ +// +// attempting to Drop all PostgreSql Orphans +// + int ret; + int i; + char **results; + int rows; + int columns; + char *errMsg = NULL; + int first = 1; + char *sql_statement = NULL; + char *prev; + bool ok = false; + +// fetching all candidate Tables + const char *sql = "SELECT name FROM sqlite_master " + "WHERE type = 'table' AND name LIKE 'vpg_%' AND sql LIKE '%Using VirtualPostgres%'"; + ret = + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, &errMsg); + if (ret != SQLITE_OK) + goto error; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *name = results[(i * columns) + 0]; + wxString xName = wxString::FromUTF8(name); + if (PostgresList.FindTable(NULL, xName) == NULL) + { + // found an Orphan Table - to be dropped + char *x_name = gaiaDoubleQuotedSql(name); + if (first) + { + first = 0; + sql_statement = + sqlite3_mprintf("BEGIN;\n;DROP TABLE MAIN.\"%s\";\n", + x_name); + } else + { + prev = sql_statement; + sql_statement = + sqlite3_mprintf("%sDROP TABLE MAIN.\"%s\";\n", prev, + x_name); + sqlite3_free(prev); + } + free(x_name); + ok = true; + } + } + } + sqlite3_free_table(results); + + +// fetching all candidate Views + sql = "SELECT name FROM sqlite_master " + "WHERE type = 'view' AND name LIKE 'vpg_%' AND sql LIKE '%GeomFromEWKB%'"; + ret = + sqlite3_get_table(SqliteHandle, sql, &results, &rows, &columns, &errMsg); + if (ret != SQLITE_OK) + goto error; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *name = results[(i * columns) + 0]; + wxString xName = wxString::FromUTF8(name); + if (PostgresList.FindPostGisView(NULL, xName) == NULL) + { + // found an Orphan View - to be dropped + char *x_name = gaiaDoubleQuotedSql(name); + if (first) + { + first = 0; + sql_statement = + sqlite3_mprintf("BEGIN;\n;DROP VIEW MAIN.\"%s\";\n", + x_name); + } else + { + prev = sql_statement; + sql_statement = + sqlite3_mprintf("%sDROP VIEW MAIN.\"%s\";\n", prev, x_name); + sqlite3_free(prev); + } + free(x_name); + ok = true; + } + } + } + sqlite3_free_table(results); + if (ok == false) + return NULL; +// committing the transaction + prev = sql_statement; + sql_statement = sqlite3_mprintf("%sCOMMIT;\n", prev); + sqlite3_free(prev); + return sql_statement; + +error: + wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + return NULL; +} + +bool PostgresConnectionDialog::Create(MyFrame * parent) +{ +// +// creating the dialog +// + MainFrame = parent; + if (wxDialog::Create(parent, wxID_ANY, wxT("Connecting to PostgreSQL")) == + false) + return false; +// populates individual controls + CreateControls(); +// sets dialog sizer + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); +// centers the dialog window + Centre(); + return true; +} + +void PostgresConnectionDialog::CreateControls() +{ +// +// creating individual control and setting initial values +// + wxString user = wxGetUserId(); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + this->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// first row: HOST + wxBoxSizer *hostSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(hostSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *hostLabel = + new wxStaticText(this, wxID_STATIC, wxT("Host Name")); + hostSizer->Add(hostLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *hostCtrl = new wxTextCtrl(this, ID_POSTGRES_HOST, + wxT("localhost"), wxDefaultPosition, + wxSize(250, 22)); + hostSizer->Add(hostCtrl, 0, wxALIGN_RIGHT | wxALL, 0); +// second row: HOSTADDR + wxBoxSizer *addrSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(addrSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *addrLabel = + new wxStaticText(this, wxID_STATIC, wxT("Host Address")); + addrSizer->Add(addrLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *addrCtrl = new wxTextCtrl(this, ID_POSTGRES_HOSTADDR, + wxT("127.0.0.1"), wxDefaultPosition, + wxSize(250, 22)); + addrSizer->Add(addrCtrl, 0, wxALIGN_RIGHT | wxALL, 0); +// third row: PORT + wxBoxSizer *portSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(portSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *portLabel = new wxStaticText(this, wxID_STATIC, wxT("Port:")); + portSizer->Add(portLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *portCtrl = new wxSpinCtrl(this, ID_POSTGRES_PORT, wxT("5432"), + wxDefaultPosition, wxSize(80, 20), + wxSP_ARROW_KEYS, + 0, 65535, 5432); + portSizer->Add(portCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// fourth row: DBNAME + wxBoxSizer *dbSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(dbSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *dbLabel = new wxStaticText(this, wxID_STATIC, wxT("DB Name")); + dbSizer->Add(dbLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *dbCtrl = new wxTextCtrl(this, ID_POSTGRES_DBNAME, + user, wxDefaultPosition, + wxSize(250, 22)); + dbSizer->Add(dbCtrl, 0, wxALIGN_RIGHT | wxALL, 0); +// fifth row: USER + wxBoxSizer *userSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(userSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *userLabel = new wxStaticText(this, wxID_STATIC, wxT("User")); + userSizer->Add(userLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *userCtrl = new wxTextCtrl(this, ID_POSTGRES_USER, + user, wxDefaultPosition, + wxSize(250, 22)); + userSizer->Add(userCtrl, 0, wxALIGN_RIGHT | wxALL, 0); +// sixth row: PASSWORD + wxBoxSizer *pwdSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(pwdSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *pwdLabel = new wxStaticText(this, wxID_STATIC, wxT("Password")); + pwdSizer->Add(pwdLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *pwdCtrl = new wxTextCtrl(this, ID_POSTGRES_PASSWORD, + wxT(""), wxDefaultPosition, + wxSize(250, 22), wxTE_PASSWORD); + pwdSizer->Add(pwdCtrl, 0, wxALIGN_RIGHT | wxALL, 0); +// seventh row: Options + wxBoxSizer *optSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(optSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxString rdonly[2]; + rdonly[0] = wxT("Read Only"); + rdonly[1] = wxT("Read && Write"); + wxRadioBox *rdonly_sel = new wxRadioBox(this, ID_POSTGRES_RDONLY, + wxT("Connection Mode"), + wxDefaultPosition, + wxDefaultSize, 2, + rdonly, 2, + wxRA_SPECIFY_ROWS); + rdonly_sel->SetSelection(0); + optSizer->Add(rdonly_sel, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + + + wxString textdates[2]; + textdates[0] = wxT("as Julian Day numbers"); + textdates[1] = wxT("as PlainText strings"); + wxRadioBox *textdates_sel = new wxRadioBox(this, ID_POSTGRES_TEXTDATES, + wxT("&DATE/TIME values"), + wxDefaultPosition, + wxDefaultSize, 2, + textdates, 2, + wxRA_SPECIFY_ROWS); + textdates_sel->SetSelection(1); + optSizer->Add(textdates_sel, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// OK - CANCEL buttons + wxBoxSizer *okCancelBox = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(okCancelBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Connect")); + okCancelBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); + okCancelBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// appends event handler for OK button + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & PostgresConnectionDialog::OnOk); +} + +void PostgresConnectionDialog::OnOk(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxTextCtrl *hostCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_HOST); + wxTextCtrl *addrCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_HOSTADDR); + wxSpinCtrl *portCtrl = (wxSpinCtrl *) FindWindow(ID_POSTGRES_PORT); + wxTextCtrl *dbCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_DBNAME); + wxTextCtrl *userCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_USER); + wxTextCtrl *pwdCtrl = (wxTextCtrl *) FindWindow(ID_POSTGRES_PASSWORD); + wxRadioBox *rdonly_sel = (wxRadioBox *) FindWindow(ID_POSTGRES_RDONLY); + wxRadioBox *textdates_sel = (wxRadioBox *) FindWindow(ID_POSTGRES_TEXTDATES); + wxString value = hostCtrl->GetValue(); + if (host != NULL) + free(host); + if (value.Len() == 0) + host = NULL; + else + { + host = (char *) malloc(value.Len() * 4 + 1); + strcpy(host, value.ToUTF8()); + } + value = addrCtrl->GetValue(); + if (hostaddr != NULL) + free(hostaddr); + if (value.Len() == 0) + hostaddr = NULL; + else + { + hostaddr = (char *) malloc(value.Len() * 4 + 1); + strcpy(hostaddr, value.ToUTF8()); + } + port = portCtrl->GetValue(); + value = dbCtrl->GetValue(); + if (dbname != NULL) + free(dbname); + if (value.Len() == 0) + dbname = NULL; + else + { + dbname = (char *) malloc(value.Len() * 4 + 1); + strcpy(dbname, value.ToUTF8()); + } + value = userCtrl->GetValue(); + if (user != NULL) + free(user); + if (value.Len() == 0) + user = NULL; + else + { + user = (char *) malloc(value.Len() * 4 + 1); + strcpy(user, value.ToUTF8()); + } + value = pwdCtrl->GetValue(); + if (password != NULL) + free(password); + if (value.Len() == 0) + password = NULL; + else + { + password = (char *) malloc(value.Len() * 4 + 1); + strcpy(password, value.ToUTF8()); + } + if (rdonly_sel->GetSelection() == 0) + ReadOnly = true; + else + ReadOnly = false; + if (textdates_sel->GetSelection() == 0) + TextDates = false; + else + TextDates = true; + wxDialog::EndModal(wxID_OK); +} + +MyPostGisGeometry::MyPostGisGeometry(wxString & name, wxString & type, int srid, + int dims) +{ +// ctor + Name = name; + GeomType = type; + MultiType = false; + Srid = srid; + Dims = dims; + if (type.Len() == 0) + return; + if (type.Cmp(wxT("MULTIPOINT")) == 0) + MultiType = true; + if (type.Cmp(wxT("MULTILINESTRING")) == 0) + MultiType = true; + if (type.Cmp(wxT("MULTIPOLYGON")) == 0) + MultiType = true; + Next = NULL; +} + +MyPostgresTable::MyPostgresTable(wxString & name) +{ +// ctor + Name = name; + PkChecked = false; + GrantSelect = false; + GrantInsertUpdateDelete = false; + FirstPK = NULL; + LastPK = NULL; + First = NULL; + Last = NULL; + Next = NULL; +} + +MyPostgresTable::~MyPostgresTable() +{ +// dtor + MyPostGisGeometry *pG; + MyPostGisGeometry *pGn; + MyPostgresPK *pK; + MyPostgresPK *pKn; + pG = First; + while (pG != NULL) + { + pGn = pG->GetNext(); + delete pG; + pG = pGn; + } + pK = FirstPK; + while (pK != NULL) + { + pKn = pK->GetNext(); + delete pK; + pK = pKn; + } +} + +void MyPostgresTable::AddPK(wxString & name) +{ +// adding a PostgreSQL PK column + MyPostgresPK *pK = FirstPK; + while (pK != NULL) + { + if (pK->GetName().Cmp(name) == 0) + return; // already defined + pK = pK->GetNext(); + } + +// inserting a new PostgreSQL PK column + pK = new MyPostgresPK(name); + if (FirstPK == NULL) + FirstPK = pK; + if (LastPK != NULL) + LastPK->SetNext(pK); + LastPK = pK; +} + +void MyPostgresTable::Add(wxString & geometry, wxString & type, int srid, + int dims) +{ +// +// adding a PostGIS geometry to a Table +// + bool is_multi = false; + if (type.Len() == 0) + return; + if (type.Cmp(wxT("MULTIPOINT")) == 0) + is_multi = true; + if (type.Cmp(wxT("MULTILINESTRING")) == 0) + is_multi = true; + if (type.Cmp(wxT("MULTIPOLYGON")) == 0) + is_multi = true; + + if (geometry.Len() == 0) + return; + + MyPostGisGeometry *pG = First; + while (pG != NULL) + { + if (pG->GetName().Cmp(geometry) == 0) + return; // already defined + pG = pG->GetNext(); + } + +// inserting a new PostGIS geometry + pG = new MyPostGisGeometry(geometry, type, srid, dims); + if (First == NULL) + First = pG; + if (Last != NULL) + Last->SetNext(pG); + Last = pG; +} + +bool MyPostgresTable::IsPkColumn(wxString & name) +{ +// checks if a PostgreSQL Column is a PK column + MyPostgresPK *pK = FirstPK; + while (pK != NULL) + { + if (pK->GetName().Cmp(name) == 0) + return true; + pK = pK->GetNext(); + } + return false; +} + +bool MyPostgresTable::HasPK() +{ +// checks if a PostgreSQL Table has any PK column + if (FirstPK == NULL) + return false; + return true; +} + +MyPostGisGeometry *MyPostgresTable::Find(wxString & name) +{ +// attempting to find a Geometry Column + MyPostGisGeometry *pG = First; + while (pG != NULL) + { + if (pG->GetName().Cmp(name) == 0) + return pG; + pG = pG->GetNext(); + } + return NULL; +} + +MyPostgresView::MyPostgresView(wxString & name) +{ +// ctor + Name = name; + GrantSelect = false; + GrantInsertUpdateDelete = false; + Next = NULL; +} + +MyPostgresSchema::MyPostgresSchema(wxString & name) +{ +// ctor + Name = name; + FirstTable = NULL; + LastTable = NULL; + CurrentTable = NULL; + FirstView = NULL; + LastView = NULL; + Next = NULL; +} + +MyPostgresSchema::~MyPostgresSchema() +{ +// dtor + MyPostgresTable *pT; + MyPostgresTable *pTn; + MyPostgresView *pV; + MyPostgresView *pVn; + pT = FirstTable; + while (pT != NULL) + { + pTn = pT->GetNext(); + delete pT; + pT = pTn; + } + pV = FirstView; + while (pV != NULL) + { + pVn = pV->GetNext(); + delete pV; + pV = pVn; + } +} + +void MyPostgresSchema::Add(wxString & name, wxString & geometry, + wxString & type, int srid, int dims) +{ +// +// adding a Table to a Schema +// + MyPostgresTable *pT = CurrentTable; + if (pT != NULL) + { + if (pT->GetName().Cmp(name) == 0) + { + // continuing with the current table + if (geometry.Len() > 0 && type.Len() > 0) + pT->Add(geometry, type, srid, dims); + return; + } + } + + pT = FirstTable; + while (pT != NULL) + { + if (pT->GetName().Cmp(name) == 0) + { + // already defined + if (geometry.Len() > 0 && type.Len() > 0) + pT->Add(geometry, type, srid, dims); + return; + } + pT = pT->GetNext(); + } + +// adding a new Table + pT = new MyPostgresTable(name); + if (geometry.Len() > 0 && type.Len() > 0) + pT->Add(geometry, type, srid, dims); + if (FirstTable == NULL) + FirstTable = pT; + if (LastTable != NULL) + LastTable->SetNext(pT); + LastTable = pT; + CurrentTable = pT; +} + +void MyPostgresSchema::Add(wxString & name) +{ +// +// adding a View to a Schema +// + MyPostgresView *pV = FirstView; + while (pV != NULL) + { + if (pV->GetName().Cmp(name) == 0) + return; // already defined + pV = pV->GetNext(); + } + +// adding a new View + pV = new MyPostgresView(name); + if (FirstView == NULL) + FirstView = pV; + if (LastView != NULL) + LastView->SetNext(pV); + LastView = pV; +} + +MyPostgresConn::MyPostgresConn(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user, + bool readOnly, bool textDates) +{ +// ctor + Host = host; + HostAddr = hostaddr; + Port = port; + DbName = dbname; + User = user; + ReadOnly = readOnly; + TextDates = textDates; + First = NULL; + Last = NULL; + Current = NULL; + Prev = NULL; + Next = NULL; +} + +MyPostgresConn::~MyPostgresConn() +{ +// dtor + MyPostgresSchema *pS; + MyPostgresSchema *pSn; + pS = First; + while (pS != NULL) + { + pSn = pS->GetNext(); + delete pS; + pS = pSn; + } +} + +void MyPostgresConn::Add(wxString & schema, wxString & table, + wxString & geometry, wxString & type, int srid, + int dims) +{ +// +// adding a Table to a PostgreSQL connection +// + MyPostgresSchema *pS = Current; + if (pS != NULL) + { + if (pS->GetName().Cmp(schema) == 0) + { + // continuing with the current Schema + pS->Add(table, geometry, type, srid, dims); + return; + } + } + + pS = First; + while (pS != NULL) + { + if (pS->GetName().Cmp(schema) == 0) + { + // the Schema is already defined + pS->Add(table, geometry, type, srid, dims); + return; + } + pS = pS->GetNext(); + } + +// adding a new Schema + pS = new MyPostgresSchema(schema); + pS->Add(table, geometry, type, srid, dims); + if (First == NULL) + First = pS; + if (Last != NULL) + Last->SetNext(pS); + Last = pS; + Current = pS; +} + +void MyPostgresConn::Add(wxString & schema, wxString & view) +{ +// +// adding a View to a PostgreSQL connection +// + MyPostgresSchema *pS = Current; + if (pS != NULL) + { + if (pS->GetName().Cmp(schema) == 0) + { + // continuing with the current Schema + pS->Add(view); + return; + } + pS = pS->GetNext(); + } + + pS = First; + while (pS != NULL) + { + if (pS->GetName().Cmp(schema) == 0) + { + // the Schema is already defined + pS->Add(view); + return; + } + pS = pS->GetNext(); + } + +// adding a new Schema + pS = new MyPostgresSchema(schema); + pS->Add(view); + if (First == NULL) + First = pS; + if (Last != NULL) + Last->SetNext(pS); + Last = pS; + Current = pS; +} + +void MyPostgres::Clear() +{ +// +// memory cleanup - clearing a MyPostgres object +// + MyPostgresConn *pC; + MyPostgresConn *pCn; + pC = First; + while (pC != NULL) + { + pCn = pC->GetNext(); + delete pC; + pC = pCn; + } + First = NULL; + Last = NULL; + Current = NULL; +} + +MyPostgresConn *MyPostgres::Insert(wxString & host, wxString & hostaddr, + int port, wxString & dbname, wxString & user, + bool readOnly, bool textDates) +{ +// +// inserting into the list a new connection to PostgreSQL +// (or returning an already existing one) +// + MyPostgresConn *pC = Current; + if (pC != NULL) + { + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 + && pC->GetUser().Cmp(user) == 0) + return pC; // continuing with the current connection + } + + pC = Find(host, hostaddr, port, dbname, user); + if (pC != NULL) + return pC; // already defined + +// adding a new connection + pC = + new MyPostgresConn(host, hostaddr, port, dbname, user, readOnly, textDates); + if (First == NULL) + First = pC; + pC->SetPrev(Last); + if (Last != NULL) + Last->SetNext(pC); + Last = pC; + Current = pC; + return pC; +} + +MyPostgresConn *MyPostgres::Find(wxString & host, wxString & hostaddr, int port, + wxString & dbname, wxString & user) +{ +// +// searching for a given connection +// + MyPostgresConn *pC = First; + while (pC != NULL) + { + if (pC->GetHost().Cmp(host) == 0 && pC->GetHostAddr().Cmp(hostaddr) == 0 + && pC->GetPort() == port && pC->GetDbName().Cmp(dbname) == 0 + && pC->GetUser().Cmp(user) == 0) + return pC; + pC = pC->GetNext(); + } + return NULL; +} + +void MyPostgres::Remove(MyPostgresConn * conn) +{ +// +// removing a connection from the list +// + MyPostgresConn *pC = First; + while (pC != NULL) + { + if (pC == conn) + { + MyPostgresConn *x = pC->GetPrev(); + if (x != NULL) + x->SetNext(pC->GetNext()); + x = pC->GetNext(); + if (x != NULL) + x->SetPrev(pC->GetPrev()); + if (pC == First) + First = pC->GetNext(); + if (pC == Last) + Last = pC->GetPrev(); + if (pC == Current) + Current = Last; + delete pC; + return; + } + pC = pC->GetNext(); + } +} + +bool MyPostgres::CheckUniqueVirtName(wxString & virtName) +{ +// +// testing for PostgreSQL unique virtual names +// + MyPostgresConn *pC = First; + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (virtName.Cmp(pT->GetVirtName()) == 0) + return false; + if (virtName.Cmp(pT->GetPostGisName()) == 0) + return false; + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + if (virtName.Cmp(pV->GetVirtName()) == 0) + return false; + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } + return true; +} + +void MyPostgres::MakeUniqueVirtName(wxString & baseName, wxString & uniqueName) +{ +// +// ensuring to create PostgreSQL unique virtual names +// + if (CheckUniqueVirtName(baseName) == true) + { + uniqueName = baseName; + return; + } + + int alias = 0; + while (1) + { + wxString suffix; + suffix.Printf(wxT("_%d"), alias); + wxString test = baseName + suffix; + if (CheckUniqueVirtName(test) == true) + { + uniqueName = test; + return; + } + alias++; + } +} + +MyPostgresTable *MyPostgres::FindTable(MyFrame * parent, wxString & virtName) +{ +// attempting to retrieve a PostgreSQL Table + MyPostgresConn *pC = First; + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (virtName.Cmp(pT->GetVirtName()) == 0) + { + if (parent != NULL) + parent->InitPostgresPkColumns(pC, pS, pT); + return pT; + } + pT = pT->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } + return NULL; +} + +MyPostgresTable *MyPostgres::FindPostGisView(MyFrame * parent, + wxString & virtName) +{ +// attempting to retrieve the PostgreSQL Table supporting a PostGIS View (wrapper) + MyPostgresConn *pC = First; + while (pC != NULL) + { + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (virtName.Cmp(pT->GetPostGisName()) == 0) + { + if (parent != NULL) + parent->InitPostgresPkColumns(pC, pS, pT); + return pT; + } + pT = pT->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } + return NULL; +} + +MyPostgresColumns::~MyPostgresColumns() +{ +// dtor + MyPostgresCol *pC; + MyPostgresCol *pCn; + pC = First; + while (pC != NULL) + { + pCn = pC->GetNext(); + delete pC; + pC = pCn; + } +} + +void MyPostgresColumns::Add(wxString & name) +{ +// adding a Column into the list + MyPostgresCol *col = new MyPostgresCol(name); + if (First == NULL) + First = col; + if (Last != NULL) + Last->SetNext(col); + Last = col; +} + +void MyPostgresColumns::SetPK(wxString & name) +{ +// setting a PK Column + MyPostgresCol *pC; + pC = First; + while (pC != NULL) + { + if (pC->GetName().Cmp(name) == 0) + { + pC->SetPK(); + return; + } + pC = pC->GetNext(); + } +} + +char *MyPostgresColumns::BuildWhere() +{ +// building a WHERE clause + char *where = NULL; + char *prev; + int first = 1; + char name[1024]; + char *xname; + MyPostgresCol *pC = First; + while (pC != NULL) + { + if (pC->IsPK() == false) + { + pC = pC->GetNext(); + continue; + } + if (first) + { + first = 0; + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + where = sqlite3_mprintf("WHERE \"%s\" = OLD.\"%s\"", xname, xname); + free(xname); + } else + { + prev = where; + strcpy(name, pC->GetName().ToUTF8()); + xname = gaiaDoubleQuotedSql(name); + where = sqlite3_mprintf("%s AND \"%s\" = OLD.\"%s\"", xname, xname); + free(xname); + sqlite3_free(prev); + } + pC = pC->GetNext(); + } + return where; + +} Index: QueryView.cpp ================================================================== --- QueryView.cpp +++ QueryView.cpp @@ -2,11 +2,11 @@ / QueryView.cpp / a panel to set SQL queries / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -535,10 +535,12 @@ return true; if (str.CmpNoCase(wxT("hasGeos")) == 0) return true; if (str.CmpNoCase(wxT("hasProj")) == 0) return true; + if (str.CmpNoCase(wxT("hasProjGeodesic")) == 0) + return true; if (str.CmpNoCase(wxT("hasGeosAdvanced")) == 0) return true; if (str.CmpNoCase(wxT("hasGeosTrunk")) == 0) return true; if (str.CmpNoCase(wxT("hasGeosReentrant")) == 0) @@ -559,10 +561,14 @@ return true; if (str.CmpNoCase(wxT("hasGroundControlPoints")) == 0) return true; if (str.CmpNoCase(wxT("hasTopology")) == 0) return true; + if (str.CmpNoCase(wxT("hasKNN")) == 0) + return true; + if (str.CmpNoCase(wxT("hasRouting")) == 0) + return true; if (str.CmpNoCase(wxT("EnableGpkgAmphibiousMode")) == 0) return true; if (str.CmpNoCase(wxT("DisableGpkgAmphibiousMode")) == 0) return true; @@ -572,10 +578,16 @@ return true; if (str.CmpNoCase(wxT("DisableGpkgMode")) == 0) return true; if (str.CmpNoCase(wxT("GetGpkgMode")) == 0) return true; + if (str.CmpNoCase(wxT("EnableTinyPoint")) == 0) + return true; + if (str.CmpNoCase(wxT("DisableTInyPoint")) == 0) + return true; + if (str.CmpNoCase(wxT("IsTinyPointEnabled")) == 0) + return true; if (str.CmpNoCase(wxT("SetDecimalPrecision")) == 0) return true; if (str.CmpNoCase(wxT("GetDecimalPrecision")) == 0) return true; if (str.CmpNoCase(wxT("GetShapefileExtent")) == 0) @@ -640,10 +652,12 @@ return true; if (str.CmpNoCase(wxT("DiscardFDOGeometryColumn")) == 0) return true; if (str.CmpNoCase(wxT("InitSpatialMetaData")) == 0) return true; + if (str.CmpNoCase(wxT("InitSpatialMetaDataFull")) == 0) + return true; if (str.CmpNoCase(wxT("AddGeometryColumn")) == 0) return true; if (str.CmpNoCase(wxT("RecoverGeometryColumn")) == 0) return true; if (str.CmpNoCase(wxT("DiscardGeometryColumn")) == 0) @@ -669,10 +683,12 @@ if (str.CmpNoCase(wxT("UpgradeGeometryTriggers")) == 0) return true; if (str.CmpNoCase(wxT("CheckSpatialIndex")) == 0) return true; if (str.CmpNoCase(wxT("RecoverSpatialIndex")) == 0) + return true; + if (str.CmpNoCase(wxT("GetSpatialIndexExtent")) == 0) return true; if (str.CmpNoCase(wxT("CheckShadowedRowid")) == 0) return true; if (str.CmpNoCase(wxT("CheckWithoutRowid")) == 0) return true; @@ -781,10 +797,16 @@ if (str.CmpNoCase(wxT("XB_LoadXML")) == 0) return true; if (str.CmpNoCase(wxT("XB_StoreXML")) == 0) return true; if (str.CmpNoCase(wxT("CountUnsafeTriggers")) == 0) + return true; + if (str.CmpNoCase(wxT("IsInteger")) == 0) + return true; + if (str.CmpNoCase(wxT("IsDecimalNumber")) == 0) + return true; + if (str.CmpNoCase(wxT("IsNumber")) == 0) return true; if (str.CmpNoCase(wxT("CastToInteger")) == 0) return true; if (str.CmpNoCase(wxT("CastToDouble")) == 0) return true; @@ -809,10 +831,12 @@ if (str.CmpNoCase(wxT("FullFileNameFromPath")) == 0) return true; if (str.CmpNoCase(wxT("FileNameFromPath")) == 0) return true; if (str.CmpNoCase(wxT("FileExtFromPath")) == 0) + return true; + if (str.CmpNoCase(wxT("MakeStringList")) == 0) return true; if (str.CmpNoCase(wxT("ATM_Create")) == 0) return true; if (str.CmpNoCase(wxT("ATM_CreateTranslate")) == 0) return true; @@ -869,10 +893,12 @@ if (str.CmpNoCase(wxT("CreateRasterCoveragesTable")) == 0) return true; if (str.CmpNoCase(wxT("CreateVectorCoveragesTables")) == 0) return true; if (str.CmpNoCase(wxT("CloneTable")) == 0) + return true; + if (str.CmpNoCase(wxT("CreateClonedTable")) == 0) return true; if (str.CmpNoCase(wxT("CheckDuplicateRows")) == 0) return true; if (str.CmpNoCase(wxT("RemoveDuplicateRows")) == 0) return true; @@ -898,10 +924,83 @@ return true; if (str.CmpNoCase(wxT("ImportDXF")) == 0) return true; if (str.CmpNoCase(wxT("ImportDXFfromDir")) == 0) return true; + + if (str.CmpNoCase(wxT("SqlProc_GetLastError")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_SetLogfile")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_GetLogfile")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_FromFile")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_FromText")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_IsValid")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_NumVariables")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_VariableN")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_AllVariables")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_RawSQL")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_VarValue")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_IsValidVarValue")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_CookedSQL")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_Execute")) == 0) + return true; + if (str.CmpNoCase(wxT("SqlProc_Exit")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_CreateTables")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_Register")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_Get")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_Delete")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_UpdateTitle")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_UpdateSqlBody")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_Execute")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredProc_Exit")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_Register")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_Get")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_GetValue")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_Delete")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_UpdateTitle")) == 0) + return true; + if (str.CmpNoCase(wxT("StoredVar_UpdateValue")) == 0) + return true; + + if (str.CmpNoCase(wxT("PostgreSql_ResetLastError")) == 0) + return true; + if (str.CmpNoCase(wxT("PostgreSql_SetLastError")) == 0) + return true; + if (str.CmpNoCase(wxT("PostgreSql_GetLastError")) == 0) + return true; + + if (str.CmpNoCase(wxT("CreateRoutingNodes")) == 0) + return true; + if (str.CmpNoCase(wxT("CreateRouting")) == 0) + return true; + if (str.CmpNoCase(wxT("CreateRouting_GetLastError")) == 0) + return true; if (str.CmpNoCase(wxT("sequence_nextval")) == 0) return true; if (str.CmpNoCase(wxT("sequence_currval")) == 0) return true; @@ -968,10 +1067,14 @@ return true; if (str.CmpNoCase(wxT("Var_samp")) == 0) return true; if (str.CmpNoCase(wxT("Tan")) == 0) return true; + if (str.CmpNoCase(wxT("IsGeometryBlob")) == 0) + return true; + if (str.CmpNoCase(wxT("IsTinyPointBlob")) == 0) + return true; if (str.CmpNoCase(wxT("IsZipBlob")) == 0) return true; if (str.CmpNoCase(wxT("IsPdfBlob")) == 0) return true; if (str.CmpNoCase(wxT("IsGifBlob")) == 0) @@ -998,10 +1101,14 @@ return true; if (str.CmpNoCase(wxT("BlobToFile")) == 0) return true; if (str.CmpNoCase(wxT("ExportDXF")) == 0) return true; + if (str.CmpNoCase(wxT("TinyPointEncode")) == 0) + return true; + if (str.CmpNoCase(wxT("GeometryPointEncode")) == 0) + return true; if (str.CmpNoCase(wxT("MakePoint")) == 0) return true; if (str.CmpNoCase(wxT("ST_Point")) == 0) return true; if (str.CmpNoCase(wxT("MakePointZ")) == 0) @@ -1240,10 +1347,14 @@ return true; if (str.CmpNoCase(wxT("AsTWKB")) == 0) return true; if (str.CmpNoCase(wxT("GeomFromTWKB")) == 0) return true; + if (str.CmpNoCase(wxT("ST_AsEncodedPolyline")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_LineFromEncodedPolyline")) == 0) + return true; if (str.CmpNoCase(wxT("AsEWKT")) == 0) return true; if (str.CmpNoCase(wxT("GeomFromEWKT")) == 0) return true; if (str.CmpNoCase(wxT("CompressGeometry")) == 0) @@ -1285,10 +1396,18 @@ if (str.CmpNoCase(wxT("CastToXYZM")) == 0) return true; if (str.CmpNoCase(wxT("ST_Reverse")) == 0) return true; if (str.CmpNoCase(wxT("ST_ForceLHR")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_ForcePolygonCW")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_ForcePolygonCCW")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_IsPolygonCW")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_IsPolygonCCW")) == 0) return true; if (str.CmpNoCase(wxT("Dimension")) == 0) return true; if (str.CmpNoCase(wxT("ST_Dimension")) == 0) return true; @@ -1399,10 +1518,20 @@ if (str.CmpNoCase(wxT("ST_SimplifyPreserveTopology")) == 0) return true; if (str.CmpNoCase(wxT("GeodesicLength")) == 0) return true; if (str.CmpNoCase(wxT("GreatCircleLength")) == 0) + return true; + if (str.CmpNoCase(wxT("GeodesicArcLength")) == 0) + return true; + if (str.CmpNoCase(wxT("GeodesicChordLength")) == 0) + return true; + if (str.CmpNoCase(wxT("GeodesicCentralAngle")) == 0) + return true; + if (str.CmpNoCase(wxT("GeodesicArcArea")) == 0) + return true; + if (str.CmpNoCase(wxT("GeodesicArcHeigth")) == 0) return true; if (str.CmpNoCase(wxT("NumPoints")) == 0) return true; if (str.CmpNoCase(wxT("ST_NumPoints")) == 0) return true; @@ -1584,10 +1713,14 @@ return true; if (str.CmpNoCase(wxT("Transform")) == 0) return true; if (str.CmpNoCase(wxT("ST_Transform")) == 0) return true; + if (str.CmpNoCase(wxT("TransformXY")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_TransformXY")) == 0) + return true; if (str.CmpNoCase(wxT("ST_Shift_Longitude")) == 0) return true; if (str.CmpNoCase(wxT("NormalizeLonLat")) == 0) return true; if (str.CmpNoCase(wxT("Line_Interpolate_Point")) == 0) @@ -1670,14 +1803,26 @@ return true; if (str.CmpNoCase(wxT("ExtractMultiLinestring")) == 0) return true; if (str.CmpNoCase(wxT("ExtractMultiPolygon")) == 0) return true; + if (str.CmpNoCase(wxT("ST_AddMeasure")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_InterpolatePoint")) == 0) + return true; if (str.CmpNoCase(wxT("ST_Locate_Along_Measure")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_LocateAlong")) == 0) return true; if (str.CmpNoCase(wxT("ST_Locate_Between_Measures")) == 0) return true; + if (str.CmpNoCase(wxT("ST_LocateBetween")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_IsValidTrajectory")) == 0) + return true; + if (str.CmpNoCase(wxT("ST_TrajectoryInterpolatePoint")) == 0) + return true; if (str.CmpNoCase(wxT("SquareGrid")) == 0) return true; if (str.CmpNoCase(wxT("ST_SquareGrid")) == 0) return true; if (str.CmpNoCase(wxT("TriangularGrid")) == 0) @@ -2144,10 +2289,14 @@ return true; if (str.CmpNoCase(wxT("IsValidPixel")) == 0) return true; if (str.CmpNoCase(wxT("RL2_IsValidPixel")) == 0) return true; + if (str.CmpNoCase(wxT("IsPixelNone")) == 0) + return true; + if (str.CmpNoCase(wxT("RL2_IsPixelNone")) == 0) + return true; if (str.CmpNoCase(wxT("IsValidRasterPalette")) == 0) return true; if (str.CmpNoCase(wxT("RL2_IsValidRasterPalette")) == 0) return true; if (str.CmpNoCase(wxT("IsValidRasterStatistics")) == 0) @@ -2212,10 +2361,14 @@ return true; if (str.CmpNoCase(wxT("CreatePixel")) == 0) return true; if (str.CmpNoCase(wxT("RL2_CreatePixel")) == 0) return true; + if (str.CmpNoCase(wxT("CreatePixelNone")) == 0) + return true; + if (str.CmpNoCase(wxT("RL2_CreatePixelNone")) == 0) + return true; if (str.CmpNoCase(wxT("GetPixelType")) == 0) return true; if (str.CmpNoCase(wxT("RL2_GetPixelType")) == 0) return true; if (str.CmpNoCase(wxT("GetPixelSampleType")) == 0) @@ -2316,10 +2469,14 @@ return true; if (str.CmpNoCase(wxT("GetMapImageFromVector")) == 0) return true; if (str.CmpNoCase(wxT("RL2_GetMapImageFromVector")) == 0) return true; + if (str.CmpNoCase(wxT("GetMapImageFromWMS")) == 0) + return true; + if (str.CmpNoCase(wxT("RL2_GetMapImageFromWMS")) == 0) + return true; if (str.CmpNoCase(wxT("GetTileImage")) == 0) return true; if (str.CmpNoCase(wxT("RL2_GetTileImage")) == 0) return true; if (str.CmpNoCase(wxT("GetTripleBandTileImage")) == 0) Index: QueryViewComposer.cpp ================================================================== --- QueryViewComposer.cpp +++ QueryViewComposer.cpp @@ -2,11 +2,11 @@ / QueryViewComposer.cpp / Query/View Composer / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2009-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by DELETED QuickStyles.cpp Index: QuickStyles.cpp ================================================================== --- QuickStyles.cpp +++ QuickStyles.cpp @@ -1,9695 +0,0 @@ -/* -/ QuickStyles.cpp -/ Quick Styles wizards -/ -/ version 2.0, 2017 May 26 -/ -/ Author: Sandro Furieri a-furieri@lqt.it -/ -/ Copyright (C) 2017 Alessandro Furieri -/ -/ This program is free software: you can redistribute it and/or modify -/ it under the terms of the GNU General Public License as published by -/ the Free Software Foundation, either version 3 of the License, or -/ (at your option) any later version. -/ -/ This program is distributed in the hope that it will be useful, -/ but WITHOUT ANY WARRANTY; without even the implied warranty of -/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -/ GNU General Public License for more details. -/ -/ You should have received a copy of the GNU General Public License -/ along with this program. If not, see . -/ -*/ - -#include "Classdef.h" - -#include "wx/imaglist.h" -#include "wx/colordlg.h" -#include "wx/filename.h" -#include "wx/clipbrd.h" - -QuickStyleObj::QuickStyleObj(int type) -{ -// ctor - DoGetUUID(UUID); - Type = type; - MinScaleEnabled = false; - MaxScaleEnabled = false; - ScaleMin = 0.0; - ScaleMax = 0.0; - SymbolOpacity = 1.0; - SymbolSize = 16; - SymbolRotation = 0.0; - SymbolAnchorX = 0.5; - SymbolAnchorY = 0.5; - SymbolDisplacementX = 0.0; - SymbolDisplacementY = 0.0; - SymbolWellKnownMark = RandomWellKnownMark(); - RandomColor(SymbolFillColor); - RandomColor(SymbolStrokeColor); - LineOpacity = 1.0; - LinePerpendicularOffset = 0.0; - LineStrokeWidth = 1.0; - RandomColor(LineStrokeColor); - LineDotStyle = QUICK_STYLE_SOLID_LINE; - PolygonFill = true; - PolygonStroke = true; - PolygonDisplacementX = 0.0; - PolygonDisplacementY = 0.0; - PolygonPerpendicularOffset = 0.0; - PolygonFillOpacity = 1.0; - RandomColor(PolygonFillColor); - PolygonStrokeOpacity = 1.0; - PolygonStrokeWidth = 1.0; - RandomColor(PolygonStrokeColor); - LabelLinePlacement = true; - LabelPrint = false; - LabelColumn = NULL; - FontFacename = NULL; - FontSize = 10.0; - FontStyle = RL2_FONTSTYLE_NORMAL; - FontWeight = RL2_FONTWEIGHT_NORMAL; - FontOpacity = 1.0; - strcpy(FontColor, "#000000"); - HasHalo = false; - HaloRadius = 1.0; - HaloOpacity = 1.0; - strcpy(HaloColor, "#ffffff"); - LabelAnchorX = 0.5; - LabelAnchorY = 0.5; - LabelDisplacementX = 0.0; - LabelDisplacementY = 0.0; - LabelRotation = 0.0; - LabelPerpendicularOffset = 0.0; - RepeatedLabel = false; - LabelInitialGap = 0.0; - LabelGap = 0.0; - LabelIsAligned = false; - LabelGeneralizeLine = false; - XmlStyle = NULL; -} - -QuickStyleObj *QuickStyleObj::Clone() -{ -// -// cloning a Quick Style -// - QuickStyleObj *Style = new QuickStyleObj(this->Type); - strcpy(Style->UUID, this->UUID); - Style->MinScaleEnabled = this->MinScaleEnabled; - Style->MaxScaleEnabled = this->MaxScaleEnabled; - Style->ScaleMin = this->ScaleMin; - Style->ScaleMax = this->ScaleMax; - Style->SymbolOpacity = this->SymbolOpacity; - Style->SymbolSize = this->SymbolSize; - Style->SymbolRotation = this->SymbolRotation; - Style->SymbolAnchorX = this->SymbolAnchorX; - Style->SymbolAnchorY = this->SymbolAnchorY; - Style->SymbolDisplacementX = this->SymbolDisplacementX; - Style->SymbolDisplacementY = this->SymbolDisplacementY; - Style->SymbolWellKnownMark = this->SymbolWellKnownMark; - strcpy(Style->SymbolFillColor, this->SymbolFillColor); - strcpy(Style->SymbolStrokeColor, this->SymbolStrokeColor); - Style->LineOpacity = this->LineOpacity; - Style->LinePerpendicularOffset = this->LinePerpendicularOffset; - Style->LineStrokeWidth = this->LineStrokeWidth; - strcpy(Style->LineStrokeColor, this->LineStrokeColor); - Style->LineDotStyle = this->LineDotStyle; - Style->PolygonFill = this->PolygonFill; - Style->PolygonStroke = this->PolygonStroke; - Style->PolygonDisplacementX = this->PolygonDisplacementX; - Style->PolygonDisplacementY = this->PolygonDisplacementY; - Style->PolygonPerpendicularOffset = this->PolygonPerpendicularOffset; - Style->PolygonFillOpacity = this->PolygonFillOpacity; - strcpy(Style->PolygonFillColor, this->PolygonFillColor); - Style->PolygonStrokeOpacity = this->PolygonStrokeOpacity; - Style->PolygonStrokeWidth = this->PolygonStrokeWidth; - strcpy(Style->PolygonStrokeColor, this->PolygonStrokeColor); - Style->LabelLinePlacement = this->LabelLinePlacement; - Style->LabelPrint = this->LabelPrint; - if (this->LabelColumn == NULL) - Style->LabelColumn = NULL; - else - { - int len = strlen(this->LabelColumn); - Style->LabelColumn = (char *) malloc(len + 1); - strcpy(Style->LabelColumn, this->LabelColumn); - } - if (this->FontFacename == NULL) - Style->FontFacename = NULL; - else - { - int len = strlen(this->FontFacename); - Style->FontFacename = (char *) malloc(len + 1); - strcpy(Style->FontFacename, this->FontFacename); - } - Style->FontSize = this->FontSize; - Style->FontStyle = this->FontStyle; - Style->FontWeight = this->FontWeight; - Style->FontOpacity = this->FontOpacity; - strcpy(Style->FontColor, this->FontColor); - Style->HasHalo = this->HasHalo; - Style->HaloRadius = this->HaloRadius; - Style->HaloOpacity = this->HaloOpacity; - strcpy(Style->HaloColor, this->HaloColor); - Style->LabelAnchorX = this->LabelAnchorX; - Style->LabelAnchorY = this->LabelAnchorY; - Style->LabelDisplacementX = this->LabelDisplacementX; - Style->LabelDisplacementY = this->LabelDisplacementY; - Style->LabelRotation = this->LabelRotation; - Style->LabelPerpendicularOffset = this->LabelPerpendicularOffset; - Style->RepeatedLabel = this->RepeatedLabel; - Style->LabelInitialGap = this->LabelInitialGap; - Style->LabelGap = this->LabelGap; - Style->LabelIsAligned = this->LabelIsAligned; - Style->LabelGeneralizeLine = this->LabelGeneralizeLine; - Style->XmlStyle = NULL; - return Style; -} - -bool QuickStyleObj::Compare(QuickStyleObj * Style) -{ -// -// comparing two Quick Style objects -// - if (Style == NULL) - return false; - if (strcmp(Style->UUID, this->UUID) != 0) - return false; - if (Style->MinScaleEnabled != this->MinScaleEnabled) - return false; - if (Style->MaxScaleEnabled != this->MaxScaleEnabled) - return false; - if (Style->ScaleMin != this->ScaleMin) - return false; - if (Style->ScaleMax != this->ScaleMax) - return false; - if (Style->SymbolOpacity != this->SymbolOpacity) - return false; - if (Style->SymbolSize != this->SymbolSize) - return false; - if (Style->SymbolRotation != this->SymbolRotation) - return false; - if (Style->SymbolAnchorX != this->SymbolAnchorX) - return false; - if (Style->SymbolAnchorY != this->SymbolAnchorY) - return false; - if (Style->SymbolDisplacementX != this->SymbolDisplacementX) - return false; - if (Style->SymbolDisplacementY != this->SymbolDisplacementY) - return false; - if (Style->SymbolWellKnownMark != this->SymbolWellKnownMark) - return false; - if (strcmp(Style->SymbolFillColor, this->SymbolFillColor) != 0) - return false; - if (strcmp(Style->SymbolStrokeColor, this->SymbolStrokeColor) != 0) - return false; - if (Style->LineOpacity != this->LineOpacity) - return false; - if (Style->LinePerpendicularOffset != this->LinePerpendicularOffset) - return false; - if (Style->LineStrokeWidth != this->LineStrokeWidth) - return false; - if (strcmp(Style->LineStrokeColor, this->LineStrokeColor) != 0) - return false; - if (Style->LineDotStyle != this->LineDotStyle) - return false; - if (Style->PolygonFill != this->PolygonFill) - return false; - if (Style->PolygonStroke != this->PolygonStroke) - return false; - if (Style->PolygonDisplacementX != this->PolygonDisplacementX) - return false; - if (Style->PolygonDisplacementY != this->PolygonDisplacementY) - return false; - if (Style->PolygonPerpendicularOffset != this->PolygonPerpendicularOffset) - return false; - if (Style->PolygonFillOpacity != this->PolygonFillOpacity) - return false; - if (strcmp(Style->PolygonFillColor, this->PolygonFillColor) != 0) - return false; - if (Style->PolygonStrokeOpacity != this->PolygonStrokeOpacity) - return false; - if (Style->PolygonStrokeWidth != this->PolygonStrokeWidth) - return false; - if (strcmp(Style->PolygonStrokeColor, this->PolygonStrokeColor) != 0) - return false; - if (Style->LabelLinePlacement != this->LabelLinePlacement) - return false; - if (Style->LabelPrint != this->LabelPrint) - return false; - if (Style->LabelColumn == NULL && this->LabelColumn == NULL) - ; - else if (Style->LabelColumn == NULL && this->LabelColumn != NULL) - return false; - else if (Style->LabelColumn != NULL && this->LabelColumn == NULL) - return false; - else if (strcmp(Style->LabelColumn, this->LabelColumn) != 0) - return false; - if (Style->FontFacename == NULL && this->FontFacename == NULL) - ; - else if (Style->FontFacename == NULL && this->FontFacename != NULL) - return false; - else if (Style->FontFacename != NULL && this->FontFacename == NULL) - return false; - else if (strcmp(Style->FontFacename, this->FontFacename) != 0) - return false; - if (Style->FontSize != this->FontSize) - return false; - if (Style->FontStyle != this->FontStyle) - return false; - if (Style->FontWeight != this->FontWeight) - return false; - if (Style->FontOpacity != this->FontOpacity) - return false; - if (strcmp(Style->FontColor, this->FontColor) != 0) - return false; - if (Style->HasHalo != this->HasHalo) - return false; - if (Style->HaloRadius != this->HaloRadius) - return false; - if (Style->HaloOpacity != this->HaloOpacity) - return false; - if (strcmp(Style->HaloColor, this->HaloColor) != 0) - return false; - if (Style->LabelAnchorX != this->LabelAnchorX) - return false; - if (Style->LabelAnchorY != this->LabelAnchorY) - return false; - if (Style->LabelDisplacementX != this->LabelDisplacementX) - return false; - if (Style->LabelDisplacementY != this->LabelDisplacementY) - return false; - if (Style->LabelRotation != this->LabelRotation) - return false; - if (Style->LabelPerpendicularOffset != this->LabelPerpendicularOffset) - return false; - if (Style->RepeatedLabel != this->RepeatedLabel) - return false; - if (Style->LabelInitialGap != this->LabelInitialGap) - return false; - if (Style->LabelGap != this->LabelGap) - return false; - if (Style->LabelIsAligned != this->LabelIsAligned) - return false; - if (Style->LabelGeneralizeLine != this->LabelGeneralizeLine) - return false; - return true; -} - -void QuickStyleObj::SetLabelColumn(const char *x) -{ -// -// setting the Label Column -// - int len; - if (LabelColumn != NULL) - free(LabelColumn); - LabelColumn = NULL; - if (x == NULL) - return; - len = strlen(x); - LabelColumn = (char *) malloc(len + 1); - strcpy(LabelColumn, x); -} - -void QuickStyleObj::SetFontFacename(const char *x) -{ -// -// setting the Font Facename -// - int len; - if (FontFacename != NULL) - free(FontFacename); - FontFacename = NULL; - if (x == NULL) - return; - len = strlen(x); - FontFacename = (char *) malloc(len + 1); - strcpy(FontFacename, x); -} - -void QuickStyleObj::UpdateXmlStyle() -{ -// -// updating the XML Style -// - if (XmlStyle != NULL) - sqlite3_free(XmlStyle); - XmlStyle = CreateXmlStyle(); -} - -char *QuickStyleObj::CreateXmlStyle() -{ -// -// creating the XML Style -// - char *xml; - if ((MinScaleEnabled == true || MaxScaleEnabled == true) || LabelPrint == true - || Type == QUICK_STYLE_GEOMETRY) - xml = DoCreateFeatureTypeXML(); - else - xml = DoCreateSymbolizerXML(false); - return xml; - -} - -char *QuickStyleObj::DoCreateFeatureTypeXML() -{ -// -// creating a FeatureType XML Style -// - const char *cstr; - char *prev; - char *xml2; - char *xml = sqlite3_mprintf("\r\n"); - prev = xml; - xml = sqlite3_mprintf("%s\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t%s\r\n", prev, "Quick Style"); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Created by SpatialiteGUI"); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - xml2 = NULL; - if (Type == QUICK_STYLE_POINT) - xml2 = DoCreatePointSymbolizerXML(true); - if (Type == QUICK_STYLE_LINE) - xml2 = DoCreateLineSymbolizerXML(true); - if (Type == QUICK_STYLE_POLYGON) - xml2 = DoCreatePolygonSymbolizerXML(true); - else - { - // mixed-type Symbolizers - xml2 = DoCreatePointSymbolizerXML(true); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - xml2 = DoCreateLineSymbolizerXML(true); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - xml2 = DoCreatePolygonSymbolizerXML(true); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - xml2 = NULL; - prev = xml; - } - } - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - if (LabelPrint == true) - { - // adding a Text Symbolizer - xml2 = NULL; - if (Type == QUICK_STYLE_POINT || QUICK_STYLE_POLYGON) - xml2 = DoCreateTextPointSymbolizerXML(); - if (Type == QUICK_STYLE_LINE) - xml2 = DoCreateTextLineSymbolizerXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - } - xml = sqlite3_mprintf("%s\t\r\n\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleObj::DoCreateSymbolizerXML(bool subordered) -{ -// -// creating a Symbolizer XML Style -// - if (Type == QUICK_STYLE_POINT) - return DoCreatePointSymbolizerXML(subordered); - if (Type == QUICK_STYLE_LINE) - return DoCreateLineSymbolizerXML(subordered); - if (Type == QUICK_STYLE_POLYGON) - return DoCreatePolygonSymbolizerXML(subordered); - return NULL; -} - -char *QuickStyleObj::DoCreatePointSymbolizerXML(bool subordered) -{ -// -// creating a Point Symbolizer XML Style -// - const char *cstr; - char *prev; - const char *extra = ""; - char *xml = sqlite3_mprintf("\r\n"); - if (subordered == true) - { - extra = "\t\t"; - sqlite3_free(xml); - prev = (char *) ""; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - } else - { - prev = xml; - xml = sqlite3_mprintf("%s\r\n", - prev, cstr); - sqlite3_free(prev); - } - prev = xml; - if (subordered != true) - { - xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Quick Style - PointSymbolizer"); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Created by SpatialiteGUI"); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// mark symbol - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - switch (SymbolWellKnownMark) - { - case RL2_GRAPHIC_MARK_CIRCLE: - cstr = "circle"; - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - cstr = "triangle"; - break; - case RL2_GRAPHIC_MARK_STAR: - cstr = "star"; - break; - case RL2_GRAPHIC_MARK_CROSS: - cstr = "cross"; - break; - case RL2_GRAPHIC_MARK_X: - cstr = "x"; - break; - default: - cstr = "square"; - break; - }; - xml = - sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, - extra, cstr); - sqlite3_free(prev); - prev = xml; -// Mark Fill - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, SymbolFillColor); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// Mark Stroke - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, SymbolStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%1.2f\r\n", - prev, extra, 1.0); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (SymbolOpacity != 1.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - SymbolOpacity); - sqlite3_free(prev); - prev = xml; - } - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, SymbolSize); - sqlite3_free(prev); - prev = xml; - if (SymbolRotation != 0.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - SymbolRotation); - sqlite3_free(prev); - prev = xml; - } - if (SymbolAnchorX != 0.5 || SymbolAnchorY != 0.5) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, SymbolAnchorX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, SymbolAnchorY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (SymbolDisplacementX != 0.0 || SymbolDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, SymbolDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, SymbolDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleObj::DoCreateLineSymbolizerXML(bool subordered) -{ -// -// creating a Line Symbolizer XML Style -// - const char *cstr; - char *prev; - const char *extra = ""; - char *xml = sqlite3_mprintf("\r\n"); - prev = xml; - if (subordered == true) - { - extra = "\t\t"; - sqlite3_free(xml); - prev = (char *) ""; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - } else - { - xml = sqlite3_mprintf("%s\r\n", - prev, cstr); - sqlite3_free(prev); - } - prev = xml; - if (subordered != true) - { - xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Quick Style - LineSymbolizer"); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Created by SpatialiteGUI"); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, extra, - LineStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, LineOpacity); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, LineStrokeWidth); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - const char *dashArray; - switch (LineDotStyle) - { - case QUICK_STYLE_DOT_LINE: - dashArray = "5.0, 10.0"; - break; - case QUICK_STYLE_DASH_LINE: - dashArray = "20.0, 20.0"; - break; - case QUICK_STYLE_DASH_DOT_LINE: - dashArray = "20.0, 10.0, 5.0, 10.0"; - break; - default: - dashArray = NULL; - break; - }; - if (dashArray != NULL) - { - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", - prev, extra, dashArray); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (LinePerpendicularOffset != 0.0) - { - xml = - sqlite3_mprintf - ("%s%s\t%1.2f\r\n", prev, - extra, LinePerpendicularOffset); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleObj::DoCreatePolygonSymbolizerXML(bool subordered) -{ -// -// creating a Polygon Symbolizer XML Style -// - const char *cstr; - char *prev; - const char *extra = ""; - char *xml = sqlite3_mprintf("\r\n"); - prev = xml; - if (subordered == true) - { - extra = "\t\t"; - sqlite3_free(xml); - prev = (char *) ""; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - } else - { - xml = sqlite3_mprintf("%s\r\n", - prev, cstr); - sqlite3_free(prev); - } - prev = xml; - if (subordered != true) - { - xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Quick Style - Polygon Symbolizer"); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Created by SpatialiteGUI"); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - if (PolygonFill == true) - { - // Polygon Fill - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - // using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, - extra, PolygonFillColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, PolygonFillOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (PolygonStroke == true) - { - // Polygon Stroke - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - // using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, - extra, PolygonStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, PolygonStrokeOpacity); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, PolygonStrokeWidth); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (PolygonDisplacementX != 0.0 || PolygonDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t%1.4f\r\n", - prev, extra, PolygonDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t%1.4f\r\n", - prev, extra, PolygonDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (PolygonPerpendicularOffset != 0.0) - { - xml = - sqlite3_mprintf - ("%s%s\t%1.4f\r\n", prev, - extra, PolygonPerpendicularOffset); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleObj::DoCreateTextPointSymbolizerXML() -{ -// -// creating a Text Symbolizer (Point Placement) -// - const char *cstr; - char *xml; - char *prev; - xml = sqlite3_mprintf("\t\t\r\n"); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev, LabelColumn); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%s\r\n", prev, - FontFacename); - sqlite3_free(prev); - prev = xml; - if (FontStyle == RL2_FONTSTYLE_ITALIC) - xml = - sqlite3_mprintf - ("%s\t\t\t\titalic\r\n", - prev); - else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) - xml = - sqlite3_mprintf - ("%s\t\t\t\toblique\r\n", - prev); - else - xml = - sqlite3_mprintf - ("%s\t\t\t\tnormal\r\n", - prev); - sqlite3_free(prev); - prev = xml; - if (FontWeight == RL2_FONTWEIGHT_BOLD) - xml = - sqlite3_mprintf - ("%s\t\t\t\tbold\r\n", - prev); - else - xml = - sqlite3_mprintf - ("%s\t\t\t\tnormal\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%1.2f\r\n", - prev, FontSize); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\n", prev); - sqlite3_free(prev); - prev = xml; -// PointPlacement - xml = sqlite3_mprintf("%s\t\t\t\t\n", prev); - sqlite3_free(prev); - prev = xml; - if (LabelAnchorX != 0.5 || LabelAnchorY != 0.5) - { - xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t\t%1.4f\r\n", prev, - LabelAnchorX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t\t%1.4f\r\n", prev, - LabelAnchorY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - if (LabelDisplacementX != 0.0 || LabelDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t\t%1.4f\r\n", prev, - LabelDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t\t%1.4f\r\n", prev, - LabelDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - if (LabelRotation != 0.0) - { - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%1.2f\r\n", prev, LabelRotation); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (HasHalo == true) - { - // Halo - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", prev, - HaloRadius); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%s\r\n", - prev, HaloColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%1.2f\r\n", - prev, HaloOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%s\r\n", prev, - FontColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%1.2f\r\n", - prev, FontOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleObj::DoCreateTextLineSymbolizerXML() -{ -// -// creating a Text Symbolizer (Line Placement) -// - const char *cstr; - char *xml; - char *prev; - xml = sqlite3_mprintf("\t\t\r\n"); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev, LabelColumn); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%s\r\n", prev, - FontFacename); - sqlite3_free(prev); - prev = xml; - if (FontStyle == RL2_FONTSTYLE_ITALIC) - xml = - sqlite3_mprintf - ("%s\t\t\t\titalic\r\n", - prev); - else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) - xml = - sqlite3_mprintf - ("%s\t\t\t\toblique\r\n", - prev); - else - xml = - sqlite3_mprintf - ("%s\t\t\t\tnormal\r\n", - prev); - sqlite3_free(prev); - prev = xml; - if (FontWeight == RL2_FONTWEIGHT_BOLD) - xml = - sqlite3_mprintf - ("%s\t\t\t\tbold\r\n", - prev); - else - xml = - sqlite3_mprintf - ("%s\t\t\t\tnormal\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%1.2f\r\n", - prev, FontSize); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\n", prev); - sqlite3_free(prev); - prev = xml; -// LinePlacement - xml = sqlite3_mprintf("%s\t\t\t\t\n", prev); - sqlite3_free(prev); - prev = xml; - if (LabelPerpendicularOffset != 0.0) - { - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%1.4f\r\n", - prev, LabelPerpendicularOffset); - sqlite3_free(prev); - prev = xml; - } - if (RepeatedLabel == true) - { - // Repeated: InitialGap and Gap - xml = - sqlite3_mprintf("%s\t\t\t\t\ttrue\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%1.4f\r\n", prev, - LabelInitialGap); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\t%1.4f\r\n", prev, LabelGap); - sqlite3_free(prev); - prev = xml; - } - if (LabelIsAligned == true) - { - xml = - sqlite3_mprintf("%s\t\t\t\t\ttrue\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - if (LabelGeneralizeLine == true) - { - xml = - sqlite3_mprintf - ("%s\t\t\t\t\ttrue\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (HasHalo == true) - { - // Halo - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", prev, - HaloRadius); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%s\r\n", - prev, HaloColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t\t%1.2f\r\n", - prev, HaloOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%s\r\n", prev, - FontColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\t%1.2f\r\n", - prev, FontOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -const unsigned char *QuickStyleObj::CloneXmlStyle() -{ -// -// cloning the XML Style definition -// - if (XmlStyle == NULL) - XmlStyle = CreateXmlStyle(); - if (XmlStyle == NULL) - return NULL; - int len = strlen(XmlStyle); - char *cloned = (char *) malloc(len + 1); - strcpy(cloned, XmlStyle); - return (const unsigned char *) cloned; -} - -void QuickStyleObj::DoGetUUID(char *uuid) -{ -// -// creating an UUID value -// - unsigned char rnd[16]; - char *p = uuid; - int i; - sqlite3_randomness(16, rnd); - for (i = 0; i < 16; i++) - { - if (i == 4 || i == 6 || i == 8 || i == 10) - *p++ = '-'; - sprintf(p, "%02x", rnd[i]); - p += 2; - } - *p = '\0'; - uuid[14] = '4'; - uuid[19] = '8'; -} - -int QuickStyleObj::RandomWellKnownMark() -{ -// -// returning a random Symbol Well Known Mark -// - int wkt; - int mod = rand() % 6; - switch (mod) - { - case 0: - wkt = RL2_GRAPHIC_MARK_SQUARE; - break; - case 1: - wkt = RL2_GRAPHIC_MARK_CIRCLE; - break; - case 2: - wkt = RL2_GRAPHIC_MARK_TRIANGLE; - break; - case 3: - wkt = RL2_GRAPHIC_MARK_STAR; - break; - case 4: - wkt = RL2_GRAPHIC_MARK_CROSS; - break; - default: - wkt = RL2_GRAPHIC_MARK_X; - break; - }; - return wkt; -} - -void QuickStyleObj::RandomColor(char *color) -{ -// -// setting a random Color -// - unsigned char red = rand() % 256; - unsigned char green = rand() % 256; - unsigned char blue = rand() % 256; - sprintf(color, "#%02x%02x%02x", red, green, blue); -} - -QuickStyleTopologyObj::QuickStyleTopologyObj(int type) -{ -// ctor - QuickStyleObj::DoGetUUID(UUID); - Type = type; - MinScaleEnabled = false; - MaxScaleEnabled = false; - ScaleMin = 0.0; - ScaleMax = 0.0; - NodeOpacity = 1.0; - NodeSize = 16; - NodeRotation = 0.0; - NodeAnchorX = 0.5; - NodeAnchorY = 0.5; - NodeDisplacementX = 0.0; - NodeDisplacementY = 0.0; - NodeWellKnownMark = QuickStyleObj::RandomWellKnownMark(); - QuickStyleObj::RandomColor(NodeFillColor); - QuickStyleObj::RandomColor(NodeStrokeColor); - EdgeLinkOpacity = 1.0; - EdgeLinkPerpendicularOffset = 0.0; - EdgeLinkStrokeWidth = 1.0; - QuickStyleObj::RandomColor(EdgeLinkStrokeColor); - EdgeLinkDotStyle = QUICK_STYLE_SOLID_LINE; - FaceFill = true; - FaceStroke = true; - FaceDisplacementX = 0.0; - FaceDisplacementY = 0.0; - FacePerpendicularOffset = 0.0; - FaceFillOpacity = 1.0; - QuickStyleObj::RandomColor(FaceFillColor); - FaceStrokeOpacity = 1.0; - FaceStrokeWidth = 1.0; - QuickStyleObj::RandomColor(FaceStrokeColor); - EdgeLinkSeedOpacity = 1.0; - EdgeLinkSeedSize = 16; - EdgeLinkSeedRotation = 0.0; - EdgeLinkSeedAnchorX = 0.5; - EdgeLinkSeedAnchorY = 0.5; - EdgeLinkSeedDisplacementX = 0.0; - EdgeLinkSeedDisplacementY = 0.0; - EdgeLinkSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); - QuickStyleObj::RandomColor(EdgeLinkSeedFillColor); - QuickStyleObj::RandomColor(EdgeLinkSeedStrokeColor); - FaceSeedOpacity = 1.0; - FaceSeedSize = 16; - FaceSeedRotation = 0.0; - FaceSeedAnchorX = 0.5; - FaceSeedAnchorY = 0.5; - FaceSeedDisplacementX = 0.0; - FaceSeedDisplacementY = 0.0; - FaceSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); - QuickStyleObj::RandomColor(FaceSeedFillColor); - QuickStyleObj::RandomColor(FaceSeedStrokeColor); - XmlStyle = NULL; -} - -QuickStyleTopologyObj *QuickStyleTopologyObj::Clone() -{ -// -// cloning a Quick Style Topology -// - QuickStyleTopologyObj *Style = new QuickStyleTopologyObj(this->Type); - strcpy(Style->UUID, this->UUID); - Style->MinScaleEnabled = this->MinScaleEnabled; - Style->MaxScaleEnabled = this->MaxScaleEnabled; - Style->ScaleMin = this->ScaleMin; - Style->ScaleMax = this->ScaleMax; - Style->NodeOpacity = this->NodeOpacity; - Style->NodeSize = this->NodeSize; - Style->NodeRotation = this->NodeRotation; - Style->NodeAnchorX = this->NodeAnchorX; - Style->NodeAnchorY = this->NodeAnchorY; - Style->NodeDisplacementX = this->NodeDisplacementX; - Style->NodeDisplacementY = this->NodeDisplacementY; - Style->NodeWellKnownMark = this->NodeWellKnownMark; - strcpy(Style->NodeFillColor, this->NodeFillColor); - strcpy(Style->NodeStrokeColor, this->NodeStrokeColor); - Style->EdgeLinkOpacity = this->EdgeLinkOpacity; - Style->EdgeLinkPerpendicularOffset = this->EdgeLinkPerpendicularOffset; - Style->EdgeLinkStrokeWidth = this->EdgeLinkStrokeWidth; - strcpy(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor); - Style->EdgeLinkDotStyle = this->EdgeLinkDotStyle; - Style->FaceFill = this->FaceFill; - Style->FaceStroke = this->FaceStroke; - Style->FaceDisplacementX = this->FaceDisplacementX; - Style->FaceDisplacementY = this->FaceDisplacementY; - Style->FacePerpendicularOffset = this->FacePerpendicularOffset; - Style->FaceFillOpacity = this->FaceFillOpacity; - strcpy(Style->FaceFillColor, this->FaceFillColor); - Style->FaceStrokeOpacity = this->FaceStrokeOpacity; - Style->FaceStrokeWidth = this->FaceStrokeWidth; - strcpy(Style->FaceStrokeColor, this->FaceStrokeColor); - Style->EdgeLinkSeedOpacity = this->EdgeLinkSeedOpacity; - Style->EdgeLinkSeedSize = this->EdgeLinkSeedSize; - Style->EdgeLinkSeedRotation = this->EdgeLinkSeedRotation; - Style->EdgeLinkSeedAnchorX = this->EdgeLinkSeedAnchorX; - Style->EdgeLinkSeedAnchorY = this->EdgeLinkSeedAnchorY; - Style->EdgeLinkSeedDisplacementX = this->EdgeLinkSeedDisplacementX; - Style->EdgeLinkSeedDisplacementY = this->EdgeLinkSeedDisplacementY; - Style->EdgeLinkSeedWellKnownMark = this->EdgeLinkSeedWellKnownMark; - strcpy(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor); - strcpy(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor); - Style->FaceSeedOpacity = this->FaceSeedOpacity; - Style->FaceSeedSize = this->FaceSeedSize; - Style->FaceSeedRotation = this->FaceSeedRotation; - Style->FaceSeedAnchorX = this->FaceSeedAnchorX; - Style->FaceSeedAnchorY = this->FaceSeedAnchorY; - Style->FaceSeedDisplacementX = this->FaceSeedDisplacementX; - Style->FaceSeedDisplacementY = this->FaceSeedDisplacementY; - Style->FaceSeedWellKnownMark = this->FaceSeedWellKnownMark; - strcpy(Style->FaceSeedFillColor, this->FaceSeedFillColor); - strcpy(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor); - Style->XmlStyle = NULL; - return Style; -} - -bool QuickStyleTopologyObj::Compare(QuickStyleTopologyObj * Style) -{ -// -// comparing two Quick Style objects (Topology) -// - if (strcmp(Style->UUID, this->UUID) != 0) - return false; - if (Style->MinScaleEnabled != this->MinScaleEnabled) - return false; - if (Style->MaxScaleEnabled != this->MaxScaleEnabled) - return false; - if (Style->ScaleMin != this->ScaleMin) - return false; - if (Style->ScaleMax != this->ScaleMax) - return false; - if (Style->NodeOpacity != this->NodeOpacity) - return false; - if (Style->NodeSize != this->NodeSize) - return false; - if (Style->NodeRotation != this->NodeRotation) - return false; - if (Style->NodeAnchorX != this->NodeAnchorX) - return false; - if (Style->NodeAnchorY != this->NodeAnchorY) - return false; - if (Style->NodeDisplacementX != this->NodeDisplacementX) - return false; - if (Style->NodeDisplacementY != this->NodeDisplacementY) - return false; - if (Style->NodeWellKnownMark != this->NodeWellKnownMark) - return false; - if (strcmp(Style->NodeFillColor, this->NodeFillColor) != 0) - return false; - if (strcmp(Style->NodeStrokeColor, this->NodeStrokeColor) != 0) - return false; - if (Style->EdgeLinkOpacity != this->EdgeLinkOpacity) - return false; - if (Style->EdgeLinkPerpendicularOffset != this->EdgeLinkPerpendicularOffset) - return false; - if (Style->EdgeLinkStrokeWidth != this->EdgeLinkStrokeWidth) - return false; - if (strcmp(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor) != 0) - return false; - if (Style->EdgeLinkDotStyle != this->EdgeLinkDotStyle) - return false; - if (Style->FaceFill != this->FaceFill) - return false; - if (Style->FaceStroke != this->FaceStroke) - return false; - if (Style->FaceDisplacementX != this->FaceDisplacementX) - return false; - if (Style->FaceDisplacementY != this->FaceDisplacementY) - return false; - if (Style->FacePerpendicularOffset != this->FacePerpendicularOffset) - return false; - if (Style->FaceFillOpacity != this->FaceFillOpacity) - return false; - if (strcmp(Style->FaceFillColor, this->FaceFillColor) != 0) - return false; - if (Style->FaceStrokeOpacity != this->FaceStrokeOpacity) - return false; - if (Style->FaceStrokeWidth != this->FaceStrokeWidth) - return false; - if (strcmp(Style->FaceStrokeColor, this->FaceStrokeColor) != 0) - return false; - if (Style->EdgeLinkSeedOpacity != this->EdgeLinkSeedOpacity) - return false; - if (Style->EdgeLinkSeedSize != this->EdgeLinkSeedSize) - return false; - if (Style->EdgeLinkSeedRotation != this->EdgeLinkSeedRotation) - return false; - if (Style->EdgeLinkSeedAnchorX != this->EdgeLinkSeedAnchorX) - return false; - if (Style->EdgeLinkSeedAnchorY != this->EdgeLinkSeedAnchorY) - return false; - if (Style->EdgeLinkSeedDisplacementX != this->EdgeLinkSeedDisplacementX) - return false; - if (Style->EdgeLinkSeedDisplacementY != this->EdgeLinkSeedDisplacementY) - return false; - if (Style->EdgeLinkSeedWellKnownMark != this->EdgeLinkSeedWellKnownMark) - return false; - if (strcmp(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor) != 0) - return false; - if (strcmp(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor) != - 0) - return false; - if (Style->FaceSeedOpacity != this->FaceSeedOpacity) - return false; - if (Style->FaceSeedSize != this->FaceSeedSize) - return false; - if (Style->FaceSeedRotation != this->FaceSeedRotation) - return false; - if (Style->FaceSeedAnchorX != this->FaceSeedAnchorX) - return false; - if (Style->FaceSeedAnchorY != this->FaceSeedAnchorY) - return false; - if (Style->FaceSeedDisplacementX != this->FaceSeedDisplacementX) - return false; - if (Style->FaceSeedDisplacementY != this->FaceSeedDisplacementY) - return false; - if (Style->FaceSeedWellKnownMark != this->FaceSeedWellKnownMark) - return false; - if (strcmp(Style->FaceSeedFillColor, this->FaceSeedFillColor) != 0) - return false; - if (strcmp(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor) != 0) - return false; - return true; -} - -void QuickStyleTopologyObj::UpdateXmlStyle() -{ -// -// updating the XML Style -// - if (XmlStyle != NULL) - sqlite3_free(XmlStyle); - XmlStyle = CreateXmlStyle(); -} - -char *QuickStyleTopologyObj::CreateXmlStyle() -{ -// -// creating the XML Style -// - const char *cstr; - char *prev; - char *xml2; - char *xml = sqlite3_mprintf("\r\n"); - prev = xml; - xml = sqlite3_mprintf("%s\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Quick Style - Topology"); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t%s\r\n", prev, - "Created by SpatialiteGUI"); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (Type == MAP_LAYER_NETWORK) - { - // Links - xml2 = DoCreateEdgeLinkXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // Nodes - xml2 = DoCreateNodeXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // LinkSeeds - xml2 = DoCreateEdgeLinkSeedXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - } else - { - // Faces - xml2 = DoCreateFaceXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // Edges - xml2 = DoCreateEdgeLinkXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // Nodes - xml2 = DoCreateNodeXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // EdgeSeeds - xml2 = DoCreateEdgeLinkSeedXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - // EdgeSeeds - xml2 = DoCreateFaceSeedXML(); - if (xml2 != NULL) - { - xml = sqlite3_mprintf("%s%s", prev, xml2); - sqlite3_free(prev); - sqlite3_free(xml2); - prev = xml; - } - } - xml = sqlite3_mprintf("%s\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleTopologyObj::DoCreateFaceXML() -{ -// -// creating the XML Style - Face -// - const char *cstr; - char *prev; - char *xml = sqlite3_mprintf("\t\r\n"); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\tFace\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\ttopoclass\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\tface\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - - const char *extra = "\t\t"; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - prev = xml; - if (FaceFill == true) - { - // Polygon Fill - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - // using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, - extra, FaceFillColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, FaceFillOpacity); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (FaceStroke == true) - { - // Polygon Stroke - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - // using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, - extra, FaceStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, FaceStrokeOpacity); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, FaceStrokeWidth); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (FaceDisplacementX != 0.0 || FaceDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t%1.4f\r\n", - prev, extra, FaceDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t%1.4f\r\n", - prev, extra, FaceDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (FacePerpendicularOffset != 0.0) - { - xml = - sqlite3_mprintf - ("%s%s\t%1.4f\r\n", prev, - extra, FacePerpendicularOffset); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleTopologyObj::DoCreateEdgeLinkXML() -{ -// -// creating the XML Style - Edge or Link -// - const char *cstr; - char *prev; - char *xml = sqlite3_mprintf("\t\r\n"); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - if (Type == MAP_LAYER_NETWORK) - xml = sqlite3_mprintf("%s\t\tLink\r\n", prev); - else - xml = sqlite3_mprintf("%s\t\tEdge\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\ttopoclass\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (Type == MAP_LAYER_NETWORK) - xml = - sqlite3_mprintf("%s\t\t\t\tlink\r\n", prev); - else - xml = - sqlite3_mprintf("%s\t\t\t\tedge\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - - const char *extra = "\t\t"; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// using a Solid Color - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", prev, extra, - EdgeLinkStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, EdgeLinkOpacity); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t%1.2f\r\n", - prev, extra, EdgeLinkStrokeWidth); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - const char *dashArray; - switch (EdgeLinkDotStyle) - { - case QUICK_STYLE_DOT_LINE: - dashArray = "5.0, 10.0"; - break; - case QUICK_STYLE_DASH_LINE: - dashArray = "20.0, 20.0"; - break; - case QUICK_STYLE_DASH_DOT_LINE: - dashArray = "20.0, 10.0, 5.0, 10.0"; - break; - default: - dashArray = NULL; - break; - }; - if (dashArray != NULL) - { - xml = - sqlite3_mprintf - ("%s%s\t\t%s\r\n", - prev, extra, dashArray); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (EdgeLinkPerpendicularOffset != 0.0) - { - xml = - sqlite3_mprintf - ("%s%s\t%1.2f\r\n", prev, - extra, EdgeLinkPerpendicularOffset); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleTopologyObj::DoCreateNodeXML() -{ -// -// creating the XML Style - Node -// - const char *cstr; - char *prev; - char *xml = sqlite3_mprintf("\t\r\n"); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\tNode\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\ttopoclass\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\tnode\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - - const char *extra = "\t\t"; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// mark symbol - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - switch (NodeWellKnownMark) - { - case RL2_GRAPHIC_MARK_CIRCLE: - cstr = "circle"; - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - cstr = "triangle"; - break; - case RL2_GRAPHIC_MARK_STAR: - cstr = "star"; - break; - case RL2_GRAPHIC_MARK_CROSS: - cstr = "cross"; - break; - case RL2_GRAPHIC_MARK_X: - cstr = "x"; - break; - default: - cstr = "square"; - break; - }; - xml = - sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, - extra, cstr); - sqlite3_free(prev); - prev = xml; -// Mark Fill - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, NodeFillColor); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// Mark Stroke - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, NodeStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%1.2f\r\n", - prev, extra, 1.0); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (NodeOpacity != 1.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - NodeOpacity); - sqlite3_free(prev); - prev = xml; - } - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, NodeSize); - sqlite3_free(prev); - prev = xml; - if (NodeRotation != 0.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - NodeRotation); - sqlite3_free(prev); - prev = xml; - } - if (NodeAnchorX != 0.5 || NodeAnchorY != 0.5) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, NodeAnchorX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, NodeAnchorY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (NodeDisplacementX != 0.0 || NodeDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, NodeDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, NodeDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleTopologyObj::DoCreateEdgeLinkSeedXML() -{ -// -// creating the XML Style - Edge or Link Seed -// - const char *cstr; - char *prev; - char *xml = sqlite3_mprintf("\t\r\n"); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - if (Type == MAP_LAYER_NETWORK) - xml = sqlite3_mprintf("%s\t\tLinkSeed\r\n", prev); - else - xml = sqlite3_mprintf("%s\t\tEdgeSeed\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\ttopoclass\r\n", prev); - sqlite3_free(prev); - prev = xml; - if (Type == MAP_LAYER_NETWORK) - xml = - sqlite3_mprintf("%s\t\t\t\tlink_seed\r\n", - prev); - else - xml = - sqlite3_mprintf("%s\t\t\t\tedge_seed\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - - const char *extra = "\t\t"; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// mark symbol - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - switch (EdgeLinkSeedWellKnownMark) - { - case RL2_GRAPHIC_MARK_CIRCLE: - cstr = "circle"; - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - cstr = "triangle"; - break; - case RL2_GRAPHIC_MARK_STAR: - cstr = "star"; - break; - case RL2_GRAPHIC_MARK_CROSS: - cstr = "cross"; - break; - case RL2_GRAPHIC_MARK_X: - cstr = "x"; - break; - default: - cstr = "square"; - break; - }; - xml = - sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, - extra, cstr); - sqlite3_free(prev); - prev = xml; -// Mark Fill - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, EdgeLinkSeedFillColor); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// Mark Stroke - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, EdgeLinkSeedStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%1.2f\r\n", - prev, extra, 1.0); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (EdgeLinkSeedOpacity != 1.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - EdgeLinkSeedOpacity); - sqlite3_free(prev); - prev = xml; - } - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - EdgeLinkSeedSize); - sqlite3_free(prev); - prev = xml; - if (EdgeLinkSeedRotation != 0.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - EdgeLinkSeedRotation); - sqlite3_free(prev); - prev = xml; - } - if (EdgeLinkSeedAnchorX != 0.5 || EdgeLinkSeedAnchorY != 0.5) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, EdgeLinkSeedAnchorX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, EdgeLinkSeedAnchorY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (EdgeLinkSeedDisplacementX != 0.0 || EdgeLinkSeedDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, EdgeLinkSeedDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, EdgeLinkSeedDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -char *QuickStyleTopologyObj::DoCreateFaceSeedXML() -{ -// -// creating the XML Style - FaceSeed -// - const char *cstr; - char *prev; - char *xml = sqlite3_mprintf("\t\r\n"); - prev = xml; - if (MinScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMin); - sqlite3_free(prev); - prev = xml; - } - if (MaxScaleEnabled == true) - { - xml = - sqlite3_mprintf - ("%s\t\t%1.2f\r\n", prev, - ScaleMax); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s\t\tFaceSeed\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s\t\t\t\ttopoclass\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\tface_seed\r\n", prev); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", - prev); - sqlite3_free(prev); - prev = xml; - - const char *extra = "\t\t"; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// mark symbol - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - switch (FaceSeedWellKnownMark) - { - case RL2_GRAPHIC_MARK_CIRCLE: - cstr = "circle"; - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - cstr = "triangle"; - break; - case RL2_GRAPHIC_MARK_STAR: - cstr = "star"; - break; - case RL2_GRAPHIC_MARK_CROSS: - cstr = "cross"; - break; - case RL2_GRAPHIC_MARK_X: - cstr = "x"; - break; - default: - cstr = "square"; - break; - }; - xml = - sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, - extra, cstr); - sqlite3_free(prev); - prev = xml; -// Mark Fill - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, FaceSeedFillColor); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; -// Mark Stroke - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%s\r\n", - prev, extra, FaceSeedStrokeColor); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\t%1.2f\r\n", - prev, extra, 1.0); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf - ("%s%s\t\t\t\tround\r\n", - prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - if (FaceSeedOpacity != 1.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - FaceSeedOpacity); - sqlite3_free(prev); - prev = xml; - } - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - FaceSeedSize); - sqlite3_free(prev); - prev = xml; - if (FaceSeedRotation != 0.0) - { - xml = - sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, - FaceSeedRotation); - sqlite3_free(prev); - prev = xml; - } - if (FaceSeedAnchorX != 0.5 || FaceSeedAnchorY != 0.5) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, FaceSeedAnchorX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, FaceSeedAnchorY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - if (FaceSeedDisplacementX != 0.0 || FaceSeedDisplacementY != 0.0) - { - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, FaceSeedDisplacementX); - sqlite3_free(prev); - prev = xml; - xml = - sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", - prev, extra, FaceSeedDisplacementY); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - } - xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s%s\r\n", prev, extra); - sqlite3_free(prev); - prev = xml; - xml = sqlite3_mprintf("%s\t\r\n", prev); - sqlite3_free(prev); - return xml; -} - -const unsigned char *QuickStyleTopologyObj::CloneXmlStyle() -{ -// -// cloning the XML Style definition -// - if (XmlStyle == NULL) - XmlStyle = CreateXmlStyle(); - if (XmlStyle == NULL) - return NULL; - int len = strlen(XmlStyle); - char *cloned = (char *) malloc(len + 1); - strcpy(cloned, XmlStyle); - return (const unsigned char *) cloned; -} - -bool QuickStyleVectorDialog::Create(MyMapPanel * parent, MapLayer * layer, - int type) -{ -// -// creating the dialog -// - MainFrame = parent->GetParent(); - MapPanel = parent; - Layer = layer; - Type = type; - DbPrefix = layer->GetDbPrefix(); - LayerName = layer->GetName(); - IsConfigChanged = false; - - if (wxPropertySheetDialog::Create - (parent, wxID_ANY, wxT("QuickStyle (Vector) Edit")) == false) - return false; - if (Layer->GetQuickStyle() != NULL) - Style = Layer->CloneQuickStyle(); - else - Style = new QuickStyleObj(Type); - - wxBookCtrlBase *book = GetBookCtrl(); -// creates individual panels - int next = 1; - PagePointIndex = 0; - PageLineIndex = 0; - PagePolygonIndex = 0; - PageTextPointIndex = 0; - PageTextLineIndex = 0; - wxPanel *mainPage = CreateMainPage(book); - book->AddPage(mainPage, wxT("General"), true); - if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_GEOMETRY) - { - wxPanel *pointPage = CreatePointPage(book); - book->AddPage(pointPage, wxT("Point Symbolizer"), false); - PagePointIndex = next++; - } - if (Type == QUICK_STYLE_LINE || Type == QUICK_STYLE_GEOMETRY) - { - wxPanel *linePage = CreateLinePage(book); - book->AddPage(linePage, wxT("Line Symbolyzer"), false); - PageLineIndex = next++; - } - if (Type == QUICK_STYLE_POLYGON || Type == QUICK_STYLE_GEOMETRY) - { - wxPanel *polygonPage = CreatePolygonPage(book); - book->AddPage(polygonPage, wxT("Polygon Symbolizer"), false); - PagePolygonIndex = next++; - } - if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) - { - wxPanel *textPointPage = CreateTextPointPage(book); - book->AddPage(textPointPage, wxT("Text Symbolizer"), false); - PageTextPointIndex = next++; - } - if (Type == QUICK_STYLE_LINE) - { - wxPanel *textLinePage = CreateTextLinePage(book); - book->AddPage(textLinePage, wxT("Text Symbolizer"), false); - PageTextLineIndex = next++; - } - - CreateButtons(); - LayoutDialog(); -// appends event handler for TAB/PAGE changing - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanging); - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanged); -// appends event handler for buttons - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnQuit); - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnOk); - Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnApply); - Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnExport); - Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCopy); -// centers the dialog window - Centre(); - UpdateMainPage(); - return true; -} - -void QuickStyleVectorDialog::CreateButtons() -{ -// -// adding the common Buttons -// - wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); - wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); - topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); - btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *exp = - new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); - btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); - btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - btnBox->AddSpacer(100); - wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); - btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); - btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -} - -wxPanel *QuickStyleVectorDialog::CreateMainPage(wxWindow * parent) -{ -// -// creating the MAIN page -// - wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// First row: Layer name - boxSizer->AddSpacer(50); - wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); - boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); - lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, - wxT("Layer FullName"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); - nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString fullName = DbPrefix + wxT(".") + LayerName; - wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, - wxT("Geometry Type"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); - nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString typeName = wxT("UNKNOWN"); - if (Type == QUICK_STYLE_POINT) - typeName = wxT("POINT-Type Geometries"); - if (Type == QUICK_STYLE_LINE) - typeName = wxT("LINE-Type Geometries"); - if (Type == QUICK_STYLE_POLYGON) - typeName = wxT("POLYGON-Type Geometries"); - if (Type == QUICK_STYLE_GEOMETRY) - typeName = wxT("MIXED-Type Geometries"); - wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, - wxT("QuickStyle Name"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); - nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString uuid = wxString::FromUTF8(Style->GetUUID()); - wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - boxSizer->AddSpacer(25); -// second row: Visibility Range - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Visibility Range"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *visibilitySizer = - new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); - visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, - 5); - wxString range[4]; - range[0] = wxT("&None"); - range[1] = wxT("&Min"); - range[2] = wxT("&Max"); - range[3] = wxT("&Both"); - wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, - wxT("&Range Type"), - wxDefaultPosition, - wxDefaultSize, 4, - range, 2, - wxRA_SPECIFY_COLS); - visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - rangeBox->SetSelection(0); - visibilitySizer->AddSpacer(20); - wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); - visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); - scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); - wxStaticText *minScaleLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); - scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *minScaleCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - minScaleCtrl->Enable(false); - scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); - scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxStaticText *maxScaleLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); - scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *maxScaleCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), - wxDefaultPosition, wxSize(100, 22)); - maxScaleCtrl->Enable(false); - scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdScaleChanged); - return panel; -} - -void QuickStyleVectorDialog:: -OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Visibility Range selection changed -// - wxRadioBox *scaleModeCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - switch (scaleModeCtrl->GetSelection()) - { - case 0: - Style->EnableMinScale(false); - Style->EnableMaxScale(false); - minCtrl->SetValue(wxT("0.0")); - minCtrl->Enable(false); - maxCtrl->SetValue(wxT("+Infinite")); - maxCtrl->Enable(false); - break; - case 1: - Style->EnableMinScale(true); - Style->EnableMaxScale(false); - minCtrl->SetValue(wxT("")); - minCtrl->Enable(true); - maxCtrl->SetValue(wxT("+Infinite")); - maxCtrl->Enable(false); - break; - case 2: - Style->EnableMinScale(false); - Style->EnableMaxScale(true); - minCtrl->SetValue(wxT("0.0")); - minCtrl->Enable(false); - maxCtrl->SetValue(wxT("")); - maxCtrl->Enable(true); - break; - case 3: - Style->EnableMinScale(true); - Style->EnableMaxScale(true); - minCtrl->SetValue(wxT("")); - minCtrl->Enable(true); - maxCtrl->SetValue(wxT("")); - maxCtrl->Enable(true); - break; - }; -} - -wxPanel *QuickStyleVectorDialog::CreatePointPage(wxWindow * parent) -{ -// -// creating the Point Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: Opacity - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Well Known Mark Name - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString mark[6]; - mark[0] = wxT("&Square"); - mark[1] = wxT("&Circle"); - mark[2] = wxT("&Triangle"); - mark[3] = wxT("&Star"); - mark[4] = wxT("&Cross"); - mark[5] = wxT("&X"); - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_MARK, - wxT("&Mark"), - wxDefaultPosition, - wxDefaultSize, 6, - mark, 1, - wxRA_SPECIFY_COLS); - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - markBox->SetSelection(0); -// second row: Size and Rotation - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row A: Size - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *sizeCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_SIZE, wxT("16.0"), - wxDefaultPosition, wxSize(100, 22)); - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Rotation - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Rotation"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *rotCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_ROTATION, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row: AnchorPoint and Displacement - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// third row A: Anchor Point - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Anchor Point"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_X, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_Y, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Displacement - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - anchorBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// fourth row: colors - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// first row A: Fill Color - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *fillColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFillCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickFill = - new wxButton(panel, ID_SYMBOLIZER_FILL_PICKER_BTN, wxT("&Pick a color")); - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - box3Sizer->AddSpacer(30); - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorStrokeSizer = - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *strokeColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sampleStrokeCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickStroke = - new wxButton(panel, ID_SYMBOLIZER_STROKE_PICKER_BTN, wxT("&Pick a color")); - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdMarkChanged); - Connect(ID_SYMBOLIZER_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPointColorFillPicker); - Connect(ID_SYMBOLIZER_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPointColorFillChanged); - Connect(ID_SYMBOLIZER_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPointColorStrokePicker); - Connect(ID_SYMBOLIZER_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPointColorStrokeChanged); - return panel; -} - -void QuickStyleVectorDialog::OnCmdMarkChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Mark selection changed -// - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); - switch (markCtrl->GetSelection()) - { - case 1: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); - break; - case 2: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); - break; - case 3: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_STAR); - break; - case 4: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CROSS); - break; - case 5: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_X); - break; - default: - Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); - break; - }; -} - -void QuickStyleVectorDialog:: -OnCmdPointColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdPointColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdPointColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdPointColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleVectorDialog::CreateLinePage(wxWindow * parent) -{ -// -// creating the Line Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: the Stroke #1 Opacity and Perpendicular Offset - boxSizer->AddSpacer(50); - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// first row B: PerpendicularOffset - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); - opacityBoxSizer->Add(perpendicularBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Perpendicular Offset"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *perpendicularSizer = - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); - perpendicularBoxSizer->Add(perpendicularSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *perpendicularCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Draw lines in parallel to the original geometry.")); - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Positive to the left-hand side. Negative numbers mean right.")); - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row: Stroke color or Graphic - wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row B: Stroke Color - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *colorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick = - new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row: Stroke-Width - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row A: StrokeWidth - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Width"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxTextCtrl *widthCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), - wxDefaultPosition, wxSize(100, 22)); - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row D: DashArray and DashOffset - wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString dot[4]; - dot[0] = wxT("&Solid Line"); - dot[1] = wxT("&Dotted Line"); - dot[2] = wxT("&Dashed Line"); - dot[3] = wxT("&Dashed/Dotted Line"); - wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, - wxT("&Dash/Dot Style"), - wxDefaultPosition, - wxDefaultSize, 4, - dot, 1, - wxRA_SPECIFY_COLS); - dotBox->SetSelection(0); - dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdLineColorChanged); - Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdLineColorPicker); - return panel; -} - -void QuickStyleVectorDialog:: -OnCmdLineColorChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdLineColorPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleVectorDialog::CreatePolygonPage(wxWindow * parent) -{ -// -// creating the Polygon Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row: the Polygon Displacement and Perpendicular Offset - wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); -// first row A: Displacement - wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); - polygonBoxSizer->Add(displacementBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - displacementBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); -// first row B: PerpendicularOffset - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); - polygonBoxSizer->Add(perpendicularBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Perpendicular Offset"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *perpendicularSizer = - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); - perpendicularBoxSizer->Add(perpendicularSizer, 0, - wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *perpendicularCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Positive: larger. / Negative: smaller.")); - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row: Fill Opacity - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Polygon Fill"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableCtrl->SetValue(Style->IsPolygonFill()); - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(400, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityCtrl->Enable(Style->IsPolygonFill()); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Fill Color - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); - auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *colorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - sampleCtrl->Enable(Style->IsPolygonFill()); - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick = - new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); - pick->Enable(Style->IsPolygonFill()); - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// first row A: the Stroke #1 Opacity - wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Polygon Stroke"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); - opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enable2Ctrl->SetValue(Style->IsPolygonStroke()); - enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); - enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacity2Ctrl = - new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(250, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacity2Ctrl->Enable(Style->IsPolygonStroke()); - opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); - enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); - color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *color2Ctrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - color2Ctrl->Enable(Style->IsPolygonStroke()); - color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sample2Ctrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - sample2Ctrl->Enable(Style->IsPolygonStroke()); - color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); - color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick2 = - new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); - pick2->Enable(Style->IsPolygonStroke()); - picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row: Stroke-Width, - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row A: StrokeWidth - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Width"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *widthCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), - wxDefaultPosition, wxSize(100, 22)); - widthCtrl->Enable(false); - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonStrokeChanged); - Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonFillChanged); - Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonColorFillChanged); - Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonColorFillPicker); - Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonColorStrokeChanged); - Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdPolygonColorStrokePicker); - return panel; -} - -void QuickStyleVectorDialog:: -OnCmdPolygonStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->SetPolygonStroke(true); - else - Style->SetPolygonStroke(false); - RetrievePolygonPage(false); - UpdatePolygonPage(); -} - -void QuickStyleVectorDialog:: -OnCmdPolygonFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->SetPolygonFill(true); - else - Style->SetPolygonFill(false); - RetrievePolygonPage(false); - UpdatePolygonPage(); -} - -void QuickStyleVectorDialog:: -OnCmdPolygonColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdPolygonColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdPolygonColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdPolygonColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -bool QuickStyleVectorDialog::DoCheckDatasource(const char *prefix, - const char *coverage, - char *table, char *geometry) -{ -// -// retrieving the real table and geometry column names -// - sqlite3 *sqlite = MainFrame->GetSqlite(); - char *sql; - int ret; - char **results; - int rows; - int columns; - int i; - char *qprefix; - bool ok = false; - - qprefix = gaiaDoubleQuotedSql(prefix); - sql = sqlite3_mprintf("SELECT f_table_name, f_geometry_column, view_name, " - "view_geometry, virt_name, virt_geometry " - "FROM \"%s\".vector_coverages WHERE coverage_name = %Q", - qprefix, coverage); - free(qprefix); - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); - sqlite3_free(sql); - if (ret != SQLITE_OK) - return false; - if (rows < 1) - ; - else - { - for (i = 1; i <= rows; i++) - { - const char *t = results[(i * columns) + 0]; - const char *g = results[(i * columns) + 1]; - if (t != NULL && g != NULL) - { - strcpy(table, t); - strcpy(geometry, g); - ok = true; - } - t = results[(i * columns) + 2]; - g = results[(i * columns) + 3]; - if (t != NULL && g != NULL) - { - strcpy(table, t); - strcpy(geometry, g); - ok = true; - } - t = results[(i * columns) + 4]; - g = results[(i * columns) + 5]; - if (t != NULL && g != NULL) - { - strcpy(table, t); - strcpy(geometry, g); - ok = true; - } - } - } - sqlite3_free_table(results); - return ok; -} - -void QuickStyleVectorDialog::InitializeComboColumns(wxComboBox * ctrl) -{ -// -// initializing a Column list ComboBox -// - sqlite3 *sqlite = MainFrame->GetSqlite(); - char *sql; - int ret; - char **results; - int rows; - int columns; - int i; - char prefix[1024]; - char coverage[1024]; - char table[1024]; - char geometry[1024]; - char *qprefix; - char *qtable; - char *qgeometry; - - if (DbPrefix.Len() == 0) - strcpy(prefix, "MAIN"); - else - strcpy(prefix, DbPrefix.ToUTF8()); - strcpy(coverage, LayerName.ToUTF8()); - if (DoCheckDatasource(prefix, coverage, table, geometry) != true) - return; - - qprefix = gaiaDoubleQuotedSql(prefix); - qtable = gaiaDoubleQuotedSql(table); - sql = sqlite3_mprintf("PRAGMA \"%s\".table_info(\"%s\")", qprefix, qtable); - free(qprefix); - free(qtable); - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); - sqlite3_free(sql); - if (ret != SQLITE_OK) - return; - if (rows < 1) - ; - else - { - for (i = 1; i <= rows; i++) - { - const char *value = results[(i * columns) + 1]; - if (strcasecmp(value, geometry) == 0) - continue; // skipping the Geometry column - wxString col = wxString::FromUTF8(value); - ctrl->Append(col); - } - } - sqlite3_free_table(results); -} - -void QuickStyleVectorDialog::InitializeComboFonts(wxComboBox * ctrl) -{ -// -// initializing a Font list ComboBox -// - sqlite3 *sqlite = MainFrame->GetSqlite(); - char *sql; - int ret; - char **results; - int rows; - int columns; - int i; - char prefix[1024]; - char *qprefix; - -// inserting the default TOY FONTS - wxString font = wxT("ToyFont: serif"); - ctrl->Append(font); - font = wxT("ToyFont: sans-serif"); - ctrl->Append(font); - font = wxT("ToyFont: monospace"); - ctrl->Append(font); - - if (DbPrefix.Len() == 0) - strcpy(prefix, "MAIN"); - else - strcpy(prefix, DbPrefix.ToUTF8()); - qprefix = gaiaDoubleQuotedSql(prefix); - sql = - sqlite3_mprintf - ("SELECT font_facename FROM \"%s\".SE_fonts ORDER BY font_facename", - qprefix); - free(qprefix); - ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); - sqlite3_free(sql); - if (ret != SQLITE_OK) - return; - if (rows < 1) - ; - else - { - for (i = 1; i <= rows; i++) - { - const char *value = results[(i * columns) + 0]; - wxString col = wxString::FromUTF8(value); - ctrl->Append(col); - } - } - sqlite3_free_table(results); -} - -wxPanel *QuickStyleVectorDialog::CreateTextPointPage(wxWindow * parent) -{ -// -// creating the Text Symbolizer page (Point Placement) -// - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// enable/disable Labels - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Labels"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableCtrl->SetValue(Style->IsLabelPrint()); - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - wxStaticText *columnLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); - enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxComboBox *columnList = - new wxComboBox(panel, ID_SYMBOLIZER_TEXT1_LABEL, wxT(""), wxDefaultPosition, - wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); - InitializeComboColumns(columnList); - enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - - - wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); - auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Second row: Font Name, Size and Fill - wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); - font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); - fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// Font Name - wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); - font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); - wxComboBox *fontList = - new wxComboBox(panel, ID_SYMBOLIZER_FONT1_NAME, wxT(""), wxDefaultPosition, - wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); - InitializeComboFonts(fontList); - fontList->Select(0); - fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Font Size - wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); - fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxHORIZONTAL); - fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *sizeCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_SIZE, wxT("15.0"), - wxDefaultPosition, wxSize(100, 22)); - sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxVERTICAL); - fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Style"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxVERTICAL); - boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxBoxSizer *italicSizer = new wxBoxSizer(wxVERTICAL); - boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); - wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ITALIC, - wxT("Italic"), - wxDefaultPosition, wxDefaultSize); - italicCtrl->SetValue(false); - italicCtrl->Enable(false); - italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_BOLD, - wxT("Bold"), - wxDefaultPosition, wxDefaultSize); - boldCtrl->SetValue(false); - boldCtrl->Enable(false); - italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// Font Opacity - wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacityFontSizer = - new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); - fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacityFontCtrl = - new wxSlider(panel, ID_SYMBOLIZER_FONT1_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(150, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Font color - wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxVERTICAL); - fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *font2Sizer = new wxBoxSizer(wxHORIZONTAL); - fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_COLOR, - FillColor, - wxDefaultPosition, wxSize(80, 22)); - font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFontCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT1_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - font2Sizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT1_PICKER_BTN, - wxT("&Pick a color")); - fontColorSizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); -// first row: PointPlacement - wxBoxSizer *pointBoxSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(pointBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *pointBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Label Point Placement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *pointSizer = new wxStaticBoxSizer(pointBox, wxHORIZONTAL); - pointBoxSizer->Add(pointSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// first row A: Anchor Point - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Anchor Point"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); - pointSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_X, wxT("0.5"), - wxDefaultPosition, wxSize(60, 22)); - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_Y, wxT("0.5"), - wxDefaultPosition, wxSize(60, 22)); - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// first row B: Displacement - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - pointSizer->Add(displacementSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(60, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(60, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// first row C: Rotation - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Rotation"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); - pointSizer->Add(rotSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *rotCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ROTATION, wxT("0.0"), - wxDefaultPosition, wxSize(60, 22)); - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Font Halo - wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Halo"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); - pointBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *halo1Sizer = new wxBoxSizer(wxHORIZONTAL); - haloSizer->Add(halo1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO1_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableHaloCtrl->SetValue(Style->IsHaloEnabled()); - enableHaloCtrl->Enable(false); - halo1Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Halo Radius - wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Radius"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); - halo1Sizer->Add(radiusSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *radiusCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_RADIUS, wxT("1.0"), - wxDefaultPosition, wxSize(50, 22)); - radiusCtrl->Enable(false); - radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Halo Opacity - wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacityHaloSizer = - new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); - halo1Sizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxSlider *opacityHaloCtrl = - new wxSlider(panel, ID_SYMBOLIZER_HALO1_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(75, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - opacityHaloCtrl->Enable(false); -// Halo color - wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); - haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_COLOR, - FillColor, - wxDefaultPosition, wxSize(80, 22)); - haloColorSizer->Add(haloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - haloCtrl->Enable(false); - color = wxColour(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleHaloCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO1_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO1_PICKER_BTN, - wxT("&Pick a color")); - haloColorSizer->Add(pickHalo, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - pickHalo->Enable(false); - - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_TEXT1_ENABLE, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel1Changed); - Connect(ID_SYMBOLIZER_FONT1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdFont1ColorPicker); - Connect(ID_SYMBOLIZER_FONT1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdFont1ColorChanged); - Connect(ID_SYMBOLIZER_FONT1_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont1Changed); - Connect(ID_SYMBOLIZER_HALO1_ENABLE, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdHalo1EnableChanged); - Connect(ID_SYMBOLIZER_HALO1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdColorHalo1Picker); - Connect(ID_SYMBOLIZER_HALO1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdColorHalo1Changed); - return panel; -} - -void QuickStyleVectorDialog:: -OnCmdLabel1Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// Label enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); - if (enableCtrl->IsChecked() == true) - { - Style->SetLabelPrint(true); - Style->SetLabelLinePlacement(false); - } else - Style->SetLabelPrint(false); - RetrieveTextPointPage(false); - UpdateTextPointPage(); -} - -void QuickStyleVectorDialog::OnFont1Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// the Font is changed -// - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); - wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); - wxString font = fontList->GetValue(); - char facename[1024]; - strcpy(facename, font.ToUTF8()); - if (strncmp(facename, "ToyFont: ", 9) == 0) - { - boldCtrl->Enable(true); - italicCtrl->Enable(true); - } else - { - bool bold = false; - bool italic = false; - MainFrame->CheckTTFont(facename, &bold, &italic); - boldCtrl->SetValue(bold); - italicCtrl->SetValue(italic); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - } -} - -void QuickStyleVectorDialog:: -OnCmdFont1ColorPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdFont1ColorChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Font Color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdColorHalo1Picker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdColorHalo1Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// Halo Color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdHalo1EnableChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Graphic Halo enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->EnableHalo(true); - else - Style->EnableHalo(false); - RetrieveTextPointPage(false); - UpdateTextPointPage(); -} - -wxPanel *QuickStyleVectorDialog::CreateTextLinePage(wxWindow * parent) -{ -// -// creating the Text Symbolizer page (Line Placement) -// - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// enable/disable Labels - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Labels"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableCtrl->SetValue(Style->IsLabelPrint()); - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - enableSizer->AddSpacer(20); - wxStaticText *columnLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); - enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxComboBox *columnList = - new wxComboBox(panel, ID_SYMBOLIZER_TEXT2_LABEL, wxT(""), wxDefaultPosition, - wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); - InitializeComboColumns(columnList); - enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - - - wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); - auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Second row: Font Name, Size and Fill - wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); - font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); - fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// Font Name - wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); - font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); - wxComboBox *fontList = - new wxComboBox(panel, ID_SYMBOLIZER_FONT2_NAME, wxT(""), wxDefaultPosition, - wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); - InitializeComboFonts(fontList); - fontList->Select(0); - fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Font Size - wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); - fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); - fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *sizeCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_SIZE, wxT("15.0"), - wxDefaultPosition, wxSize(100, 22)); - sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxHORIZONTAL); - fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Style"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxHORIZONTAL); - boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxBoxSizer *italicSizer = new wxBoxSizer(wxHORIZONTAL); - boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); - wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ITALIC, - wxT("Italic"), - wxDefaultPosition, wxDefaultSize); - italicCtrl->SetValue(false); - italicCtrl->Enable(false); - italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_BOLD, - wxT("Bold"), - wxDefaultPosition, wxDefaultSize); - boldCtrl->SetValue(false); - boldCtrl->Enable(false); - italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// Font Opacity - wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacityFontSizer = - new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); - fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacityFontCtrl = - new wxSlider(panel, ID_SYMBOLIZER_FONT2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(150, 35), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Font color - wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxHORIZONTAL); - fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxBoxSizer *font2Sizer = new wxBoxSizer(wxVERTICAL); - fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_COLOR, - FillColor, - wxDefaultPosition, wxSize(80, 22)); - font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFontCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - fontColorSizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT2_PICKER_BTN, - wxT("&Pick a color")); - font2Sizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); -// second row: LinePlacement - wxBoxSizer *lineBoxSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(lineBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *lineBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Label Line Placement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *lineSizer = new wxStaticBoxSizer(lineBox, wxVERTICAL); - lineBoxSizer->Add(lineSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row A: PerpendicularOffset - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); - lineSizer->Add(perpendicularBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Perpendicular Offset"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *perpendicularSizer = - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); - perpendicularBoxSizer->Add(perpendicularSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *perpendicularCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_PERPENDICULAR, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - perpendicularCtrl->Enable(false); - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Draw lines in parallel to the original geometry.")); - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Positive to the left-hand side. Negative numbers mean right.")); - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row B: IsRepeated, InitialGap and Gap - wxBoxSizer *repeatedBoxSizer = new wxBoxSizer(wxHORIZONTAL); - lineSizer->Add(repeatedBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *repeatedBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Repeated Label"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *repeatedSizer = new wxStaticBoxSizer(repeatedBox, wxHORIZONTAL); - repeatedBoxSizer->Add(repeatedSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxCheckBox *isRepeatedCtrl = - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_REPEATED, - wxT("Repeated"), - wxDefaultPosition, wxDefaultSize); - isRepeatedCtrl->SetValue(false); - isRepeatedCtrl->Enable(false); - repeatedSizer->Add(isRepeatedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *inigapBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Initial Gap"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *inigapSizer = new wxStaticBoxSizer(inigapBox, wxVERTICAL); - repeatedSizer->Add(inigapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxTextCtrl *inigapCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_INITIAL_GAP, wxT("0.0"), - wxDefaultPosition, wxSize(60, 22)); - inigapCtrl->Enable(false); - inigapSizer->Add(inigapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *gapBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Gap"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *gapSizer = new wxStaticBoxSizer(gapBox, wxVERTICAL); - repeatedSizer->Add(gapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxTextCtrl *gapCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_GAP, wxT("0.0"), - wxDefaultPosition, wxSize(60, 22)); - gapCtrl->Enable(false); - gapSizer->Add(gapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row C: IsAligned and Generalize - wxBoxSizer *optBoxSizer = new wxBoxSizer(wxHORIZONTAL); - repeatedBoxSizer->Add(optBoxSizer, 0, wxALIGN_LEFT | wxALL, 0); - wxStaticBox *optBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Options"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *optSizer = new wxStaticBoxSizer(optBox, wxVERTICAL); - optBoxSizer->Add(optSizer, 0, wxALIGN_LEFT | wxALL, 5); - wxCheckBox *isAlignedCtrl = - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_ALIGNED, - wxT("Aligned"), - wxDefaultPosition, wxDefaultSize); - isAlignedCtrl->SetValue(false); - isAlignedCtrl->Enable(false); - optSizer->Add(isAlignedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxCheckBox *generalizeCtrl = - new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_GENERALIZE, - wxT("Generalize"), - wxDefaultPosition, wxDefaultSize); - generalizeCtrl->SetValue(false); - generalizeCtrl->Enable(false); - optSizer->Add(generalizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Halo - wxBoxSizer *haloBoxSizer = new wxBoxSizer(wxVERTICAL); - lineBoxSizer->Add(haloBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Font Halo"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); - haloBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *halo0Sizer = new wxBoxSizer(wxHORIZONTAL); - haloSizer->Add(halo0Sizer, 0, wxALIGN_LEFT | wxALL, 0); - wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableHaloCtrl->SetValue(Style->IsHaloEnabled()); - enableHaloCtrl->Enable(false); - halo0Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Halo Radius - wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Radius"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); - halo0Sizer->Add(radiusSizer, 0, wxALIGN_RIGHT | wxALL, 2); - wxTextCtrl *radiusCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_RADIUS, wxT("1.0"), - wxDefaultPosition, wxSize(50, 22)); - radiusCtrl->Enable(false); - radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); -// Halo Opacity - wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacityHaloSizer = - new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); - haloSizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); - wxSlider *opacityHaloCtrl = - new wxSlider(panel, ID_SYMBOLIZER_HALO2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(130, 35), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - opacityHaloCtrl->Enable(false); -// Halo color - wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); - haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); - wxBoxSizer *halo2Sizer = new wxBoxSizer(wxVERTICAL); - haloColorSizer->Add(halo2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_COLOR, - FillColor, - wxDefaultPosition, wxSize(80, 22)); - halo2Sizer->Add(haloCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); - haloCtrl->Enable(false); - color = wxColour(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleHaloCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO2_PICKER_BTN, - wxT("&Pick a color")); - halo2Sizer->Add(pickHalo, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); - pickHalo->Enable(false); - - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_TEXT2_ENABLE, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel2Changed); - Connect(ID_SYMBOLIZER_FONT2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdFont2ColorPicker); - Connect(ID_SYMBOLIZER_FONT2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdFont2ColorChanged); - Connect(ID_SYMBOLIZER_TEXT_IS_REPEATED, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdIsRepeatedChanged); - Connect(ID_SYMBOLIZER_TEXT_IS_ALIGNED, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdIsAlignedChanged); - Connect(ID_SYMBOLIZER_TEXT_GENERALIZE, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdGeneralizeLineChanged); - Connect(ID_SYMBOLIZER_FONT2_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, - (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont2Changed); - Connect(ID_SYMBOLIZER_HALO2_ENABLE, - wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdHalo2EnableChanged); - Connect(ID_SYMBOLIZER_HALO2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdColorHalo2Picker); - Connect(ID_SYMBOLIZER_HALO2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleVectorDialog::OnCmdColorHalo2Changed); - return panel; -} - -void QuickStyleVectorDialog:: -OnCmdLabel2Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// Label enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); - if (enableCtrl->IsChecked() == true) - { - Style->SetLabelPrint(true); - Style->SetLabelLinePlacement(true); - } else - Style->SetLabelPrint(false); - RetrieveTextLinePage(false); - UpdateTextLinePage(); -} - -void QuickStyleVectorDialog::OnFont2Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// the Font is changed -// - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); - wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); - wxString font = fontList->GetValue(); - char facename[1024]; - strcpy(facename, font.ToUTF8()); - if (strncmp(facename, "ToyFont: ", 9) == 0) - { - boldCtrl->Enable(true); - italicCtrl->Enable(true); - } else - { - bool bold = false; - bool italic = false; - MainFrame->CheckTTFont(facename, &bold, &italic); - boldCtrl->SetValue(bold); - italicCtrl->SetValue(italic); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - } -} - -void QuickStyleVectorDialog:: -OnCmdFont2ColorPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdFont2ColorChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Font Color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdIsRepeatedChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Label IsRepeated enable/disable -// - wxCheckBox *repeatedCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); - if (repeatedCtrl->IsChecked() == true) - Style->SetRepeatedLabel(true); - else - Style->SetRepeatedLabel(false); - RetrieveTextLinePage(false); - UpdateTextLinePage(); -} - -void QuickStyleVectorDialog:: -OnCmdIsAlignedChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Label IsAligned enable/disable -// - wxCheckBox *alignedCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); - if (alignedCtrl->IsChecked() == true) - Style->SetLabelIsAligned(true); - else - Style->SetLabelIsAligned(false); -} - -void QuickStyleVectorDialog:: -OnCmdGeneralizeLineChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Label GeneralizeLine enable/disable -// - wxCheckBox *generalizeCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); - if (generalizeCtrl->IsChecked() == true) - Style->SetLabelGeneralizeLine(true); - else - Style->SetLabelGeneralizeLine(false); -} - -void QuickStyleVectorDialog:: -OnCmdColorHalo2Picker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleVectorDialog:: -OnCmdColorHalo2Changed(wxCommandEvent & WXUNUSED(event)) -{ -// -// Halo Color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleVectorDialog:: -OnCmdHalo2EnableChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Graphic Halo enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->EnableHalo(true); - else - Style->EnableHalo(false); - RetrieveTextLinePage(false); - UpdateTextLinePage(); -} - -bool QuickStyleVectorDialog::RetrieveMainPage() -{ -// -// retrieving params from the MAIN page -// - double min = Style->GetScaleMin(); - double max = Style->GetScaleMax(); - if (Style->IsMinScaleEnabled() == true) - { - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - wxString value = minCtrl->GetValue(); - if (value.ToDouble(&min) != true) - { - wxMessageBox(wxT - ("MIN_SCALE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - if (min < 0.0) - { - wxMessageBox(wxT - ("MIN_SCALE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsMaxScaleEnabled() == true) - { - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - wxString value = maxCtrl->GetValue(); - if (value.ToDouble(&max) != true) - { - wxMessageBox(wxT - ("MAX_SCALE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - if (max < 0.0) - { - wxMessageBox(wxT - ("MAX_SCALE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) - { - if (min >= max) - { - wxMessageBox(wxT - ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - Style->SetScaleMin(min); - Style->SetScaleMax(max); - return true; -} - -void QuickStyleVectorDialog::UpdateMainPage() -{ -// -// updating the MAIN page -// - wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); - if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) - rangeBox->SetSelection(0); - else if (Style->IsMinScaleEnabled() == true - && Style->IsMaxScaleEnabled() != true) - rangeBox->SetSelection(1); - else if (Style->IsMinScaleEnabled() != true - && Style->IsMaxScaleEnabled() == true) - rangeBox->SetSelection(2); - else - rangeBox->SetSelection(3); - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - char dummy[64]; - wxString str; - if (Style->IsMinScaleEnabled() == true) - { - sprintf(dummy, "%1.2f", Style->GetScaleMin()); - str = wxString::FromUTF8(dummy); - minCtrl->SetValue(str); - minCtrl->Enable(true); - } else - { - str = wxT("0.0"); - minCtrl->SetValue(str); - minCtrl->Enable(false); - } - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - if (Style->IsMaxScaleEnabled() == true) - { - sprintf(dummy, "%1.2f", Style->GetScaleMax()); - str = wxString::FromUTF8(dummy); - maxCtrl->SetValue(str); - maxCtrl->Enable(true); - } else - { - str = wxT("+Infinite"); - maxCtrl->SetValue(str); - maxCtrl->Enable(false); - } -} - -bool QuickStyleVectorDialog::RetrievePointPage(bool check) -{ -// -// retrieving params from the Point Symbolizer page -// - double opacity; - double size; - double rotation; - double anchorPointX; - double anchorPointY; - double displacementX; - double displacementY; - char fillColor[8]; - char strokeColor[8]; - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&size) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (size < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); - value = rotationCtrl->GetValue(); - if (value.ToDouble(&rotation) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ROTATION isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); - value = anchorXCtrl->GetValue(); - if (value.ToDouble(&anchorPointX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorPointX < 0.0 || anchorPointX > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); - value = anchorYCtrl->GetValue(); - if (value.ToDouble(&anchorPointY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorPointY < 0.0 || anchorPointY > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); - value = displXCtrl->GetValue(); - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); - color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - - Style->SetSymbolOpacity(opacity); - Style->SetSymbolSize(size); - Style->SetSymbolAnchorX(anchorPointX); - Style->SetSymbolAnchorY(anchorPointY); - Style->SetSymbolRotation(rotation); - Style->SetSymbolDisplacementX(displacementX); - Style->SetSymbolDisplacementY(displacementY); - Style->SetSymbolFillColor(fillColor); - Style->SetSymbolStrokeColor(strokeColor); - return true; -} - -void QuickStyleVectorDialog::UpdatePointPage() -{ -// -// updating the Point Symbolizer page -// - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); - opacityCtrl->SetValue(Style->GetSymbolOpacity() * 100.0); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetSymbolSize()); - wxString str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); - sprintf(dummy, "%1.2f", Style->GetSymbolRotation()); - str = wxString::FromUTF8(dummy); - rotationCtrl->SetValue(str); - wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); - sprintf(dummy, "%1.2f", Style->GetSymbolAnchorX()); - str = wxString::FromUTF8(dummy); - anchorXCtrl->SetValue(str); - wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); - sprintf(dummy, "%1.2f", Style->GetSymbolAnchorY()); - str = wxString::FromUTF8(dummy); - anchorYCtrl->SetValue(str); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); - sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementX()); - str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); - switch (Style->GetSymbolWellKnownMark()) - { - case RL2_GRAPHIC_MARK_CIRCLE: - markCtrl->SetSelection(1); - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - markCtrl->SetSelection(2); - break; - case RL2_GRAPHIC_MARK_STAR: - markCtrl->SetSelection(3); - break; - case RL2_GRAPHIC_MARK_CROSS: - markCtrl->SetSelection(4); - break; - case RL2_GRAPHIC_MARK_X: - markCtrl->SetSelection(5); - break; - default: - markCtrl->SetSelection(0); - break; - }; - wxTextCtrl *colorFillCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); - wxString fillColor = wxString::FromUTF8(Style->GetSymbolFillColor()); - colorFillCtrl->SetValue(fillColor); - wxTextCtrl *colorStrokeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); - wxString strokeColor = wxString::FromUTF8(Style->GetSymbolStrokeColor()); - colorStrokeCtrl->SetValue(strokeColor); -} - -bool QuickStyleVectorDialog::RetrieveLinePage(bool check) -{ -// -// retrieving params from the Line Symbolizer page -// - double opacity; - double perpendicularOffset; - char strokeColor[8]; - double strokeWidth; - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); - wxString value = perpCtrl->GetValue(); - if (value.ToDouble(&perpendicularOffset) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); - value = widthCtrl->GetValue(); - if (value.ToDouble(&strokeWidth) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (strokeWidth <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); - switch (dotCtrl->GetSelection()) - { - case 1: - Style->SetLineDotStyle(QUICK_STYLE_DOT_LINE); - break; - case 2: - Style->SetLineDotStyle(QUICK_STYLE_DASH_LINE); - break; - case 3: - Style->SetLineDotStyle(QUICK_STYLE_DASH_DOT_LINE); - break; - default: - Style->SetLineDotStyle(QUICK_STYLE_SOLID_LINE); - break; - }; - Style->SetLineOpacity(opacity); - Style->SetLinePerpendicularOffset(perpendicularOffset); - Style->SetLineStrokeWidth(strokeWidth); - Style->SetLineStrokeColor(strokeColor); - return true; -} - -void QuickStyleVectorDialog::UpdateLinePage() -{ -// -// updating the Line Symbolizer page -// - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); - opacityCtrl->SetValue(Style->GetLineOpacity() * 100.0); - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetLinePerpendicularOffset()); - wxString str = wxString::FromUTF8(dummy); - perpCtrl->SetValue(str); - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); - colorCtrl->Enable(true); - pick->Enable(true); - wxString strokeColor = wxString::FromUTF8(Style->GetLineStrokeColor()); - colorCtrl->SetValue(strokeColor); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); - sprintf(dummy, "%1.2f", Style->GetLineStrokeWidth()); - str = wxString::FromUTF8(dummy); - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); - switch (Style->GetLineDotStyle()) - { - case QUICK_STYLE_DOT_LINE: - dotCtrl->SetSelection(1); - break; - case QUICK_STYLE_DASH_LINE: - dotCtrl->SetSelection(2); - break; - case QUICK_STYLE_DASH_DOT_LINE: - dotCtrl->SetSelection(3); - break; - default: - dotCtrl->SetSelection(0); - break; - }; - widthCtrl->SetValue(str); -} - -bool QuickStyleVectorDialog::RetrievePolygonPage(bool check) -{ -// -// retrieving params from the Polygon Synbolizer page -// - double fillOpacity; - double displacementX; - double displacementY; - double perpendicularOffset; - char fillColor[8]; - double strokeOpacity; - char strokeColor[8]; - double strokeWidth; - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); - fillOpacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); - wxString value = displXCtrl->GetValue(); - if (Style->IsPolygonFill() != true && Style->IsPolygonStroke() != true) - { - if (check == true) - { - wxMessageBox(wxT - ("You can't disable both FILL and STROKE at the same time !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); - value = perpCtrl->GetValue(); - if (value.ToDouble(&perpendicularOffset) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - wxSlider *opacity2Ctrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); - strokeOpacity = opacity2Ctrl->GetValue() / 100.0; - wxTextCtrl *color2Ctrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - color = color2Ctrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); - value = widthCtrl->GetValue(); - if (value.ToDouble(&strokeWidth) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (strokeWidth <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - - Style->SetPolygonFillOpacity(fillOpacity); - Style->SetPolygonDisplacementX(displacementX); - Style->SetPolygonDisplacementY(displacementY); - Style->SetPolygonPerpendicularOffset(perpendicularOffset); - Style->SetPolygonFillColor(fillColor); - Style->SetPolygonStrokeOpacity(strokeOpacity); - Style->SetPolygonStrokeColor(strokeColor); - Style->SetPolygonStrokeWidth(strokeWidth); - return true; -} - -void QuickStyleVectorDialog::UpdatePolygonPage() -{ -// -// updating the Polygon Symbolizer page -// - wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); - enableBox->SetValue(Style->IsPolygonFill()); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementX()); - wxString str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); - sprintf(dummy, "%1.2f", Style->GetPolygonPerpendicularOffset()); - str = wxString::FromUTF8(dummy); - perpCtrl->SetValue(str); - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); - opacityCtrl->SetValue(Style->GetPolygonFillOpacity() * 100.0); - opacityCtrl->Enable(Style->IsPolygonFill()); - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); - wxColour color = wxNullColour; - str = wxString::FromUTF8(Style->GetPolygonFillColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } - colorCtrl->Enable(Style->IsPolygonFill()); - pick->Enable(Style->IsPolygonFill()); - wxCheckBox *enable2Box = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); - enable2Box->SetValue(Style->IsPolygonStroke()); - wxSlider *opacity2Ctrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); - opacity2Ctrl->SetValue(Style->GetPolygonStrokeOpacity() * 100.0); - opacity2Ctrl->Enable(Style->IsPolygonStroke()); - wxTextCtrl *color2Ctrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); - color = wxNullColour; - str = wxString::FromUTF8(Style->GetPolygonStrokeColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - color2Ctrl->SetValue(str); - } - color2Ctrl->Enable(Style->IsPolygonStroke()); - pick2->Enable(Style->IsPolygonStroke()); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); - sprintf(dummy, "%1.2f", Style->GetPolygonStrokeWidth()); - str = wxString::FromUTF8(dummy); - widthCtrl->SetValue(str); - widthCtrl->Enable(Style->IsPolygonStroke()); -} - -bool QuickStyleVectorDialog::RetrieveTextPointPage(bool check) -{ -// -// retrieving params from the Text Symbolizer page - Point Placement -// - wxString column; - wxString font; - double fontSize; - int fontStyle; - int fontWeight; - double opacity; - char fontColor[8]; - double haloRadius; - double haloOpacity; - char haloColor[8]; - double rotation; - double anchorPointX; - double anchorPointY; - double displacementX; - double displacementY; - - if (Style->IsLabelPrint() == false) - return true; - - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); - int idSel = columnCtrl->GetSelection(); - if (idSel == wxNOT_FOUND) - { - if (check == true) - { - wxMessageBox(wxT - ("You must select some Column !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - column = columnCtrl->GetValue(); - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); - idSel = fontCtrl->GetSelection(); - if (idSel == wxNOT_FOUND) - { - if (check == true) - { - wxMessageBox(wxT - ("You must select some Font !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - font = fontCtrl->GetValue(); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&fontSize) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (fontSize <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-SIZE should be a positive numberr !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); - if (boldCtrl->GetValue() == true) - fontWeight = RL2_FONTWEIGHT_BOLD; - else - fontWeight = RL2_FONTWEIGHT_NORMAL; - if (italicCtrl->GetValue() == true) - fontStyle = RL2_FONTSTYLE_ITALIC; - else - fontStyle = RL2_FONTSTYLE_NORMAL; - wxSlider *opacityFontCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); - opacity = opacityFontCtrl->GetValue() / 100.0; - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fontColor, color.ToUTF8()); -// Point Placement - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); - value = rotationCtrl->GetValue(); - if (value.ToDouble(&rotation) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ROTATION isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); - value = anchorXCtrl->GetValue(); - if (value.ToDouble(&anchorPointX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorPointX < 0.0 || anchorPointX > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); - value = anchorYCtrl->GetValue(); - if (value.ToDouble(&anchorPointY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorPointY < 0.0 || anchorPointY > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); - value = displXCtrl->GetValue(); - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsHaloEnabled() == true) - { - wxSlider *opacityHaloCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); - haloOpacity = opacityHaloCtrl->GetValue() / 100.0; - wxTextCtrl *radiusCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); - wxString value = radiusCtrl->GetValue(); - if (value.ToDouble(&haloRadius) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-RADIUS isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (haloRadius <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-RADIUS should be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorHaloCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); - wxString color = colorHaloCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(haloColor, color.ToUTF8()); - } - - Style->SetLabelColumn(column.ToUTF8()); - Style->SetFontFacename(font.ToUTF8()); - Style->SetFontOpacity(opacity); - Style->SetFontSize(fontSize); - Style->SetFontStyle(fontStyle); - Style->SetFontWeight(fontWeight); - Style->SetFontColor(fontColor); - Style->SetLabelRotation(rotation); - Style->SetLabelAnchorX(anchorPointX); - Style->SetLabelAnchorY(anchorPointY); - Style->SetLabelDisplacementX(displacementX); - Style->SetLabelDisplacementY(displacementY); - if (Style->IsHaloEnabled() == true) - { - Style->SetHaloRadius(haloRadius); - Style->SetHaloOpacity(haloOpacity); - Style->SetHaloColor(haloColor); - } - return true; -} - -void QuickStyleVectorDialog::UpdateTextPointPage() -{ -// -// updating the Text Symbolizer page - Point Placement -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); - enableCtrl->SetValue(Style->IsLabelPrint()); - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); - wxString str = wxString::FromUTF8(Style->GetLabelColumn()); - int idSel = columnCtrl->FindString(str); - columnCtrl->SetSelection(idSel); - columnCtrl->Enable(Style->IsLabelPrint()); - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); - str = wxString::FromUTF8(Style->GetFontFacename()); - idSel = fontCtrl->FindString(str); - fontCtrl->SetSelection(idSel); - fontCtrl->Enable(Style->IsLabelPrint()); - wxSlider *opacityFontCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); - opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); - opacityFontCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *colorFontCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); - wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_BTN); - wxColour color = wxNullColour; - str = wxString::FromUTF8(Style->GetFontColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorFontCtrl->SetValue(str); - } - colorFontCtrl->Enable(Style->IsLabelPrint()); - pickFont->Enable(Style->IsLabelPrint()); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetFontSize()); - str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - sizeCtrl->Enable(Style->IsLabelPrint()); - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); - if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) - boldCtrl->SetValue(true); - else - boldCtrl->SetValue(false); - if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) - italicCtrl->SetValue(true); - else - italicCtrl->SetValue(false); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - if (Style->GetFontFacename() != NULL) - { - if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) - { - boldCtrl->Enable(Style->IsLabelPrint()); - italicCtrl->Enable(Style->IsLabelPrint()); - } else - { - bool bold = false; - bool italic = false; - MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); - boldCtrl->SetValue(bold); - italicCtrl->SetValue(italic); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - } - } -// Point Placement - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); - sprintf(dummy, "%1.2f", Style->GetLabelRotation()); - str = wxString::FromUTF8(dummy); - rotationCtrl->SetValue(str); - rotationCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); - sprintf(dummy, "%1.2f", Style->GetLabelAnchorX()); - str = wxString::FromUTF8(dummy); - anchorXCtrl->SetValue(str); - anchorXCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); - sprintf(dummy, "%1.2f", Style->GetLabelAnchorY()); - str = wxString::FromUTF8(dummy); - anchorYCtrl->SetValue(str); - anchorYCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); - sprintf(dummy, "%1.2f", Style->GetLabelDisplacementX()); - str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - displXCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetLabelDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - displYCtrl->Enable(Style->IsLabelPrint()); - wxCheckBox *enableHaloBox = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); - if (Style->IsHaloEnabled() == true) - enableHaloBox->SetValue(true); - else - enableHaloBox->SetValue(false); - enableHaloBox->Enable(Style->IsLabelPrint()); - bool enable = false; - if (Style->IsLabelPrint() == true) - enable = Style->IsHaloEnabled(); - wxTextCtrl *radiusCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); - radiusCtrl->Enable(enable); - wxTextCtrl *colorHaloCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); - colorHaloCtrl->Enable(enable); - wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_BTN); - pickHalo->Enable(enable); - wxSlider *opacityHaloCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); - opacityHaloCtrl->Enable(enable); - opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); - sprintf(dummy, "%1.2f", Style->GetHaloRadius()); - str = wxString::FromUTF8(dummy); - radiusCtrl->SetValue(str); - color = wxNullColour; - str = wxString::FromUTF8(Style->GetHaloColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorHaloCtrl->SetValue(str); - } - if (Style->IsHaloEnabled() == false) - { - opacityHaloCtrl->Enable(false); - pickHalo->Enable(false); - colorHaloCtrl->Enable(false); - radiusCtrl->Enable(false); - } else - { - opacityHaloCtrl->Enable(true); - pickHalo->Enable(true); - colorHaloCtrl->Enable(true); - radiusCtrl->Enable(true); - } -} - -bool QuickStyleVectorDialog::RetrieveTextLinePage(bool check) -{ -// -// retrieving params from the Text Symbolizer page - Line Placement -// - wxString column; - wxString font; - double fontSize; - int fontStyle; - int fontWeight; - double opacity; - char fontColor[8]; - double haloRadius; - double haloOpacity; - char haloColor[8]; - double perpendicularOffset; - double initialGap; - double gap; - - if (Style->IsLabelPrint() == false) - return true; - - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); - int idSel = columnCtrl->GetSelection(); - if (idSel == wxNOT_FOUND) - { - if (check == true) - { - wxMessageBox(wxT - ("You must select some Column !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - column = columnCtrl->GetValue(); - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); - idSel = fontCtrl->GetSelection(); - if (idSel == wxNOT_FOUND) - { - if (check == true) - { - wxMessageBox(wxT - ("You must select some Font !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - font = fontCtrl->GetValue(); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&fontSize) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (fontSize <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-SIZE should be a positive numberr !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); - if (boldCtrl->GetValue() == true) - fontWeight = RL2_FONTWEIGHT_BOLD; - else - fontWeight = RL2_FONTWEIGHT_NORMAL; - if (italicCtrl->GetValue() == true) - fontStyle = RL2_FONTSTYLE_ITALIC; - else - fontStyle = RL2_FONTSTYLE_NORMAL; - wxSlider *opacityFontCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); - opacity = opacityFontCtrl->GetValue() / 100.0; - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FONT-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fontColor, color.ToUTF8()); -// Line Placement - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); - value = perpCtrl->GetValue(); - if (value.ToDouble(&perpendicularOffset) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *inigapCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); - value = inigapCtrl->GetValue(); - if (value.ToDouble(&initialGap) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("INITIAL-GAP isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (initialGap < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("INITIAL-GAP should be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); - value = gapCtrl->GetValue(); - if (value.ToDouble(&gap) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("GAP isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (gap < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("GAP should be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsHaloEnabled() == true) - { - wxSlider *opacityHaloCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); - haloOpacity = opacityHaloCtrl->GetValue() / 100.0; - wxTextCtrl *radiusCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); - wxString value = radiusCtrl->GetValue(); - if (value.ToDouble(&haloRadius) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-RADIUS isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (haloRadius <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-RADIUS should be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorHaloCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); - wxString color = colorHaloCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("HALO-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(haloColor, color.ToUTF8()); - } - Style->SetLabelColumn(column.ToUTF8()); - Style->SetFontFacename(font.ToUTF8()); - Style->SetFontOpacity(opacity); - Style->SetFontSize(fontSize); - Style->SetFontStyle(fontStyle); - Style->SetFontWeight(fontWeight); - Style->SetFontColor(fontColor); - Style->SetLabelPerpendicularOffset(perpendicularOffset); - Style->SetLabelInitialGap(initialGap); - Style->SetLabelGap(gap); - if (Style->IsHaloEnabled() == true) - { - Style->SetHaloRadius(haloRadius); - Style->SetHaloOpacity(haloOpacity); - Style->SetHaloColor(haloColor); - } - return true; -} - -void QuickStyleVectorDialog::UpdateTextLinePage() -{ -// -// updating the Text Symbolizer page - Line Placement -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); - enableCtrl->SetValue(Style->IsLabelPrint()); - wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); - wxString str = wxString::FromUTF8(Style->GetLabelColumn()); - int idSel = columnCtrl->FindString(str); - columnCtrl->SetSelection(idSel); - columnCtrl->Enable(Style->IsLabelPrint()); - wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); - str = wxString::FromUTF8(Style->GetFontFacename()); - idSel = fontCtrl->FindString(str); - fontCtrl->SetSelection(idSel); - fontCtrl->Enable(Style->IsLabelPrint()); - wxSlider *opacityFontCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); - opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); - opacityFontCtrl->Enable(Style->IsLabelPrint()); - wxTextCtrl *colorFontCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); - wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_BTN); - wxColour color = wxNullColour; - str = wxString::FromUTF8(Style->GetFontColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorFontCtrl->SetValue(str); - } - colorFontCtrl->Enable(Style->IsLabelPrint()); - pickFont->Enable(Style->IsLabelPrint()); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetFontSize()); - str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - sizeCtrl->Enable(Style->IsLabelPrint()); - wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); - wxCheckBox *italicCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); - if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) - boldCtrl->SetValue(true); - else - boldCtrl->SetValue(false); - if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) - italicCtrl->SetValue(true); - else - italicCtrl->SetValue(false); - italicCtrl->Enable(Style->IsLabelPrint()); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - if (Style->GetFontFacename() != NULL) - { - if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) - { - boldCtrl->Enable(Style->IsLabelPrint()); - italicCtrl->Enable(Style->IsLabelPrint()); - } else - { - bool bold = false; - bool italic = false; - MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); - boldCtrl->SetValue(bold); - italicCtrl->SetValue(italic); - boldCtrl->Enable(false); - italicCtrl->Enable(false); - } - } -// Line Placement - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); - sprintf(dummy, "%1.2f", Style->GetLabelPerpendicularOffset()); - str = wxString::FromUTF8(dummy); - perpCtrl->SetValue(str); - perpCtrl->Enable(Style->IsLabelPrint()); - wxCheckBox *repeatBox = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); - repeatBox->SetValue(Style->IsRepeatedLabel()); - repeatBox->Enable(Style->IsLabelPrint()); - wxTextCtrl *inigapCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); - sprintf(dummy, "%1.2f", Style->GetLabelInitialGap()); - str = wxString::FromUTF8(dummy); - inigapCtrl->SetValue(str); - wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); - sprintf(dummy, "%1.2f", Style->GetLabelGap()); - str = wxString::FromUTF8(dummy); - gapCtrl->SetValue(str); - if (Style->IsLabelPrint() && Style->IsRepeatedLabel()) - { - inigapCtrl->Enable(true); - gapCtrl->Enable(true); - } else - { - inigapCtrl->Enable(false); - gapCtrl->Enable(false); - } - wxCheckBox *alignBox = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); - alignBox->SetValue(Style->IsLabelAligned()); - alignBox->Enable(Style->IsLabelPrint()); - wxCheckBox *generalizeBox = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); - generalizeBox->SetValue(Style->IsLabelGeneralizeLine()); - generalizeBox->Enable(Style->IsLabelPrint()); - wxCheckBox *enableHaloBox = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); - if (Style->IsHaloEnabled() == true) - enableHaloBox->SetValue(true); - else - enableHaloBox->SetValue(false); - enableHaloBox->Enable(Style->IsLabelPrint()); - bool enable = false; - if (Style->IsLabelPrint() == true) - enable = Style->IsHaloEnabled(); - wxTextCtrl *radiusCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); - radiusCtrl->Enable(enable); - wxTextCtrl *colorHaloCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); - colorHaloCtrl->Enable(enable); - wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_BTN); - pickHalo->Enable(enable); - wxSlider *opacityHaloCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); - opacityHaloCtrl->Enable(enable); - opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); - sprintf(dummy, "%1.2f", Style->GetHaloRadius()); - str = wxString::FromUTF8(dummy); - radiusCtrl->SetValue(str); - color = wxNullColour; - str = wxString::FromUTF8(Style->GetHaloColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorHaloCtrl->SetValue(str); - } - if (Style->IsHaloEnabled() == false) - { - opacityHaloCtrl->Enable(false); - pickHalo->Enable(false); - colorHaloCtrl->Enable(false); - radiusCtrl->Enable(false); - } else - { - opacityHaloCtrl->Enable(true); - pickHalo->Enable(true); - colorHaloCtrl->Enable(true); - radiusCtrl->Enable(true); - } -} - -void QuickStyleVectorDialog::OnPageChanging(wxNotebookEvent & event) -{ -// -// TAB/PAGE selection changing -// - bool ret = false; - int idx = event.GetOldSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else - { - if (idx == PagePointIndex) - ret = RetrievePointPage(); - if (idx == PageLineIndex) - ret = RetrieveLinePage(); - if (idx == PagePolygonIndex) - ret = RetrievePolygonPage(); - if (idx == PageTextPointIndex) - ret = RetrieveTextPointPage(); - if (idx == PageTextLineIndex) - ret = RetrieveTextLinePage(); - } - if (ret != true) - event.Veto(); -} - -void QuickStyleVectorDialog::OnPageChanged(wxNotebookEvent & event) -{ -// -// TAB/PAGE selection changed -// - int idx = event.GetSelection(); - if (idx == 0) - UpdateMainPage(); - else - { - if (idx == PagePointIndex) - UpdatePointPage(); - if (idx == PageLineIndex) - UpdateLinePage(); - if (idx == PagePolygonIndex) - UpdatePolygonPage(); - if (idx == PageTextPointIndex) - UpdateTextPointPage(); - if (idx == PageTextLineIndex) - UpdateTextLinePage(); - } -} - -bool QuickStyleVectorDialog::UpdateStyle() -{ -// -// updating the QuickStyle -// - bool ret = false; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else - { - if (idx == PagePointIndex) - ret = RetrievePointPage(); - if (idx == PageLineIndex) - ret = RetrieveLinePage(); - if (idx == PagePolygonIndex) - ret = RetrievePolygonPage(); - if (idx == PageTextPointIndex) - ret = RetrieveTextPointPage(); - if (idx == PageTextLineIndex) - ret = RetrieveTextLinePage(); - } - if (ret == false) - return false; - - VectorLayerConfig *config = Layer->GetVectorConfig(); - bool setCurrentStyle = false; - if (config->GetStyle() == NULL) - setCurrentStyle = true; - else - { - if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) - setCurrentStyle = true; - } - if (setCurrentStyle == true) - { - config->SetStyle(Style->GetUUID()); - IsConfigChanged = true; - } - IsConfigChanged = Layer->UpdateQuickStyle(Style); - return true; -} - -void QuickStyleVectorDialog::OnOk(wxCommandEvent & WXUNUSED(event)) -{ -// -// permanently saving the QuickStyle and quitting -// - if (UpdateStyle() == true) - wxDialog::EndModal(wxID_OK); -} - -void QuickStyleVectorDialog::OnApply(wxCommandEvent & WXUNUSED(event)) -{ -// -// applying the QuickStyle and continuing -// - if (UpdateStyle() == true) - { - if (IsConfigChanged == true) - MapPanel->RefreshMap(); - } -} - -void QuickStyleVectorDialog::OnExport(wxCommandEvent & WXUNUSED(event)) -{ -// -// exporting the Quick Style as an external file -// - bool xret = false; - int ret; - wxString path; - wxString lastDir; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - xret = RetrieveMainPage(); - else - { - if (idx == PagePointIndex) - xret = RetrievePointPage(); - if (idx == PageLineIndex) - xret = RetrieveLinePage(); - if (idx == PagePolygonIndex) - xret = RetrievePolygonPage(); - if (idx == PageTextPointIndex) - xret = RetrieveTextPointPage(); - if (idx == PageTextLineIndex) - xret = RetrieveTextLinePage(); - } - if (xret == false) - return; - - wxFileDialog fileDialog(this, - wxT("Exporting an SLD/SE QuickStyle to a file"), - wxT(""), wxT("style.xml"), - wxT("XML Document|*.xml|All files (*.*)|*.*"), - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, - wxDefaultSize, wxT("filedlg")); - lastDir = MainFrame->GetLastDirectory(); - if (lastDir.Len() >= 1) - fileDialog.SetDirectory(lastDir); - ret = fileDialog.ShowModal(); - if (ret == wxID_OK) - { - wxFileName file(fileDialog.GetPath()); - path = file.GetPath(); - path += file.GetPathSeparator(); - path += file.GetName(); - lastDir = file.GetPath(); - path = fileDialog.GetPath(); - FILE *out = fopen(path.ToUTF8(), "wb"); - if (out == NULL) - wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - else - { - char *xml = Style->CreateXmlStyle(); - fwrite(xml, 1, strlen(xml), out); - sqlite3_free(xml); - fclose(out); - wxMessageBox(wxT - ("SLD/SE QuickStyle successfully saved into:\n\n\"") - + path + wxT("\""), wxT("spatialite_gui"), - wxOK | wxICON_INFORMATION, this); - } - } -} - -void QuickStyleVectorDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) -{ -// -// Copying the Quick Style into the Clipboard -// - bool ret = false; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else - { - if (idx == PagePointIndex) - ret = RetrievePointPage(); - if (idx == PageLineIndex) - ret = RetrieveLinePage(); - if (idx == PagePolygonIndex) - ret = RetrievePolygonPage(); - if (idx == PageTextPointIndex) - ret = RetrieveTextPointPage(); - if (idx == PageTextLineIndex) - ret = RetrieveTextLinePage(); - } - if (ret == false) - return; - - char *xml = Style->CreateXmlStyle(); - wxString XMLstring = wxString::FromUTF8(xml); - sqlite3_free(xml); - if (wxTheClipboard->Open()) - { - wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); - wxTheClipboard->Close(); - } -} - -void QuickStyleVectorDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) -{ -// -// all done: -// - wxDialog::EndModal(wxID_CANCEL); -} - -bool QuickStyleTopologyDialog::Create(MyMapPanel * parent, MapLayer * layer) -{ -// -// creating the dialog -// - MainFrame = parent->GetParent(); - MapPanel = parent; - Layer = layer; - Type = Layer->GetType(); - DbPrefix = layer->GetDbPrefix(); - LayerName = layer->GetName(); - IsConfigChanged = false; - - wxString title = wxT("QuickStyle (Topology) Edit"); - if (Type == MAP_LAYER_NETWORK) - title = wxT("QuickStyle (Network) Edit"); - if (wxPropertySheetDialog::Create(parent, wxID_ANY, title) == false) - return false; - if (Layer->GetQuickStyleTopology() != NULL) - Style = Layer->CloneQuickStyleTopology(); - else - Style = new QuickStyleTopologyObj(Type); - - wxBookCtrlBase *book = GetBookCtrl(); -// creates individual panels - wxPanel *mainPage = CreateMainPage(book); - book->AddPage(mainPage, wxT("General"), true); - if (Type == MAP_LAYER_NETWORK) - { - wxPanel *nodePage = CreateNodePage(book); - book->AddPage(nodePage, wxT("Nodes"), false); - wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); - book->AddPage(edgeLinkPage, wxT("Links"), false); - wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); - book->AddPage(edgeLinkSeedPage, wxT("Link Seeds"), false); - } else - { - wxPanel *nodePage = CreateNodePage(book); - book->AddPage(nodePage, wxT("Nodes"), false); - wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); - book->AddPage(edgeLinkPage, wxT("Edges"), false); - wxPanel *facePage = CreateFacePage(book); - book->AddPage(facePage, wxT("Faces"), false); - wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); - book->AddPage(edgeLinkSeedPage, wxT("Edge Seeds"), false); - wxPanel *faceSeedPage = CreateFaceSeedPage(book); - book->AddPage(faceSeedPage, wxT("Face Seeds"), false); - } - - CreateButtons(); - LayoutDialog(); -// appends event handler for TAB/PAGE changing - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanging); - Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanged); -// appends event handler for buttons - Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnQuit); - Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnOk); - Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnApply); - Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnExport); - Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & QuickStyleTopologyDialog::OnCopy); -// centers the dialog window - Centre(); - UpdateMainPage(); - return true; -} - -void QuickStyleTopologyDialog::CreateButtons() -{ -// -// adding the common Buttons -// - wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); - wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); - topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); - btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *exp = - new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); - btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); - btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - btnBox->AddSpacer(100); - wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); - btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); - btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -} - -wxPanel *QuickStyleTopologyDialog::CreateMainPage(wxWindow * parent) -{ -// -// creating the MAIN page -// - wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// First row: Layer name - boxSizer->AddSpacer(50); - wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); - boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); - lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, - wxT("Layer FullName"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); - nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString fullName = DbPrefix + wxT(".") + LayerName; - wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, - wxT("Geometry Type"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); - nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString typeName = wxT("UNKNOWN"); - if (Type == MAP_LAYER_NETWORK) - typeName = wxT("Network (ISO TopoNet)"); - if (Type == MAP_LAYER_TOPOLOGY) - typeName = wxT("Topology (ISO TopoGeo)"); - wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, - wxT("QuickStyle Name"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); - nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxString uuid = wxString::FromUTF8(Style->GetUUID()); - wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, - wxDefaultPosition, wxSize(370, 22), - wxTE_READONLY); - uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - boxSizer->AddSpacer(25); -// second row: Visibility Range - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Visibility Range"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *visibilitySizer = - new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); - visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, - 5); - wxString range[4]; - range[0] = wxT("&None"); - range[1] = wxT("&Min"); - range[2] = wxT("&Max"); - range[3] = wxT("&Both"); - wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, - wxT("&Range Type"), - wxDefaultPosition, - wxDefaultSize, 4, - range, 2, - wxRA_SPECIFY_COLS); - visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - rangeBox->SetSelection(0); - visibilitySizer->AddSpacer(20); - wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); - visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); - scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); - wxStaticText *minScaleLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); - scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *minScaleCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - minScaleCtrl->Enable(false); - scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); - scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxStaticText *maxScaleLabel = - new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); - scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *maxScaleCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), - wxDefaultPosition, wxSize(100, 22)); - maxScaleCtrl->Enable(false); - scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdScaleChanged); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Visibility Range selection changed -// - wxRadioBox *scaleModeCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - switch (scaleModeCtrl->GetSelection()) - { - case 0: - Style->EnableMinScale(false); - Style->EnableMaxScale(false); - minCtrl->SetValue(wxT("0.0")); - minCtrl->Enable(false); - maxCtrl->SetValue(wxT("+Infinite")); - maxCtrl->Enable(false); - break; - case 1: - Style->EnableMinScale(true); - Style->EnableMaxScale(false); - minCtrl->SetValue(wxT("")); - minCtrl->Enable(true); - maxCtrl->SetValue(wxT("+Infinite")); - maxCtrl->Enable(false); - break; - case 2: - Style->EnableMinScale(false); - Style->EnableMaxScale(true); - minCtrl->SetValue(wxT("0.0")); - minCtrl->Enable(false); - maxCtrl->SetValue(wxT("")); - maxCtrl->Enable(true); - break; - case 3: - Style->EnableMinScale(true); - Style->EnableMaxScale(true); - minCtrl->SetValue(wxT("")); - minCtrl->Enable(true); - maxCtrl->SetValue(wxT("")); - maxCtrl->Enable(true); - break; - }; -} - -wxPanel *QuickStyleTopologyDialog::CreateNodePage(wxWindow * parent) -{ -// -// creating the Node Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: Opacity - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_NODE_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Well Known Mark Name - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString mark[6]; - mark[0] = wxT("&Square"); - mark[1] = wxT("&Circle"); - mark[2] = wxT("&Triangle"); - mark[3] = wxT("&Star"); - mark[4] = wxT("&Cross"); - mark[5] = wxT("&X"); - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_NODE_MARK, - wxT("&Mark"), - wxDefaultPosition, - wxDefaultSize, 6, - mark, 1, - wxRA_SPECIFY_COLS); - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - markBox->SetSelection(0); -// second row: Size and Rotation - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row A: Size - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *sizeCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_SIZE, wxT("16.0"), - wxDefaultPosition, wxSize(100, 22)); - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Rotation - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Rotation"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *rotCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ROTATION, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row: AnchorNode and Displacement - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// third row A: Anchor Node - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Anchor Node"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_X, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_Y, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Displacement - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - anchorBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// fourth row: colors - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// first row A: Fill Color - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *fillColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_FILL_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFillCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickFill = new wxButton(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, - wxT("&Pick a color")); - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - box3Sizer->AddSpacer(30); - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorStrokeSizer = - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *strokeColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_STROKE_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sampleStrokeCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickStroke = - new wxButton(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, - wxT("&Pick a color")); - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_NODE_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdNodeMarkChanged); - Connect(ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdNodeColorFillPicker); - Connect(ID_SYMBOLIZER_NODE_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdNodeColorFillChanged); - Connect(ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdNodeColorStrokePicker); - Connect(ID_SYMBOLIZER_NODE_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdNodeColorStrokeChanged); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdNodeMarkChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Mark selection changed -// - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); - switch (markCtrl->GetSelection()) - { - case 1: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); - break; - case 2: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); - break; - case 3: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_STAR); - break; - case 4: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CROSS); - break; - case 5: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_X); - break; - default: - Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); - break; - }; -} - -void QuickStyleTopologyDialog:: -OnCmdNodeColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_FILL_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdNodeColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleTopologyDialog:: -OnCmdNodeColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdNodeColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkPage(wxWindow * parent) -{ -// -// creating the EdgeLink Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: the Stroke #1 Opacity and Perpendicular Offset - boxSizer->AddSpacer(50); - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// first row B: PerpendicularOffset - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); - opacityBoxSizer->Add(perpendicularBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Perpendicular Offset"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *perpendicularSizer = - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); - perpendicularBoxSizer->Add(perpendicularSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *perpendicularCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Draw lines in parallel to the original geometry.")); - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Positive to the left-hand side. Negative numbers mean right.")); - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row: Stroke color or Graphic - wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row B: Stroke Color - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *colorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick = - new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row: Stroke-Width - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row A: StrokeWidth - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Width"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxTextCtrl *widthCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), - wxDefaultPosition, wxSize(100, 22)); - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row D: DashArray and DashOffset - wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString dot[4]; - if (Type == MAP_LAYER_NETWORK) - { - dot[0] = wxT("&Solid Link"); - dot[1] = wxT("&Dotted Link"); - dot[2] = wxT("&Dashed Link"); - dot[3] = wxT("&Dashed/Dotted Link"); - } else - { - dot[0] = wxT("&Solid Edge"); - dot[1] = wxT("&Dotted Edge"); - dot[2] = wxT("&Dashed Edge"); - dot[3] = wxT("&Dashed/Dotted Edge"); - } - wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, - wxT("&Dash/Dot Style"), - wxDefaultPosition, - wxDefaultSize, 4, - dot, 1, - wxRA_SPECIFY_COLS); - dotBox->SetSelection(0); - dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkColorChanged); - Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkColorPicker); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkColorChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkColorPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleTopologyDialog::CreateFacePage(wxWindow * parent) -{ -// -// creating the Face Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row: the Face Displacement and Perpendicular Offset - wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); -// first row A: Displacement - wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); - polygonBoxSizer->Add(displacementBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - displacementBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); -// first row B: PerpendicularOffset - wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); - polygonBoxSizer->Add(perpendicularBoxSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Perpendicular Offset"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *perpendicularSizer = - new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); - perpendicularBoxSizer->Add(perpendicularSizer, 0, - wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); - perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *perpendicularCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Positive: larger. / Negative: smaller.")); - perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); - wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, - wxT - ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); - perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row: Fill Opacity - wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Face Fill"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); - auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); - auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enableCtrl->SetValue(Style->IsFaceFill()); - enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(400, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacityCtrl->Enable(Style->IsFaceFill()); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Fill Color - wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); - auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); - colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); - wxTextCtrl *colorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - sampleCtrl->Enable(Style->IsFaceFill()); - color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); - colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick = - new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); - pick->Enable(Style->IsFaceFill()); - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// first row A: the Stroke #1 Opacity - wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Face Stroke"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); - opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, - wxT("Enable"), - wxDefaultPosition, wxDefaultSize); - enable2Ctrl->SetValue(Style->IsFaceStroke()); - enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); - enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxSlider *opacity2Ctrl = - new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(250, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacity2Ctrl->Enable(Style->IsFaceStroke()); - opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); - enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); - color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *color2Ctrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - color2Ctrl->Enable(Style->IsFaceStroke()); - color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sample2Ctrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - sample2Ctrl->Enable(Style->IsFaceStroke()); - color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); - color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxButton *pick2 = - new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); - pick2->Enable(Style->IsFaceStroke()); - picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row: Stroke-Width, - wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); - enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); -// third row A: StrokeWidth - wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); - miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Width"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); - widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *widthCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), - wxDefaultPosition, wxSize(100, 22)); - widthCtrl->Enable(false); - widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceStrokeChanged); - Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceFillChanged); - Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceColorFillChanged); - Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceColorFillPicker); - Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceColorStrokeChanged); - Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceColorStrokePicker); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdFaceStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->SetFaceStroke(true); - else - Style->SetFaceStroke(false); - RetrieveFacePage(false); - UpdateFacePage(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill enable/disable -// - wxCheckBox *enableCtrl = - (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); - if (enableCtrl->IsChecked() == true) - Style->SetFaceFill(true); - else - Style->SetFaceFill(false); - RetrieveFacePage(false); - UpdateFacePage(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleTopologyDialog:: -OnCmdFaceColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkSeedPage(wxWindow * parent) -{ -// -// creating the EdgeLinkSeed Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: Opacity - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_EDGELINK_SEED_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Well Known Mark Name - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString mark[6]; - mark[0] = wxT("&Square"); - mark[1] = wxT("&Circle"); - mark[2] = wxT("&Triangle"); - mark[3] = wxT("&Star"); - mark[4] = wxT("&Cross"); - mark[5] = wxT("&X"); - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_EDGELINK_SEED_MARK, - wxT("&Mark"), - wxDefaultPosition, - wxDefaultSize, 6, - mark, 1, - wxRA_SPECIFY_COLS); - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - markBox->SetSelection(0); -// second row: Size and Rotation - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row A: Size - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *sizeCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_SIZE, wxT("16.0"), - wxDefaultPosition, wxSize(100, 22)); - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Rotation - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Rotation"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *rotCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ROTATION, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row: AnchorEdgeLinkSeed and Displacement - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// third row A: Anchor EdgeLinkSeed - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Anchor EdgeLinkSeed"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Displacement - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - anchorBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X, - wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y, - wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// fourth row: colors - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// first row A: Fill Color - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *fillColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFillCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickFill = - new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, - wxT("&Pick a color")); - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - box3Sizer->AddSpacer(30); - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorStrokeSizer = - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *strokeColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sampleStrokeCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX, - bmp, - wxDefaultPosition, wxSize(32, 32)); - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickStroke = - new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, - wxT("&Pick a color")); - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_EDGELINK_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedMarkChanged); - Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, - wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillPicker); - Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillChanged); - Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, - wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokePicker); - Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokeChanged); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Mark selection changed -// - wxRadioBox *markCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); - switch (markCtrl->GetSelection()) - { - case 1: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); - break; - case 2: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); - break; - case 3: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); - break; - case 4: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); - break; - case 5: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_X); - break; - default: - Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); - break; - }; -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) - FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdEdgeLinkSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -wxPanel *QuickStyleTopologyDialog::CreateFaceSeedPage(wxWindow * parent) -{ -// -// creating the FaceSeed Symbolizer page -// - wxString StrokeColor = wxT("#000000"); - wxString FillColor = wxT("#808080"); - wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); - wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); - panel->SetSizer(topSizer); - wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); - topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); -// first row A: Opacity - wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Opacity"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); - opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxSlider *opacityCtrl = - new wxSlider(panel, ID_SYMBOLIZER_FACE_SEED_OPACITY, 100, 0, 100, - wxDefaultPosition, wxSize(600, 45), - wxSL_HORIZONTAL | wxSL_LABELS); - opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// Well Known Mark Name - wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); - wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); - box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxString mark[6]; - mark[0] = wxT("&Square"); - mark[1] = wxT("&Circle"); - mark[2] = wxT("&Triangle"); - mark[3] = wxT("&Star"); - mark[4] = wxT("&Cross"); - mark[5] = wxT("&X"); - wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_FACE_SEED_MARK, - wxT("&Mark"), - wxDefaultPosition, - wxDefaultSize, 6, - mark, 1, - wxRA_SPECIFY_COLS); - markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - markBox->SetSelection(0); -// second row: Size and Rotation - wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); - box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// second row A: Size - wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Size"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); - sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); - sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *sizeCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_SIZE, wxT("16.0"), - wxDefaultPosition, wxSize(100, 22)); - size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Rotation - wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Rotation"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); - sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); - rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *rotCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ROTATION, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row: AnchorFaceSeed and Displacement - wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); - box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// third row A: Anchor FaceSeed - wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Anchor FaceSeed"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); - anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_X, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); - anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *anchorYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y, wxT("0.5"), - wxDefaultPosition, wxSize(100, 22)); - anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// third row B: Displacement - wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Displacement"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *displacementSizer = - new wxStaticBoxSizer(displacementBox, wxVERTICAL); - anchorBoxSizer->Add(displacementSizer, 0, - wxALIGN_CENTER_HORIZONTAL | wxALL, 20); - wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); - displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementXCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); - displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); - displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxTextCtrl *displacementYCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y, wxT("0.0"), - wxDefaultPosition, wxSize(100, 22)); - displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// fourth row: colors - wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); - boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); -// first row A: Fill Color - wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); - box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Fill Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); - box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *fillColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, FillColor, - wxDefaultPosition, wxSize(80, 22)); - fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxBitmap bmp; - wxColour color(0, 0, 0); - ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); - wxStaticBitmap *sampleFillCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickFill = - new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, - wxT("&Pick a color")); - fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// second row B: Stroke Color - box3Sizer->AddSpacer(30); - wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, - wxT("Stroke Color"), - wxDefaultPosition, - wxDefaultSize); - wxBoxSizer *colorStrokeSizer = - new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); - box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); - wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); - colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); - wxTextCtrl *strokeColorCtrl = - new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, StrokeColor, - wxDefaultPosition, wxSize(80, 22)); - stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxStaticBitmap *sampleStrokeCtrl = - new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, bmp, - wxDefaultPosition, wxSize(32, 32)); - stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - wxButton *pickStroke = - new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, - wxT("&Pick a color")); - stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); - panel->SetSizer(topSizer); - topSizer->Fit(panel); -// appends event handlers - Connect(ID_SYMBOLIZER_FACE_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceSeedMarkChanged); - Connect(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceSeedColorFillPicker); - Connect(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceSeedColorFillChanged); - Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, - wxEVT_COMMAND_BUTTON_CLICKED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokePicker); - Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, - (wxObjectEventFunction) & - QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokeChanged); - return panel; -} - -void QuickStyleTopologyDialog:: -OnCmdFaceSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Mark selection changed -// - wxRadioBox *markCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); - switch (markCtrl->GetSelection()) - { - case 1: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); - break; - case 2: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); - break; - case 3: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); - break; - case 4: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); - break; - case 5: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_X); - break; - default: - Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); - break; - }; -} - -void QuickStyleTopologyDialog:: -OnCmdFaceSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Fill color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - -void QuickStyleTopologyDialog:: -OnCmdFaceSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) -{ -// -// Stroke color changed: updating the visual sample -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); - wxStaticBitmap *sampleCtrl = - (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX); - wxColour back = wxColour(255, 255, 255); - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, back); - wxBitmap bmp; - ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); - sampleCtrl->SetBitmap(bmp); - sampleCtrl->Refresh(); - sampleCtrl->Update(); -} - -void QuickStyleTopologyDialog:: -OnCmdFaceSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) -{ -// -// color picker -// - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); - wxColour clr = wxNullColour; - wxString str = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(str) == true) - ColorMapEntry::GetWxColor(str, clr); - wxColour color = wxGetColourFromUser(this, clr); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } -} - - - - - -bool QuickStyleTopologyDialog::RetrieveMainPage() -{ -// -// retrieving params from the MAIN page -// - double min = Style->GetScaleMin(); - double max = Style->GetScaleMax(); - if (Style->IsMinScaleEnabled() == true) - { - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - wxString value = minCtrl->GetValue(); - if (value.ToDouble(&min) != true) - { - wxMessageBox(wxT - ("MIN_SCALE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - if (min < 0.0) - { - wxMessageBox(wxT - ("MIN_SCALE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsMaxScaleEnabled() == true) - { - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - wxString value = maxCtrl->GetValue(); - if (value.ToDouble(&max) != true) - { - wxMessageBox(wxT - ("MAX_SCALE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - if (max < 0.0) - { - wxMessageBox(wxT - ("MAX_SCALE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) - { - if (min >= max) - { - wxMessageBox(wxT - ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - Style->SetScaleMin(min); - Style->SetScaleMax(max); - return true; -} - -void QuickStyleTopologyDialog::UpdateMainPage() -{ -// -// updating the MAIN page -// - wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); - if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) - rangeBox->SetSelection(0); - else if (Style->IsMinScaleEnabled() == true - && Style->IsMaxScaleEnabled() != true) - rangeBox->SetSelection(1); - else if (Style->IsMinScaleEnabled() != true - && Style->IsMaxScaleEnabled() == true) - rangeBox->SetSelection(2); - else - rangeBox->SetSelection(3); - wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); - char dummy[64]; - wxString str; - if (Style->IsMinScaleEnabled() == true) - { - sprintf(dummy, "%1.2f", Style->GetScaleMin()); - str = wxString::FromUTF8(dummy); - minCtrl->SetValue(str); - minCtrl->Enable(true); - } else - { - str = wxT("0.0"); - minCtrl->SetValue(str); - minCtrl->Enable(false); - } - wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); - if (Style->IsMaxScaleEnabled() == true) - { - sprintf(dummy, "%1.2f", Style->GetScaleMax()); - str = wxString::FromUTF8(dummy); - maxCtrl->SetValue(str); - maxCtrl->Enable(true); - } else - { - str = wxT("+Infinite"); - maxCtrl->SetValue(str); - maxCtrl->Enable(false); - } -} - -bool QuickStyleTopologyDialog::RetrieveNodePage(bool check) -{ -// -// retrieving params from the Node Nodeizer page -// - double opacity; - double size; - double rotation; - double anchorNodeX; - double anchorNodeY; - double displacementX; - double displacementY; - char fillColor[8]; - char strokeColor[8]; - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&size) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (size < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); - value = rotationCtrl->GetValue(); - if (value.ToDouble(&rotation) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ROTATION isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); - value = anchorXCtrl->GetValue(); - if (value.ToDouble(&anchorNodeX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorNodeX < 0.0 || anchorNodeX > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); - value = anchorYCtrl->GetValue(); - if (value.ToDouble(&anchorNodeY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorNodeY < 0.0 || anchorNodeY > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); - value = displXCtrl->GetValue(); - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); - color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - Style->SetNodeOpacity(opacity); - Style->SetNodeSize(size); - Style->SetNodeRotation(rotation); - Style->SetNodeAnchorX(anchorNodeX); - Style->SetNodeAnchorY(anchorNodeY); - Style->SetNodeDisplacementX(displacementX); - Style->SetNodeDisplacementY(displacementY); - Style->SetNodeFillColor(fillColor); - Style->SetNodeStrokeColor(strokeColor); - return true; -} - -void QuickStyleTopologyDialog::UpdateNodePage() -{ -// -// updating the Node Nodeizer page -// - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); - opacityCtrl->SetValue(Style->GetNodeOpacity() * 100.0); - wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetNodeSize()); - wxString str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); - sprintf(dummy, "%1.2f", Style->GetNodeRotation()); - str = wxString::FromUTF8(dummy); - rotationCtrl->SetValue(str); - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); - sprintf(dummy, "%1.2f", Style->GetNodeAnchorX()); - str = wxString::FromUTF8(dummy); - anchorXCtrl->SetValue(str); - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); - sprintf(dummy, "%1.2f", Style->GetNodeAnchorY()); - str = wxString::FromUTF8(dummy); - anchorYCtrl->SetValue(str); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); - sprintf(dummy, "%1.2f", Style->GetNodeDisplacementX()); - str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetNodeDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); - switch (Style->GetNodeWellKnownMark()) - { - case RL2_GRAPHIC_MARK_CIRCLE: - markCtrl->SetSelection(1); - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - markCtrl->SetSelection(2); - break; - case RL2_GRAPHIC_MARK_STAR: - markCtrl->SetSelection(3); - break; - case RL2_GRAPHIC_MARK_CROSS: - markCtrl->SetSelection(4); - break; - case RL2_GRAPHIC_MARK_X: - markCtrl->SetSelection(5); - break; - default: - markCtrl->SetSelection(0); - break; - }; - wxTextCtrl *colorFillCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); - wxString fillColor = wxString::FromUTF8(Style->GetNodeFillColor()); - colorFillCtrl->SetValue(fillColor); - wxTextCtrl *colorStrokeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); - wxString strokeColor = wxString::FromUTF8(Style->GetNodeStrokeColor()); - colorStrokeCtrl->SetValue(strokeColor); -} - -bool QuickStyleTopologyDialog::RetrieveEdgeLinkPage(bool check) -{ -// -// retrieving params from the EdgeLink Symbolizer page -// - double opacity; - double perpendicularOffset; - char strokeColor[8]; - double strokeWidth; - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); - wxString value = perpCtrl->GetValue(); - if (value.ToDouble(&perpendicularOffset) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); - value = widthCtrl->GetValue(); - if (value.ToDouble(&strokeWidth) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (strokeWidth <= 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-WIDTH must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); - switch (dotCtrl->GetSelection()) - { - case 1: - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DOT_LINE); - break; - case 2: - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_LINE); - break; - case 3: - Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_DOT_LINE); - break; - default: - Style->SetEdgeLinkDotStyle(QUICK_STYLE_SOLID_LINE); - break; - }; - Style->SetEdgeLinkOpacity(opacity); - Style->SetEdgeLinkPerpendicularOffset(perpendicularOffset); - Style->SetEdgeLinkStrokeWidth(strokeWidth); - Style->SetEdgeLinkStrokeColor(strokeColor); - return true; -} - -void QuickStyleTopologyDialog::UpdateEdgeLinkPage() -{ -// -// updating the EdgeLink Symbolizer page -// - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); - opacityCtrl->SetValue(Style->GetEdgeLinkOpacity() * 100.0); - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetEdgeLinkPerpendicularOffset()); - wxString str = wxString::FromUTF8(dummy); - perpCtrl->SetValue(str); - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); - colorCtrl->Enable(true); - pick->Enable(true); - wxString strokeColor = wxString::FromUTF8(Style->GetEdgeLinkStrokeColor()); - colorCtrl->SetValue(strokeColor); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkStrokeWidth()); - str = wxString::FromUTF8(dummy); - wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); - switch (Style->GetEdgeLinkDotStyle()) - { - case QUICK_STYLE_DOT_LINE: - dotCtrl->SetSelection(1); - break; - case QUICK_STYLE_DASH_LINE: - dotCtrl->SetSelection(2); - break; - case QUICK_STYLE_DASH_DOT_LINE: - dotCtrl->SetSelection(3); - break; - default: - dotCtrl->SetSelection(0); - break; - }; - widthCtrl->SetValue(str); -} - -bool QuickStyleTopologyDialog::RetrieveFacePage(bool check) -{ -// -// retrieving params from the Face Synbolizer page -// - double fillOpacity; - double displacementX; - double displacementY; - double perpendicularOffset; - char fillColor[8]; - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); - fillOpacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); - wxString value = displXCtrl->GetValue(); - if (Style->IsFaceFill() != true && Style->IsFaceStroke() != true) - { - if (check == true) - { - wxMessageBox(wxT - ("You can't disable both FILL and STROKE at the same time !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); - value = perpCtrl->GetValue(); - if (value.ToDouble(&perpendicularOffset) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - Style->SetFaceFillOpacity(fillOpacity); - Style->SetFaceDisplacementX(displacementX); - Style->SetFaceDisplacementY(displacementY); - Style->SetFacePerpendicularOffset(perpendicularOffset); - Style->SetFaceFillColor(fillColor); - return true; -} - -void QuickStyleTopologyDialog::UpdateFacePage() -{ -// -// updating the Face Symbolizer page -// - wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); - enableBox->SetValue(Style->IsFaceFill()); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetFaceDisplacementX()); - wxString str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetFaceDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxTextCtrl *perpCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); - sprintf(dummy, "%1.2f", Style->GetFacePerpendicularOffset()); - str = wxString::FromUTF8(dummy); - perpCtrl->SetValue(str); - wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); - opacityCtrl->SetValue(Style->GetFaceFillOpacity() * 100.0); - opacityCtrl->Enable(Style->IsFaceFill()); - wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); - wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); - wxColour color = wxNullColour; - str = wxString::FromUTF8(Style->GetFaceFillColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - colorCtrl->SetValue(str); - } - colorCtrl->Enable(Style->IsFaceFill()); - pick->Enable(Style->IsFaceFill()); - wxSlider *opacity2Ctrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); - opacity2Ctrl->SetValue(Style->GetFaceStrokeOpacity() * 100.0); - opacity2Ctrl->Enable(Style->IsFaceStroke()); - wxTextCtrl *color2Ctrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); - wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); - color = wxNullColour; - str = wxString::FromUTF8(Style->GetFaceStrokeColor()); - ColorMapEntry::GetWxColor(str, color); - if (color.IsOk() == true) - { - char hex[16]; - sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); - wxString str = wxString::FromUTF8(hex); - color2Ctrl->SetValue(str); - } - color2Ctrl->Enable(Style->IsFaceStroke()); - pick2->Enable(Style->IsFaceStroke()); - wxTextCtrl *widthCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); - sprintf(dummy, "%1.2f", Style->GetFaceStrokeWidth()); - str = wxString::FromUTF8(dummy); - widthCtrl->SetValue(str); - widthCtrl->Enable(Style->IsFaceStroke()); -} - -bool QuickStyleTopologyDialog::RetrieveEdgeLinkSeedPage(bool check) -{ -// -// retrieving params from the EdgeLinkSeed EdgeLinkSeedizer page -// - double opacity; - double size; - double rotation; - double anchorEdgeLinkSeedX; - double anchorEdgeLinkSeedY; - double displacementX; - double displacementY; - char fillColor[8]; - char strokeColor[8]; - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *sizeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&size) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (size < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); - value = rotationCtrl->GetValue(); - if (value.ToDouble(&rotation) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ROTATION isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); - value = anchorXCtrl->GetValue(); - if (value.ToDouble(&anchorEdgeLinkSeedX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorEdgeLinkSeedX < 0.0 || anchorEdgeLinkSeedX > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); - value = anchorYCtrl->GetValue(); - if (value.ToDouble(&anchorEdgeLinkSeedY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorEdgeLinkSeedY < 0.0 || anchorEdgeLinkSeedY > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); - value = displXCtrl->GetValue(); - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); - color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - Style->SetEdgeLinkSeedOpacity(opacity); - Style->SetEdgeLinkSeedSize(size); - Style->SetEdgeLinkSeedRotation(rotation); - Style->SetEdgeLinkSeedAnchorX(anchorEdgeLinkSeedX); - Style->SetEdgeLinkSeedAnchorY(anchorEdgeLinkSeedY); - Style->SetEdgeLinkSeedDisplacementX(displacementX); - Style->SetEdgeLinkSeedDisplacementY(displacementY); - Style->SetEdgeLinkSeedFillColor(fillColor); - Style->SetEdgeLinkSeedStrokeColor(strokeColor); - return true; -} - -void QuickStyleTopologyDialog::UpdateEdgeLinkSeedPage() -{ -// -// updating the EdgeLinkSeed EdgeLinkSeedizer page -// - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); - opacityCtrl->SetValue(Style->GetEdgeLinkSeedOpacity() * 100.0); - wxTextCtrl *sizeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedSize()); - wxString str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedRotation()); - str = wxString::FromUTF8(dummy); - rotationCtrl->SetValue(str); - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorX()); - str = wxString::FromUTF8(dummy); - anchorXCtrl->SetValue(str); - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorY()); - str = wxString::FromUTF8(dummy); - anchorYCtrl->SetValue(str); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementX()); - str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxRadioBox *markCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); - switch (Style->GetEdgeLinkSeedWellKnownMark()) - { - case RL2_GRAPHIC_MARK_CIRCLE: - markCtrl->SetSelection(1); - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - markCtrl->SetSelection(2); - break; - case RL2_GRAPHIC_MARK_STAR: - markCtrl->SetSelection(3); - break; - case RL2_GRAPHIC_MARK_CROSS: - markCtrl->SetSelection(4); - break; - case RL2_GRAPHIC_MARK_X: - markCtrl->SetSelection(5); - break; - default: - markCtrl->SetSelection(0); - break; - }; - wxTextCtrl *colorFillCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); - wxString fillColor = wxString::FromUTF8(Style->GetEdgeLinkSeedFillColor()); - colorFillCtrl->SetValue(fillColor); - wxTextCtrl *colorStrokeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); - wxString strokeColor = - wxString::FromUTF8(Style->GetEdgeLinkSeedStrokeColor()); - colorStrokeCtrl->SetValue(strokeColor); -} - -bool QuickStyleTopologyDialog::RetrieveFaceSeedPage(bool check) -{ -// -// retrieving params from the FaceSeed FaceSeedizer page -// - double opacity; - double size; - double rotation; - double anchorFaceSeedX; - double anchorFaceSeedY; - double displacementX; - double displacementY; - char fillColor[8]; - char strokeColor[8]; - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); - opacity = opacityCtrl->GetValue() / 100.0; - wxTextCtrl *sizeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); - wxString value = sizeCtrl->GetValue(); - if (value.ToDouble(&size) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (size < 0.0) - { - if (check == true) - { - wxMessageBox(wxT - ("SIZE must be a positive number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); - value = rotationCtrl->GetValue(); - if (value.ToDouble(&rotation) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ROTATION isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); - value = anchorXCtrl->GetValue(); - if (value.ToDouble(&anchorFaceSeedX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorFaceSeedX < 0.0 || anchorFaceSeedX > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); - value = anchorYCtrl->GetValue(); - if (value.ToDouble(&anchorFaceSeedY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - if (anchorFaceSeedY < 0.0 || anchorFaceSeedY > 1.0) - { - if (check == true) - { - wxMessageBox(wxT - ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); - value = displXCtrl->GetValue(); - if (value.ToDouble(&displacementX) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-X isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); - value = displYCtrl->GetValue(); - if (value.ToDouble(&displacementY) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("DISPLACEMENT-Y isn't a valid decimal number !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - wxTextCtrl *colorCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); - wxString color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("FILL-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(fillColor, color.ToUTF8()); - colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); - color = colorCtrl->GetValue(); - if (ColorMapEntry::IsValidColor(color) != true) - { - if (check == true) - { - wxMessageBox(wxT - ("STROKE-COLOR isn't a valid HexRGB color !!!"), - wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); - return false; - } - } - strcpy(strokeColor, color.ToUTF8()); - Style->SetFaceSeedOpacity(opacity); - Style->SetFaceSeedSize(size); - Style->SetFaceSeedRotation(rotation); - Style->SetFaceSeedAnchorX(anchorFaceSeedX); - Style->SetFaceSeedAnchorY(anchorFaceSeedY); - Style->SetFaceSeedDisplacementX(displacementX); - Style->SetFaceSeedDisplacementY(displacementY); - Style->SetFaceSeedFillColor(fillColor); - Style->SetFaceSeedStrokeColor(strokeColor); - return true; -} - -void QuickStyleTopologyDialog::UpdateFaceSeedPage() -{ -// -// updating the FaceSeed FaceSeedizer page -// - wxSlider *opacityCtrl = - (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); - opacityCtrl->SetValue(Style->GetFaceSeedOpacity() * 100.0); - wxTextCtrl *sizeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); - char dummy[64]; - sprintf(dummy, "%1.2f", Style->GetFaceSeedSize()); - wxString str = wxString::FromUTF8(dummy); - sizeCtrl->SetValue(str); - wxTextCtrl *rotationCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); - sprintf(dummy, "%1.2f", Style->GetFaceSeedRotation()); - str = wxString::FromUTF8(dummy); - rotationCtrl->SetValue(str); - wxTextCtrl *anchorXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); - sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorX()); - str = wxString::FromUTF8(dummy); - anchorXCtrl->SetValue(str); - wxTextCtrl *anchorYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); - sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorY()); - str = wxString::FromUTF8(dummy); - anchorYCtrl->SetValue(str); - wxTextCtrl *displXCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); - sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementX()); - str = wxString::FromUTF8(dummy); - displXCtrl->SetValue(str); - wxTextCtrl *displYCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); - sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementY()); - str = wxString::FromUTF8(dummy); - displYCtrl->SetValue(str); - wxRadioBox *markCtrl = - (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); - switch (Style->GetFaceSeedWellKnownMark()) - { - case RL2_GRAPHIC_MARK_CIRCLE: - markCtrl->SetSelection(1); - break; - case RL2_GRAPHIC_MARK_TRIANGLE: - markCtrl->SetSelection(2); - break; - case RL2_GRAPHIC_MARK_STAR: - markCtrl->SetSelection(3); - break; - case RL2_GRAPHIC_MARK_CROSS: - markCtrl->SetSelection(4); - break; - case RL2_GRAPHIC_MARK_X: - markCtrl->SetSelection(5); - break; - default: - markCtrl->SetSelection(0); - break; - }; - wxTextCtrl *colorFillCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); - wxString fillColor = wxString::FromUTF8(Style->GetFaceSeedFillColor()); - colorFillCtrl->SetValue(fillColor); - wxTextCtrl *colorStrokeCtrl = - (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); - wxString strokeColor = wxString::FromUTF8(Style->GetFaceSeedStrokeColor()); - colorStrokeCtrl->SetValue(strokeColor); -} - -void QuickStyleTopologyDialog::OnPageChanging(wxNotebookEvent & event) -{ -// -// TAB/PAGE selection changing -// - bool ret = false; - int idx = event.GetOldSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else if (idx == 1) - ret = RetrieveNodePage(); - else if (idx == 2) - ret = RetrieveEdgeLinkPage(); - else - { - if (Type == MAP_LAYER_NETWORK) - { - if (idx == 3) - ret = RetrieveEdgeLinkSeedPage(); - } else - { - if (idx == 3) - ret = RetrieveFacePage(); - if (idx == 4) - ret = RetrieveEdgeLinkSeedPage(); - if (idx == 5) - ret = RetrieveFaceSeedPage(); - } - } - if (ret != true) - event.Veto(); -} - -void QuickStyleTopologyDialog::OnPageChanged(wxNotebookEvent & event) -{ -// -// TAB/PAGE selection changed -// - int idx = event.GetSelection(); - if (idx == 0) - UpdateMainPage(); - else if (idx == 1) - UpdateNodePage(); - else if (idx == 2) - UpdateEdgeLinkPage(); - else - { - if (Type == MAP_LAYER_NETWORK) - { - if (idx == 3) - UpdateEdgeLinkSeedPage(); - } else - { - if (idx == 3) - UpdateFacePage(); - if (idx == 4) - UpdateEdgeLinkSeedPage(); - if (idx == 5) - UpdateFaceSeedPage(); - } - } -} - -bool QuickStyleTopologyDialog::UpdateStyle() -{ -// -// updating the QuickStyle -// - bool ret = false; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else if (idx == 1) - ret = RetrieveNodePage(); - else if (idx == 2) - ret = RetrieveEdgeLinkPage(); - else - { - if (Type == MAP_LAYER_NETWORK) - { - if (idx == 3) - ret = RetrieveEdgeLinkSeedPage(); - } else - { - if (idx == 3) - ret = RetrieveFacePage(); - if (idx == 4) - ret = RetrieveEdgeLinkSeedPage(); - if (idx == 5) - ret = RetrieveFaceSeedPage(); - } - } - if (ret == false) - return false; - - VectorLayerConfig *config = Layer->GetVectorConfig(); - bool setCurrentStyle = false; - if (config->GetStyle() == NULL) - setCurrentStyle = true; - else - { - if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) - setCurrentStyle = true; - } - if (setCurrentStyle == true) - { - config->SetStyle(Style->GetUUID()); - IsConfigChanged = true; - } - IsConfigChanged = Layer->UpdateQuickStyle(Style); - return true; -} - -void QuickStyleTopologyDialog::OnOk(wxCommandEvent & WXUNUSED(event)) -{ -// -// permanently saving the QuickStyle and quitting -// - if (UpdateStyle() == true) - wxDialog::EndModal(wxID_OK); -} - -void QuickStyleTopologyDialog::OnApply(wxCommandEvent & WXUNUSED(event)) -{ -// -// applying the QuickStyle and continuing -// - if (UpdateStyle() == true) - { - if (IsConfigChanged == true) - MapPanel->RefreshMap(); - } -} - -void QuickStyleTopologyDialog::OnExport(wxCommandEvent & WXUNUSED(event)) -{ -// -// exporting the Quick Style as an external file -// - bool xret = false; - int ret; - wxString path; - wxString lastDir; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - xret = RetrieveMainPage(); - else if (idx == 1) - xret = RetrieveNodePage(); - else if (idx == 2) - xret = RetrieveEdgeLinkPage(); - else - { - if (Type == MAP_LAYER_NETWORK) - { - if (idx == 3) - xret = RetrieveEdgeLinkSeedPage(); - } else - { - if (idx == 3) - xret = RetrieveFacePage(); - if (idx == 4) - xret = RetrieveEdgeLinkSeedPage(); - if (idx == 5) - xret = RetrieveFaceSeedPage(); - } - } - if (xret == false) - return; - - wxFileDialog fileDialog(this, - wxT("Exporting an SLD/SE QuickStyle to a file"), - wxT(""), wxT("style.xml"), - wxT("XML Document|*.xml|All files (*.*)|*.*"), - wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, - wxDefaultSize, wxT("filedlg")); - lastDir = MainFrame->GetLastDirectory(); - if (lastDir.Len() >= 1) - fileDialog.SetDirectory(lastDir); - ret = fileDialog.ShowModal(); - if (ret == wxID_OK) - { - wxFileName file(fileDialog.GetPath()); - path = file.GetPath(); - path += file.GetPathSeparator(); - path += file.GetName(); - lastDir = file.GetPath(); - path = fileDialog.GetPath(); - FILE *out = fopen(path.ToUTF8(), "wb"); - if (out == NULL) - wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), - wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); - else - { - char *xml = Style->CreateXmlStyle(); - fwrite(xml, 1, strlen(xml), out); - sqlite3_free(xml); - fclose(out); - wxMessageBox(wxT - ("SLD/SE QuickStyle successfully saved into:\n\n\"") - + path + wxT("\""), wxT("spatialite_gui"), - wxOK | wxICON_INFORMATION, this); - } - } -} - -void QuickStyleTopologyDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) -{ -// -// Copying the Quick Style into the Clipboard -// - bool ret = false; - int idx = GetBookCtrl()->GetSelection(); - if (idx == 0) - ret = RetrieveMainPage(); - else if (idx == 1) - ret = RetrieveNodePage(); - else if (idx == 2) - ret = RetrieveEdgeLinkPage(); - else - { - if (Type == MAP_LAYER_NETWORK) - { - if (idx == 3) - ret = RetrieveEdgeLinkSeedPage(); - } else - { - if (idx == 3) - ret = RetrieveFacePage(); - if (idx == 4) - ret = RetrieveEdgeLinkSeedPage(); - if (idx == 5) - ret = RetrieveFaceSeedPage(); - } - } - if (ret == false) - return; - - char *xml = Style->CreateXmlStyle(); - wxString XMLstring = wxString::FromUTF8(xml); - sqlite3_free(xml); - if (wxTheClipboard->Open()) - { - wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); - wxTheClipboard->Close(); - } -} - -void QuickStyleTopologyDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) -{ -// -// all done: -// - wxDialog::EndModal(wxID_CANCEL); -} ADDED QuickStylesRaster.cpp Index: QuickStylesRaster.cpp ================================================================== --- QuickStylesRaster.cpp +++ QuickStylesRaster.cpp @@ -0,0 +1,2657 @@ +/* +/ QuickStylesRaster.cpp +/ Quick Styles wizards (Raster layers) +/ +/ version 2.0, 2018 June 7 +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2017 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include "Classdef.h" + +#include "wx/spinctrl.h" +#include "wx/imaglist.h" +#include "wx/colordlg.h" +#include "wx/filename.h" +#include "wx/clipbrd.h" + +QuickStyleRasterObj::QuickStyleRasterObj() +{ +// ctor + QuickStyleObj::DoGetUUID(UUID); + MinScaleEnabled = false; + MaxScaleEnabled = false; + ScaleMin = 0.0; + ScaleMax = 0.0; + Opacity = 1.0; + Normalize = false; + Histogram = false; + Gamma = false; + GammaValue = 1.0; + TripleBand = false; + SingleBand = false; + RedBand = 0; + GreenBand = 0; + BlueBand = 0; + GrayBand = 0; + SrtmColorMap = false; + TerrainColorMap = false; + NdviColorMap = false; + ColorRamp = false; + MinValue = 0.0; + ShadedRelief = false; + ShadedReliefFactor = 0.0; + QuickStyleObj::RandomColor(MinValueColor); + MaxValue = 0.0; + QuickStyleObj::RandomColor(MaxValueColor); + XmlStyle = NULL; +} + +QuickStyleRasterObj *QuickStyleRasterObj::Clone() +{ +// +// cloning a Quick Style - Raster +// + QuickStyleRasterObj *Style = new QuickStyleRasterObj(); + strcpy(Style->UUID, this->UUID); + Style->MinScaleEnabled = this->MinScaleEnabled; + Style->MaxScaleEnabled = this->MaxScaleEnabled; + Style->ScaleMin = this->ScaleMin; + Style->ScaleMax = this->ScaleMax; + Style->Opacity = this->Opacity; + Style->Normalize = this->Normalize; + Style->Histogram = this->Histogram; + Style->Gamma = this->Gamma; + Style->GammaValue = this->GammaValue; + Style->TripleBand = this->TripleBand; + Style->SingleBand = this->SingleBand; + Style->RedBand = this->RedBand; + Style->GreenBand = this->GreenBand; + Style->BlueBand = this->BlueBand; + Style->GrayBand = this->GrayBand; + Style->SrtmColorMap = this->SrtmColorMap; + Style->TerrainColorMap = this->TerrainColorMap; + Style->NdviColorMap = this->NdviColorMap; + Style->ColorRamp = this->ColorRamp; + Style->MinValue = this->MinValue; + strcpy(Style->MinValueColor, this->MinValueColor); + Style->MaxValue = this->MaxValue; + strcpy(Style->MaxValueColor, this->MaxValueColor); + Style->ShadedRelief = this->ShadedRelief; + Style->ShadedReliefFactor = this->ShadedReliefFactor; + Style->XmlStyle = NULL; + return Style; +} + +bool QuickStyleRasterObj::Compare(QuickStyleRasterObj * Style) +{ +// +// comparing two Quick Style objects - Raster +// + if (Style == NULL) + return false; + if (strcmp(Style->UUID, this->UUID) != 0) + return false; + if (Style->MinScaleEnabled != this->MinScaleEnabled) + return false; + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) + return false; + if (Style->ScaleMin != this->ScaleMin) + return false; + if (Style->ScaleMax != this->ScaleMax) + return false; + if (Style->Opacity != this->Opacity) + return false; + if (Style->Normalize != this->Normalize) + return false; + if (Style->Histogram != this->Histogram) + return false; + if (Style->Gamma != this->Gamma) + return false; + if (Style->GammaValue != this->GammaValue) + return false; + if (Style->TripleBand != this->TripleBand) + return false; + if (Style->SingleBand != this->SingleBand) + return false; + if (Style->RedBand != this->RedBand) + return false; + if (Style->GreenBand != this->GreenBand) + return false; + if (Style->BlueBand != this->BlueBand) + return false; + if (Style->GrayBand != this->GrayBand) + return false; + if (Style->SrtmColorMap != this->SrtmColorMap) + return false; + if (Style->TerrainColorMap != this->TerrainColorMap) + return false; + if (Style->NdviColorMap != this->NdviColorMap) + return false; + if (Style->ColorRamp != this->ColorRamp) + return false; + if (Style->MinValue != this->MinValue) + return false; + if (strcmp(Style->MinValueColor, this->MinValueColor) != 0) + return false; + if (Style->MaxValue != this->MaxValue) + return false; + if (strcmp(Style->MaxValueColor, this->MaxValueColor) != 0) + return false; + if (Style->ShadedRelief != this->ShadedRelief) + return false; + if (Style->ShadedReliefFactor != this->ShadedReliefFactor) + return false; + return true; +} + +char *QuickStyleRasterObj::DoCreatePredefinedSrtmStyle(char *base_xml) +{ +// +// creating the predefined SRTM Style +// + char *prev = base_xml; + char *xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\tRasterdata\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-11000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-8000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#000032\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-5000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#0a0a64\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-3000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#1e1e96\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-1000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#4646c8\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-100.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#6464e1\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#aaaaff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.10000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#399769\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t100.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#75c25d\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t500.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#e6e680\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t1000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ca9e4b\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t2000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#b99a64\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t3000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#dcdcdc\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t5000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ffffff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t8850.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#6464c8\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleRasterObj::DoCreatePredefinedTerrainStyle(char *base_xml) +{ +// +// creating the predefined Terrain Style +// + char *prev = base_xml; + char *xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\tRasterdata\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-11000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-500.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#00001e\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-100.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#0000c8\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-1.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#9696ff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#007800\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t100.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#009600\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t270.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#5aa55a\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t300.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#5aaf5a\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t500.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#32b432\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t500.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#46aa46\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t1000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#46914b\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t1000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#469b4b\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t2000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#969c64\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t2800.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#dcdcdc\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t3000.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ffffff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t8850.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ffffff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleRasterObj::DoCreatePredefinedNdviStyle(char *base_xml) +{ +// +// creating the predefined NDVI Style +// + char *prev = base_xml; + char *xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\tRasterdata\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-1.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#051852\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-0.30000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#051852\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t-0.18000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ffffff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#ffffff\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.02500000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#cec5b4\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.07500000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#bfa37c\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.12500000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#b3ae60\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.15000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#a3b550\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.17500000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#90aa3c\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.23300000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#a6c31d\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.26600000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#87b703\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.33300000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#79af01\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.36600000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#65a300\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.43300000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#4e9700\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.46600000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#2b8404\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.55000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#007200\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.65000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#005a01\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.75000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#004900\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.85000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#003800\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t0.95000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#001f00\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t1.00000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\t#000000\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleRasterObj::CreateXmlStyle() +{ +// +// creating the XML Style +// + if (MinScaleEnabled == false && MaxScaleEnabled == false && Opacity == 1.0 + && Normalize == false && Histogram == false && Gamma == false + && TripleBand == false && SingleBand == false && SrtmColorMap == false + && TerrainColorMap == false && NdviColorMap == false && ColorRamp == false + && ShadedRelief == false) + return NULL; // NULL Raster Style - no option is set + + char *prev; + char *xml = sqlite3_mprintf("\r\n"); + prev = xml; + xml = sqlite3_mprintf("%s\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t%s\r\n", prev, "Quick Style"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t%1.2f\r\n", prev, Opacity); + sqlite3_free(prev); + prev = xml; + if (SrtmColorMap == true) + { + // special case: predefined SRTM style + xml = DoCreatePredefinedSrtmStyle(prev); + prev = xml; + goto shaded_relief; + } + if (TerrainColorMap == true) + { + // special case: predefined Terrain style + xml = DoCreatePredefinedTerrainStyle(prev); + prev = xml; + goto shaded_relief; + } + if (NdviColorMap == true) + { + // special case: predefined NDVI style + xml = DoCreatePredefinedNdviStyle(prev); + prev = xml; + goto foot; + } + if (TripleBand == true || SingleBand == true) + { + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (TripleBand == true) + { + xml = + sqlite3_mprintf + ("%s\t\t\t\t\r\n\t\t\t\t\t%d", prev, + RedBand + 1); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\r\n\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\r\n\t\t\t\t\t%d", + prev, GreenBand + 1); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\r\n\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\r\n\t\t\t\t\t%d", prev, + BlueBand + 1); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\r\n\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (SingleBand == true) + { + xml = + sqlite3_mprintf + ("%s\t\t\t\t\r\n\t\t\t\t\t%d", prev, + GrayBand + 1); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\r\n\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (Normalize == true || Histogram == true || Gamma == true) + { + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (Histogram == true) + { + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } else if (Gamma == true) + { + xml = + sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", + prev, GammaValue); + sqlite3_free(prev); + prev = xml; + } else + { + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (ColorRamp == true) + { + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\r\n", + prev, MinValueColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\tRasterdata\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\t\t%1.8f\r\n", prev, MinValue); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\t\t%s\r\n", prev, + MinValueColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\t\t%1.8f\r\n", prev, MaxValue); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t\t\t%s\r\n", prev, + MaxValueColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } +shaded_relief: + if (ShadedRelief == true) + { + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", + prev, ShadedReliefFactor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } +foot: + xml = sqlite3_mprintf("%s\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n\r\n", prev); + sqlite3_free(prev); + return xml; +} + +unsigned char *QuickStyleRasterObj::CloneXmlStyle() +{ +// +// cloning the XML Style definition +// + if (XmlStyle == NULL) + XmlStyle = CreateXmlStyle(); + if (XmlStyle == NULL) + return NULL; + int len = strlen(XmlStyle); + char *cloned = (char *) malloc(len + 1); + strcpy(cloned, XmlStyle); + return (unsigned char *) cloned; +} + +void QuickStyleRasterObj::UpdateXmlStyle() +{ +// +// updating the XML Style +// + if (XmlStyle != NULL) + sqlite3_free(XmlStyle); + XmlStyle = CreateXmlStyle(); +} + +bool QuickStyleRasterDialog::Create(MyMapPanel * parent, MapLayer * layer) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + CanApplyContrastEnhancement = true; + IsMultiband = false; + CanApplyColorMap = false; + CanApplyShadedRelief = false; + RedBand = 0; + GreenBand = 0; + BlueBand = 0; + GrayBand = 0; + MinPixelValue = 0.0; + MaxPixelValue = 0.0; + GetCoverageInfos(); + IsConfigChanged = false; + + if (wxPropertySheetDialog::Create + (parent, wxID_ANY, wxT("QuickStyle (Raster) Edit")) == false) + return false; + if (Layer->GetQuickStyleRaster() != NULL) + Style = Layer->CloneQuickStyleRaster(); + else + Style = new QuickStyleRasterObj(); + Style->SetRedBand(RedBand); + Style->SetGreenBand(GreenBand); + Style->SetBlueBand(BlueBand); + Style->SetGrayBand(GrayBand); + Style->SetMinValue(MinPixelValue); + Style->SetMaxValue(MaxPixelValue); + + wxBookCtrlBase *book = GetBookCtrl(); +// creates individual panels + int next = 1; + PageContrastEnhancementIndex = 0; + PageChannelSelectionIndex = 0; + PageColorMapIndex = 0; + wxPanel *mainPage = CreateMainPage(book); + book->AddPage(mainPage, wxT("General"), true); + wxPanel *contrastEnhancementPage = CreateContrastEnhancementPage(book); + book->AddPage(contrastEnhancementPage, wxT("ContrastEnhancement"), false); + PageContrastEnhancementIndex = next++; + wxPanel *channelSelectionPage = CreateChannelSelectionPage(book); + book->AddPage(channelSelectionPage, wxT("ChannelSelection"), false); + PageChannelSelectionIndex = next++; + wxPanel *colorMapPage = CreateColorMapPage(book); + book->AddPage(colorMapPage, wxT("ColorMap"), false); + PageColorMapIndex = next++; + + CreateButtons(); + LayoutDialog(); +// appends event handler for TAB/PAGE changing + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnPageChanging); + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnPageChanged); +// appends event handler for buttons + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnQuit); + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnOk); + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnApply); + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnExport); + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnCopy); +// centers the dialog window + Centre(); + UpdateMainPage(); + return true; +} + +void QuickStyleRasterDialog::CreateButtons() +{ +// +// adding the common Buttons +// + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *exp = + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + btnBox->AddSpacer(100); + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +} + +wxPanel *QuickStyleRasterDialog::CreateMainPage(wxWindow * parent) +{ +// +// creating the MAIN page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// First row: Layer name + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, + wxT("Layer FullName"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString fullName = DbPrefix + wxT(".") + LayerName; + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, + wxT("QuickStyle Name"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString uuid = wxString::FromUTF8(Style->GetUUID()); + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row: Visibility Range + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Visibility Range"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *visibilitySizer = + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, + 5); + wxString range[4]; + range[0] = wxT("&None"); + range[1] = wxT("&Min"); + range[2] = wxT("&Max"); + range[3] = wxT("&Both"); + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, + wxT("&Range Type"), + wxDefaultPosition, + wxDefaultSize, 4, + range, 2, + wxRA_SPECIFY_COLS); + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + rangeBox->SetSelection(0); + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *minScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *minScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + minScaleCtrl->Enable(false); + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxStaticText *maxScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *maxScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), + wxDefaultPosition, wxSize(100, 22)); + maxScaleCtrl->Enable(false); + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row: Opacity + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(400, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnCmdScaleChanged); + return panel; +} + +void QuickStyleRasterDialog:: +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Visibility Range selection changed +// + wxRadioBox *scaleModeCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + switch (scaleModeCtrl->GetSelection()) + { + case 0: + Style->EnableMinScale(false); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 1: + Style->EnableMinScale(true); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 2: + Style->EnableMinScale(false); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + case 3: + Style->EnableMinScale(true); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + }; +} + +wxPanel *QuickStyleRasterDialog::CreateContrastEnhancementPage(wxWindow * + parent) +{ +// +// creating the Contrast Enhancement page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_CONTRAST_ENHANCEMENT); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row: Contrast Enhancement + boxSizer->AddSpacer(100); + wxBoxSizer *contrastSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(contrastSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxString contrast[4]; + contrast[0] = wxT("&None"); + contrast[1] = wxT("Normalize/&Stretch"); + contrast[2] = wxT("&Histogram"); + contrast[3] = wxT("&GammaValue"); + wxRadioBox *contrastBox = new wxRadioBox(panel, ID_SYMBOLIZER_CONTRAST, + wxT("&Contrast Enhancement Method"), + wxDefaultPosition, + wxDefaultSize, 4, + contrast, 1, + wxRA_SPECIFY_COLS); + contrastSizer->Add(contrastBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + contrastBox->SetSelection(0); + if (CanApplyContrastEnhancement == false) + contrastBox->Enable(false); + wxBoxSizer *gammaSizer = new wxBoxSizer(wxHORIZONTAL); + contrastSizer->Add(gammaSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticText *gammaLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&GammaValue [x100]:")); + gammaSizer->Add(gammaLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *gammaCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GAMMA, wxT("100"), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 100, 500, 100); + gammaCtrl->Enable(false); + gammaSizer->Add(gammaCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handler for OK button + Connect(ID_SYMBOLIZER_CONTRAST, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdContrastChanged); + return panel; +} + +void QuickStyleRasterDialog:: +OnCmdContrastChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Contrast Enhancement Method selection changed +// + wxRadioBox *contrastCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_CONTRAST); + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); + switch (contrastCtrl->GetSelection()) + { + case 1: + Style->SetNormalize(true); + Style->SetHistogram(false); + Style->SetGamma(false); + gammaCtrl->Enable(false); + break; + case 2: + Style->SetNormalize(false); + Style->SetHistogram(true); + Style->SetGamma(false); + gammaCtrl->Enable(false); + break; + case 3: + Style->SetNormalize(false); + Style->SetHistogram(false); + Style->SetGamma(true); + gammaCtrl->Enable(true); + break; + default: + Style->SetNormalize(false); + Style->SetHistogram(false); + Style->SetGamma(false); + gammaCtrl->Enable(false); + break; + }; +} + +wxPanel *QuickStyleRasterDialog::CreateChannelSelectionPage(wxWindow * parent) +{ +// +// creating the Channel Selection page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_CHANNEL_SELECTION); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); + panel->SetSizer(topSizer); +// Left panel: mode selector + boxSizer->AddSpacer(50); + wxBoxSizer *pageSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(pageSizer, 0, wxALIGN_CENTER_VERTICAL); + wxBoxSizer *leftSizer = new wxBoxSizer(wxVERTICAL); + pageSizer->Add(leftSizer, 0, wxALIGN_CENTER_VERTICAL); + wxString mode[3]; + mode[0] = wxT("&None"); + mode[1] = wxT("&Triple Band (RGB Image)"); + mode[2] = wxT("&Single Band (Grayscale Image)"); + wxRadioBox *bandModeBox = new wxRadioBox(panel, ID_SYMBOLIZER_BAND_MODE, + wxT("&Channel Selection Method"), + wxDefaultPosition, + wxDefaultSize, 3, + mode, 1, + wxRA_SPECIFY_COLS); + leftSizer->Add(bandModeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + bandModeBox->SetSelection(0); + if (IsMultiband == false) + bandModeBox->Enable(false); +// First row: ChannelSelection RGB + wxBoxSizer *rightSizer = new wxBoxSizer(wxVERTICAL); + pageSizer->Add(rightSizer, 0, wxALIGN_CENTER_HORIZONTAL); + wxBoxSizer *channelBoxSizer = new wxBoxSizer(wxVERTICAL); + rightSizer->Add(channelBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *channelBox = new wxStaticBox(panel, wxID_STATIC, + wxT + ("Channel Selection (first Band is #1)"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *channelSizer = new wxStaticBoxSizer(channelBox, wxVERTICAL); + channelBoxSizer->Add(channelSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *bandSizer = new wxBoxSizer(wxVERTICAL); + channelSizer->Add(bandSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *redSizer = new wxBoxSizer(wxHORIZONTAL); + bandSizer->Add(redSizer, 0, wxALIGN_RIGHT | wxALL, 3); + wxStaticText *redLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Red Channel is Band #")); + redSizer->Add(redLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *redCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_RED, wxT("1"), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 1, 256, 1); + redSizer->Add(redCtrl, 0, wxALIGN_RIGHT | wxALL, 0); + redCtrl->Enable(false); + wxBoxSizer *greenSizer = new wxBoxSizer(wxHORIZONTAL); + bandSizer->Add(greenSizer, 0, wxALIGN_RIGHT | wxALL, 3); + wxStaticText *greenLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Green Channel is Band #")); + greenSizer->Add(greenLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *greenCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GREEN, wxT("2"), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 1, 256, 2); + greenSizer->Add(greenCtrl, 0, wxALIGN_RIGHT | wxALL, 0); + greenCtrl->Enable(false); + wxBoxSizer *blueSizer = new wxBoxSizer(wxHORIZONTAL); + bandSizer->Add(blueSizer, 0, wxALIGN_RIGHT | wxALL, 3); + wxStaticText *blueLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Blue Channel is Band #")); + blueSizer->Add(blueLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *blueCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_BLUE, wxT("3"), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 1, 256, 3); + blueSizer->Add(blueCtrl, 0, wxALIGN_RIGHT | wxALL, 0); + blueCtrl->Enable(false); +// Second row: ChannelSelection Grayscale + rightSizer->AddSpacer(25); + wxBoxSizer *channel2BoxSizer = new wxBoxSizer(wxVERTICAL); + rightSizer->Add(channel2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *channel2Box = new wxStaticBox(panel, wxID_STATIC, + wxT + ("Channel Selection (first Band is #1)"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *channel2Sizer = new wxStaticBoxSizer(channel2Box, wxVERTICAL); + channel2BoxSizer->Add(channel2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *band2Sizer = new wxBoxSizer(wxVERTICAL); + channel2Sizer->Add(band2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *graySizer = new wxBoxSizer(wxHORIZONTAL); + band2Sizer->Add(graySizer, 0, wxALIGN_RIGHT | wxALL, 3); + wxStaticText *grayLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Gray Channel is Band #")); + graySizer->Add(grayLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *grayCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_GRAY, wxT("1"), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 1, 256, 1); + graySizer->Add(grayCtrl, 0, wxALIGN_RIGHT | wxALL, 0); + grayCtrl->Enable(false); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_BAND_MODE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdBandModeChanged); + return panel; +} + +void QuickStyleRasterDialog:: +OnCmdBandModeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Channel Selection Method selection changed +// + wxRadioBox *bandModeCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_BAND_MODE); + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); + switch (bandModeCtrl->GetSelection()) + { + case 1: + Style->SetTripleBand(true); + Style->SetSingleBand(false); + redCtrl->Enable(true); + greenCtrl->Enable(true); + blueCtrl->Enable(true); + grayCtrl->Enable(false); + break; + case 2: + Style->SetTripleBand(false); + Style->SetSingleBand(true); + redCtrl->Enable(false); + greenCtrl->Enable(false); + blueCtrl->Enable(false); + grayCtrl->Enable(true); + break; + default: + Style->SetTripleBand(false); + Style->SetSingleBand(false); + redCtrl->Enable(false); + greenCtrl->Enable(false); + blueCtrl->Enable(false); + grayCtrl->Enable(false); + break; + }; +} + +wxPanel *QuickStyleRasterDialog::CreateColorMapPage(wxWindow * parent) +{ +// +// creating the ColorMap page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_COLOR_MAP); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); + boxSizer->AddSpacer(50); + wxBoxSizer *mainSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(mainSizer, 0, wxALIGN_CENTER | wxALL, 5); +// left box: mode selector + wxBoxSizer *modeSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(modeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + int max = 4; + if (CanApplyNDVI == true) + max = 2; + wxString mode[max]; + mode[0] = wxT("&None"); + if (CanApplyNDVI == true) + mode[1] = wxT("&NDVI (predefined style)"); + else + { + mode[1] = wxT("&SRTM (predefined style)"); + mode[2] = wxT("&Terrain (predefined style)"); + mode[3] = wxT("&Color Ramp"); + } + wxRadioBox *modeBox = new wxRadioBox(panel, ID_SYMBOLIZER_COLOR_MAP_MODE, + wxT("&Color Map Type"), + wxDefaultPosition, + wxDefaultSize, max, + mode, 1, + wxRA_SPECIFY_COLS); + modeSizer->Add(modeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + modeBox->SetSelection(0); + if (CanApplyColorMap == false && CanApplyNDVI == false) + modeBox->Enable(false); +// right box: Color Ramp + wxBoxSizer *rampSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(rampSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *rampBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Color Ramp"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *ramp2Sizer = new wxStaticBoxSizer(rampBox, wxVERTICAL); + rampSizer->Add(ramp2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *minSizer = new wxBoxSizer(wxHORIZONTAL); + ramp2Sizer->Add(minSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3); +// Min Color + wxStaticBox *minBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Min Value"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *min2Sizer = new wxStaticBoxSizer(minBox, wxHORIZONTAL); + minSizer->Add(min2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString minColor = wxT("#000000"); + wxTextCtrl *colorMinCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_COLOR, minColor, + wxDefaultPosition, wxSize(80, 22)); + min2Sizer->Add(colorMinCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + colorMinCtrl->Enable(false); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleMinCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_MIN_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + min2Sizer->Add(sampleMinCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxButton *minPick = + new wxButton(panel, ID_SYMBOLIZER_MIN_PICKER_BTN, wxT("&Pick a color")); + min2Sizer->Add(minPick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + minPick->Enable(false); +// Max Color + wxBoxSizer *maxSizer = new wxBoxSizer(wxHORIZONTAL); + ramp2Sizer->Add(maxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 3); + wxStaticBox *maxBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Max Value"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *max2Sizer = new wxStaticBoxSizer(maxBox, wxHORIZONTAL); + maxSizer->Add(max2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString maxColor = wxT("#ffffff"); + wxTextCtrl *colorMaxCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_COLOR, maxColor, + wxDefaultPosition, wxSize(80, 22)); + max2Sizer->Add(colorMaxCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + colorMaxCtrl->Enable(false); + wxBitmap bmp2; + wxColour color2(255, 255, 255); + ColorMapEntry::DoPaintColorSample(32, 32, color2, bmp2); + wxStaticBitmap *sampleMaxCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_MAX_PICKER_HEX, bmp2, + wxDefaultPosition, wxSize(32, 32)); + max2Sizer->Add(sampleMaxCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxButton *maxPick = + new wxButton(panel, ID_SYMBOLIZER_MAX_PICKER_BTN, wxT("&Pick a color")); + max2Sizer->Add(maxPick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + maxPick->Enable(false); +// bottom box: shaded relief + wxBoxSizer *shadedSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(shadedSizer, 0, wxALIGN_CENTER_HORIZONTAL); + wxStaticBox *shadedBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Shaded Relief"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *shaded2Sizer = new wxStaticBoxSizer(shadedBox, wxHORIZONTAL); + shadedSizer->Add(shaded2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *reliefSizer = new wxBoxSizer(wxHORIZONTAL); + shaded2Sizer->Add(reliefSizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxCheckBox *shadedCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_SHADED, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + reliefSizer->Add(shadedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + if (CanApplyShadedRelief == false) + shadedCtrl->Enable(false); + reliefSizer->AddSpacer(25); + wxBoxSizer *relief2Sizer = new wxBoxSizer(wxHORIZONTAL); + reliefSizer->Add(relief2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxStaticText *reliefLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Relief Factor:")); + relief2Sizer->Add(reliefLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSpinCtrl *reliefCtrl = new wxSpinCtrl(panel, ID_SYMBOLIZER_RELIEF, wxT(""), + wxDefaultPosition, wxSize(80, 22), + wxSP_ARROW_KEYS, + 0, 0, 0); + reliefCtrl->Enable(false); + relief2Sizer->Add(reliefCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_COLOR_MAP_MODE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdColorMapModeChanged); + Connect(ID_SYMBOLIZER_MIN_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdColorMinChanged); + Connect(ID_SYMBOLIZER_MIN_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdMinColorPicker); + Connect(ID_SYMBOLIZER_MAX_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdColorMaxChanged); + Connect(ID_SYMBOLIZER_MAX_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleRasterDialog::OnCmdMaxColorPicker); + Connect(ID_SYMBOLIZER_SHADED, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & QuickStyleRasterDialog::OnShadedChanged); + return panel; +} + +void QuickStyleRasterDialog:: +OnCmdColorMapModeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Color Map Mode selection changed +// + wxRadioBox *colorMapModeCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_COLOR_MAP_MODE); + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); + wxButton *minPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_BTN); + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); + wxButton *maxPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_BTN); + wxStaticBitmap *sampleMinCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); + wxStaticBitmap *sampleMaxCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); + if (CanApplyNDVI == true) + { + // special case: NDVI + Style->SetSrtmColorMap(false); + Style->SetTerrainColorMap(false); + Style->SetColorRamp(false); + colorMinCtrl->Enable(false); + minPick->Enable(false); + colorMaxCtrl->Enable(false); + maxPick->Enable(false); + colorMinCtrl->SetValue(wxT("#000000")); + colorMaxCtrl->SetValue(wxT("#ffffff")); + switch (colorMapModeCtrl->GetSelection()) + { + case 1: + Style->SetNdviColorMap(true); + break; + default: + Style->SetNdviColorMap(false); + break; + }; + } else + { + // ordinary Color Map + Style->SetNdviColorMap(false); + switch (colorMapModeCtrl->GetSelection()) + { + case 1: + Style->SetSrtmColorMap(true); + Style->SetTerrainColorMap(false); + Style->SetColorRamp(false); + colorMinCtrl->Enable(false); + minPick->Enable(false); + colorMaxCtrl->Enable(false); + maxPick->Enable(false); + colorMinCtrl->SetValue(wxT("#000000")); + colorMaxCtrl->SetValue(wxT("#ffffff")); + break; + case 2: + Style->SetSrtmColorMap(false); + Style->SetTerrainColorMap(true); + Style->SetColorRamp(false); + colorMinCtrl->Enable(false); + minPick->Enable(false); + colorMaxCtrl->Enable(false); + maxPick->Enable(false); + colorMinCtrl->SetValue(wxT("#000000")); + colorMaxCtrl->SetValue(wxT("#ffffff")); + break; + case 3: + Style->SetSrtmColorMap(false); + Style->SetTerrainColorMap(false); + Style->SetColorRamp(true); + colorMinCtrl->Enable(true); + minPick->Enable(true); + colorMaxCtrl->Enable(true); + maxPick->Enable(true); + colorMinCtrl-> + SetValue(wxString::FromUTF8(Style->GetMinValueColor())); + colorMaxCtrl-> + SetValue(wxString::FromUTF8(Style->GetMaxValueColor())); + break; + default: + Style->SetSrtmColorMap(false); + Style->SetTerrainColorMap(false); + Style->SetColorRamp(false); + colorMinCtrl->Enable(false); + minPick->Enable(false); + colorMaxCtrl->Enable(false); + maxPick->Enable(false); + colorMinCtrl->SetValue(wxT("#000000")); + colorMaxCtrl->SetValue(wxT("#ffffff")); + break; + }; + } +} + +void QuickStyleRasterDialog:: +OnCmdColorMinChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Min Value color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleRasterDialog:: +OnCmdMinColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// Min Value color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleRasterDialog:: +OnCmdColorMaxChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Max Value color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleRasterDialog:: +OnCmdMaxColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// Max Value color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleRasterDialog::OnShadedChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// changed Shaded Relief (on/off): +// + wxCheckBox *shadedCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_SHADED); + wxSpinCtrl *reliefCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); + if (shadedCtrl->IsChecked() == true) + { + reliefCtrl->SetRange(1, 200); + reliefCtrl->SetValue(25); + reliefCtrl->Enable(true); + Style->SetShadedRelief(true); + } else + { + reliefCtrl->SetRange(0, 0); + reliefCtrl->SetValue(0); + reliefCtrl->Enable(false); + Style->SetShadedRelief(false); + } +} + +bool QuickStyleRasterDialog::UpdateStyle() +{ +// +// updating the QuickStyle +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PageContrastEnhancementIndex) + ret = RetrieveContrastEnhancementPage(); + if (idx == PageChannelSelectionIndex) + ret = RetrieveChannelSelectionPage(); + if (idx == PageColorMapIndex) + ret = RetrieveColorMapPage(); + } + if (ret == false) + return false; + + RasterLayerConfig *config = Layer->GetRasterConfig(); + bool setCurrentStyle = false; + if (config->GetStyle() == NULL) + setCurrentStyle = true; + else + { + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) + setCurrentStyle = true; + } + if (setCurrentStyle == true) + { + config->SetStyle(Style->GetUUID()); + IsConfigChanged = true; + } + IsConfigChanged = Layer->UpdateQuickStyle(Style); + return true; +} + +bool QuickStyleRasterDialog::RetrieveMainPage() +{ +// +// retrieving params from the MAIN page +// + double min = Style->GetScaleMin(); + double max = Style->GetScaleMax(); + double opacity = Style->GetOpacity(); + if (Style->IsMinScaleEnabled() == true) + { + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxString value = minCtrl->GetValue(); + if (value.ToDouble(&min) != true) + { + wxMessageBox(wxT + ("MIN_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (min < 0.0) + { + wxMessageBox(wxT + ("MIN_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMaxScaleEnabled() == true) + { + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + wxString value = maxCtrl->GetValue(); + if (value.ToDouble(&max) != true) + { + wxMessageBox(wxT + ("MAX_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (max < 0.0) + { + wxMessageBox(wxT + ("MAX_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) + { + if (min >= max) + { + wxMessageBox(wxT + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + Style->SetScaleMin(min); + Style->SetScaleMax(max); + Style->SetOpacity(opacity); + return true; +} + +void QuickStyleRasterDialog::UpdateMainPage() +{ +// +// updating the MAIN page +// + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(0); + else if (Style->IsMinScaleEnabled() == true + && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(1); + else if (Style->IsMinScaleEnabled() != true + && Style->IsMaxScaleEnabled() == true) + rangeBox->SetSelection(2); + else + rangeBox->SetSelection(3); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + char dummy[64]; + wxString str; + if (Style->IsMinScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMin()); + str = wxString::FromUTF8(dummy); + minCtrl->SetValue(str); + minCtrl->Enable(true); + } else + { + str = wxT("0.0"); + minCtrl->SetValue(str); + minCtrl->Enable(false); + } + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + if (Style->IsMaxScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMax()); + str = wxString::FromUTF8(dummy); + maxCtrl->SetValue(str); + maxCtrl->Enable(true); + } else + { + str = wxT("+Infinite"); + maxCtrl->SetValue(str); + maxCtrl->Enable(false); + } + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); + opacityCtrl->SetValue(Style->GetOpacity() * 100.0); +} + +bool QuickStyleRasterDialog::RetrieveContrastEnhancementPage(bool check) +{ +// +// retrieving params from the CONTRAST ENHANCEMENT page +// + if (Style->IsGamma() == true) + { + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); + Style->SetGammaValue(gammaCtrl->GetValue() / 100.0); + } else + Style->SetGammaValue(1.0); + return true; +} + +void QuickStyleRasterDialog::UpdateContrastEnhancementPage() +{ +// +// updating the CONTRAST ENHANCEMENT page +// + wxRadioBox *contrastCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_CONTRAST); + wxSpinCtrl *gammaCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GAMMA); + if (Style->IsNormalize() == true) + { + contrastCtrl->SetSelection(1); + gammaCtrl->Enable(false); + } else if (Style->IsHistogram() == true) + { + contrastCtrl->SetSelection(2); + gammaCtrl->Enable(false); + } else if (Style->IsGamma() == true) + { + contrastCtrl->SetSelection(3); + gammaCtrl->Enable(true); + } else + { + contrastCtrl->SetSelection(0); + gammaCtrl->Enable(false); + } + gammaCtrl->SetValue(Style->GetGammaValue() * 100.0); + if (CanApplyContrastEnhancement == true) + contrastCtrl->Enable(true); + else + contrastCtrl->Enable(false); +} + +bool QuickStyleRasterDialog::RetrieveChannelSelectionPage(bool check) +{ +// +// retrieving params from the CHANNEL SELECTION page +// + if (Style->IsTripleBand() == true) + { + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); + Style->SetRedBand(redCtrl->GetValue() - 1); + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); + Style->SetGreenBand(greenCtrl->GetValue() - 1); + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); + Style->SetBlueBand(blueCtrl->GetValue() - 1); + Style->SetGrayBand(0); + } else if (Style->IsSingleBand() == true) + { + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); + Style->SetGrayBand(grayCtrl->GetValue() - 1); + Style->SetRedBand(0); + Style->SetGreenBand(0); + Style->SetBlueBand(0); + } else + { + Style->SetRedBand(0); + Style->SetGreenBand(0); + Style->SetBlueBand(0); + Style->SetGrayBand(0); + } + return true; +} + +void QuickStyleRasterDialog::UpdateChannelSelectionPage() +{ +// +// updating the CHANNEL SELECTION page +// + wxRadioBox *bandModeCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_BAND_MODE); + wxSpinCtrl *redCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RED); + wxSpinCtrl *greenCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GREEN); + wxSpinCtrl *blueCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_BLUE); + wxSpinCtrl *grayCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_GRAY); + if (IsMultiband == false) + { + bandModeCtrl->SetSelection(0); + redCtrl->Enable(false); + greenCtrl->Enable(false); + blueCtrl->Enable(false); + grayCtrl->Enable(false); + redCtrl->SetValue(1); + greenCtrl->SetValue(1); + blueCtrl->SetValue(1); + grayCtrl->SetValue(1); + bandModeCtrl->Enable(false); + return; + } + if (Style->IsTripleBand() == true) + { + bandModeCtrl->SetSelection(1); + redCtrl->Enable(true); + greenCtrl->Enable(true); + blueCtrl->Enable(true); + grayCtrl->Enable(false); + } else if (Style->IsSingleBand() == true) + { + bandModeCtrl->SetSelection(2); + redCtrl->Enable(false); + greenCtrl->Enable(false); + blueCtrl->Enable(false); + grayCtrl->Enable(true); + } else + { + bandModeCtrl->SetSelection(0); + redCtrl->Enable(false); + greenCtrl->Enable(false); + blueCtrl->Enable(false); + grayCtrl->Enable(false); + } + redCtrl->SetRange(1, NumBands); + greenCtrl->SetRange(1, NumBands); + blueCtrl->SetRange(1, NumBands); + grayCtrl->SetRange(1, NumBands); + redCtrl->SetValue(Style->GetRedBand() + 1); + greenCtrl->SetValue(Style->GetGreenBand() + 1); + blueCtrl->SetValue(Style->GetBlueBand() + 1); + grayCtrl->SetValue(Style->GetGrayBand() + 1); + if (IsMultiband == true) + bandModeCtrl->Enable(true); + else + bandModeCtrl->Enable(false); +} + +bool QuickStyleRasterDialog::RetrieveColorMapPage(bool check) +{ +// +// retrieving params from the COLOR MAP page +// + if (Style->IsShadedRelief() == true) + { + wxSpinCtrl *shadedCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); + Style->SetShadedReliefFactor(shadedCtrl->GetValue()); + } else + Style->SetShadedReliefFactor(0.0); + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); + char dummy[64]; + strcpy(dummy, colorMinCtrl->GetValue().ToUTF8()); + Style->SetMinValueColor(dummy); + strcpy(dummy, colorMaxCtrl->GetValue().ToUTF8()); + Style->SetMaxValueColor(dummy); + return true; +} + +void QuickStyleRasterDialog::UpdateColorMapPage() +{ +// +// updating the COLOR MAP page +// + wxRadioBox *modeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_COLOR_MAP_MODE); + wxTextCtrl *colorMinCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_COLOR); + wxStaticBitmap *sampleMinCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_HEX); + wxButton *minPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MIN_PICKER_BTN); + wxTextCtrl *colorMaxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_COLOR); + wxStaticBitmap *sampleMaxCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_HEX); + wxButton *maxPick = (wxButton *) FindWindow(ID_SYMBOLIZER_MAX_PICKER_BTN); + wxCheckBox *shadedCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_SHADED); + wxSpinCtrl *reliefCtrl = (wxSpinCtrl *) FindWindow(ID_SYMBOLIZER_RELIEF); + if (CanApplyNDVI == true) + { + // special case: NDVI + if (Style->IsNdviColorMap() == true) + modeBox->SetSelection(1); + else + modeBox->SetSelection(0); + } else + { + // ordinary Color Map + if (Style->IsSrtmColorMap() == true) + modeBox->SetSelection(1); + else if (Style->IsTerrainColorMap() == true) + modeBox->SetSelection(2); + else if (Style->IsColorRamp() == true) + modeBox->SetSelection(3); + else + modeBox->SetSelection(0); + } + if (Style->IsColorRamp() == true) + { + colorMinCtrl->Enable(true); + minPick->Enable(true); + colorMaxCtrl->Enable(true); + maxPick->Enable(true); + colorMinCtrl->SetValue(wxString::FromUTF8(Style->GetMinValueColor())); + colorMaxCtrl->SetValue(wxString::FromUTF8(Style->GetMaxValueColor())); + } else + { + colorMinCtrl->Enable(false); + minPick->Enable(false); + colorMaxCtrl->Enable(false); + maxPick->Enable(false); + colorMinCtrl->SetValue(wxT("#000000")); + colorMaxCtrl->SetValue(wxT("#ffffff")); + } + if (Style->IsShadedRelief() == true) + { + reliefCtrl->SetRange(1, 200); + reliefCtrl->SetValue(Style->GetShadedReliefFactor()); + reliefCtrl->Enable(true); + } else + { + reliefCtrl->SetRange(0, 0); + reliefCtrl->SetValue(0); + reliefCtrl->Enable(false); + } + if (CanApplyColorMap == true || CanApplyNDVI == true) + modeBox->Enable(true); + else + modeBox->Enable(false); + if (CanApplyShadedRelief == true) + shadedCtrl->Enable(true); + else + shadedCtrl->Enable(false); +} + + +void QuickStyleRasterDialog::OnPageChanging(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changing +// + bool ret = false; + int idx = event.GetOldSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PageContrastEnhancementIndex) + ret = RetrieveContrastEnhancementPage(); + if (idx == PageChannelSelectionIndex) + ret = RetrieveChannelSelectionPage(); + if (idx == PageColorMapIndex) + ret = RetrieveColorMapPage(); + } + if (ret != true) + event.Veto(); +} + +void QuickStyleRasterDialog::OnPageChanged(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changed +// + int idx = event.GetSelection(); + if (idx == 0) + UpdateMainPage(); + else + { + if (idx == PageContrastEnhancementIndex) + UpdateContrastEnhancementPage(); + if (idx == PageChannelSelectionIndex) + UpdateChannelSelectionPage(); + if (idx == PageColorMapIndex) + UpdateColorMapPage(); + } +} + +void QuickStyleRasterDialog::OnOk(wxCommandEvent & WXUNUSED(event)) +{ +// +// permanently saving the QuickStyle and quitting +// + if (UpdateStyle() == true) + wxDialog::EndModal(wxID_OK); +} + +void QuickStyleRasterDialog::OnApply(wxCommandEvent & WXUNUSED(event)) +{ +// +// applying the QuickStyle and continuing +// + if (UpdateStyle() == true) + { + if (IsConfigChanged == true) + MapPanel->RefreshMap(); + } +} + +void QuickStyleRasterDialog::OnExport(wxCommandEvent & WXUNUSED(event)) +{ +// +// exporting the Quick Style as an external file +// + bool xret = false; + int ret; + wxString path; + wxString lastDir; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + xret = RetrieveMainPage(); + else + { + if (idx == PageContrastEnhancementIndex) + xret = RetrieveContrastEnhancementPage(); + if (idx == PageChannelSelectionIndex) + xret = RetrieveChannelSelectionPage(); + if (idx == PageColorMapIndex) + xret = RetrieveColorMapPage(); + } + if (xret == false) + return; + + wxFileDialog fileDialog(this, + wxT("Exporting an SLD/SE QuickStyle to a file"), + wxT(""), wxT("style.xml"), + wxT("XML Document|*.xml|All files (*.*)|*.*"), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, + wxDefaultSize, wxT("filedlg")); + lastDir = MainFrame->GetLastDirectory(); + if (lastDir.Len() >= 1) + fileDialog.SetDirectory(lastDir); + ret = fileDialog.ShowModal(); + if (ret == wxID_OK) + { + wxFileName file(fileDialog.GetPath()); + path = file.GetPath(); + path += file.GetPathSeparator(); + path += file.GetName(); + lastDir = file.GetPath(); + path = fileDialog.GetPath(); + FILE *out = fopen(path.ToUTF8(), "wb"); + if (out == NULL) + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + else + { + char *xml = Style->CreateXmlStyle(); + fwrite(xml, 1, strlen(xml), out); + sqlite3_free(xml); + fclose(out); + wxMessageBox(wxT + ("SLD/SE QuickStyle successfully saved into:\n\n\"") + + path + wxT("\""), wxT("spatialite_gui"), + wxOK | wxICON_INFORMATION, this); + } + } +} + +void QuickStyleRasterDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Quick Style into the Clipboard +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PageContrastEnhancementIndex) + ret = RetrieveContrastEnhancementPage(); + if (idx == PageChannelSelectionIndex) + ret = RetrieveChannelSelectionPage(); + if (idx == PageColorMapIndex) + ret = RetrieveColorMapPage(); + } + if (ret == false) + return; + + char *xml = Style->CreateXmlStyle(); + wxString XMLstring = wxString::FromUTF8(xml); + sqlite3_free(xml); + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); + wxTheClipboard->Close(); + } +} + +void QuickStyleRasterDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} + +void QuickStyleRasterDialog::GetCoverageInfos() +{ +// +// attempting to get the basic Coverage Infos +// + char *prefix; + char *xprefix; + char *name; + char *sql; + int ret; + char **results; + int rows; + int columns; + wxString pixelType; + wxString sampleType; + int numBands; + bool ok_min = false; + bool ok_max = false; + double min = 0.0; + double max = 0.0; + + if (DbPrefix.Len() == 0) + { + prefix = (char *) malloc(5); + strcpy(prefix, "MAIN"); + } else + { + prefix = (char *) malloc(DbPrefix.Len() * 4); + strcpy(prefix, DbPrefix.ToUTF8()); + } + xprefix = gaiaDoubleQuotedSql(prefix); + free(prefix); + name = (char *) malloc(LayerName.Len() * 4); + strcpy(name, LayerName.ToUTF8()); + sql = + sqlite3_mprintf + ("SELECT pixel_type, sample_type, num_bands, enable_auto_ndvi, " + "RL2_GetBandStatistics_Min(statistics, 0), RL2_GetBandStatistics_Max(statistics, 0) " + "FROM \"%s\".raster_coverages WHERE Upper(coverage_name) = Upper(%Q)", + xprefix, name); + free(xprefix); + free(name); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, + NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + + for (int i = 1; i <= rows; i++) + { + // retrieving the basic Coverage Infos + pixelType = wxString::FromUTF8(results[(i * columns) + 0]); + sampleType = wxString::FromUTF8(results[(i * columns) + 1]); + numBands = atoi(results[(i * columns) + 2]); + if (results[(i * columns) + 3] == NULL) + CanApplyNDVI = false; + else + { + if (atoi(results[(i * columns) + 3]) == 0) + CanApplyNDVI = false; + else + CanApplyNDVI = true; + } + if (results[(i * columns) + 4] == NULL) + ok_min = false; + else + { + ok_min = true; + min = atof(results[(i * columns) + 4]); + } + if (results[(i * columns) + 5] == NULL) + ok_max = false; + else + { + ok_max = true; + max = atof(results[(i * columns) + 5]); + } + + } + sqlite3_free_table(results); + + if (pixelType.Cmp(wxT("RGB")) == 0 || pixelType.Cmp(wxT("GRAYSCALE")) == 0 + || pixelType.Cmp(wxT("MULTIBAND")) == 0 + || (pixelType.Cmp(wxT("DATAGRID")) == 0 + && sampleType.Cmp(wxT("UINT16")) == 0)) + CanApplyContrastEnhancement = true; + else + CanApplyContrastEnhancement = false; + if (pixelType.Cmp(wxT("MULTIBAND")) == 0) + { + IsMultiband = true; + NumBands = numBands; + RedBand = 0; + GreenBand = 1; + BlueBand = 2; + } else + IsMultiband = false; + if (ok_min == true && ok_max == true) + { + CanApplyColorMap = true; + MinPixelValue = min; + MaxPixelValue = max; + } else + CanApplyColorMap = false; + if (pixelType.Cmp(wxT("DATAGRID")) == 0 + || pixelType.Cmp(wxT("MONOCHROME")) == 0) + ; + else + CanApplyColorMap = false; + if (pixelType.Cmp(wxT("DATAGRID")) == 0) + CanApplyShadedRelief = true; + else + CanApplyShadedRelief = false; +} ADDED QuickStylesTopology.cpp Index: QuickStylesTopology.cpp ================================================================== --- QuickStylesTopology.cpp +++ QuickStylesTopology.cpp @@ -0,0 +1,4397 @@ +/* +/ QuickStylesTopology.cpp +/ Quick Styles wizards (Topology layers) +/ +/ version 2.0, 2017 May 26 +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2017 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include "Classdef.h" + +#include "wx/spinctrl.h" +#include "wx/imaglist.h" +#include "wx/colordlg.h" +#include "wx/filename.h" +#include "wx/clipbrd.h" + +QuickStyleTopologyObj::QuickStyleTopologyObj(int type) +{ +// ctor + QuickStyleObj::DoGetUUID(UUID); + Type = type; + MinScaleEnabled = false; + MaxScaleEnabled = false; + ScaleMin = 0.0; + ScaleMax = 0.0; + NodeOpacity = 1.0; + NodeSize = 16; + NodeRotation = 0.0; + NodeAnchorX = 0.5; + NodeAnchorY = 0.5; + NodeDisplacementX = 0.0; + NodeDisplacementY = 0.0; + NodeWellKnownMark = QuickStyleObj::RandomWellKnownMark(); + QuickStyleObj::RandomColor(NodeFillColor); + QuickStyleObj::RandomColor(NodeStrokeColor); + EdgeLinkOpacity = 1.0; + EdgeLinkPerpendicularOffset = 0.0; + EdgeLinkStrokeWidth = 1.0; + QuickStyleObj::RandomColor(EdgeLinkStrokeColor); + EdgeLinkDotStyle = QUICK_STYLE_SOLID_LINE; + FaceFill = true; + FaceStroke = true; + FaceDisplacementX = 0.0; + FaceDisplacementY = 0.0; + FacePerpendicularOffset = 0.0; + FaceFillOpacity = 1.0; + QuickStyleObj::RandomColor(FaceFillColor); + FaceStrokeOpacity = 1.0; + FaceStrokeWidth = 1.0; + QuickStyleObj::RandomColor(FaceStrokeColor); + EdgeLinkSeedOpacity = 1.0; + EdgeLinkSeedSize = 16; + EdgeLinkSeedRotation = 0.0; + EdgeLinkSeedAnchorX = 0.5; + EdgeLinkSeedAnchorY = 0.5; + EdgeLinkSeedDisplacementX = 0.0; + EdgeLinkSeedDisplacementY = 0.0; + EdgeLinkSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); + QuickStyleObj::RandomColor(EdgeLinkSeedFillColor); + QuickStyleObj::RandomColor(EdgeLinkSeedStrokeColor); + FaceSeedOpacity = 1.0; + FaceSeedSize = 16; + FaceSeedRotation = 0.0; + FaceSeedAnchorX = 0.5; + FaceSeedAnchorY = 0.5; + FaceSeedDisplacementX = 0.0; + FaceSeedDisplacementY = 0.0; + FaceSeedWellKnownMark = QuickStyleObj::RandomWellKnownMark(); + QuickStyleObj::RandomColor(FaceSeedFillColor); + QuickStyleObj::RandomColor(FaceSeedStrokeColor); + XmlStyle = NULL; +} + +QuickStyleTopologyObj *QuickStyleTopologyObj::Clone() +{ +// +// cloning a Quick Style Topology +// + QuickStyleTopologyObj *Style = new QuickStyleTopologyObj(this->Type); + strcpy(Style->UUID, this->UUID); + Style->MinScaleEnabled = this->MinScaleEnabled; + Style->MaxScaleEnabled = this->MaxScaleEnabled; + Style->ScaleMin = this->ScaleMin; + Style->ScaleMax = this->ScaleMax; + Style->NodeOpacity = this->NodeOpacity; + Style->NodeSize = this->NodeSize; + Style->NodeRotation = this->NodeRotation; + Style->NodeAnchorX = this->NodeAnchorX; + Style->NodeAnchorY = this->NodeAnchorY; + Style->NodeDisplacementX = this->NodeDisplacementX; + Style->NodeDisplacementY = this->NodeDisplacementY; + Style->NodeWellKnownMark = this->NodeWellKnownMark; + strcpy(Style->NodeFillColor, this->NodeFillColor); + strcpy(Style->NodeStrokeColor, this->NodeStrokeColor); + Style->EdgeLinkOpacity = this->EdgeLinkOpacity; + Style->EdgeLinkPerpendicularOffset = this->EdgeLinkPerpendicularOffset; + Style->EdgeLinkStrokeWidth = this->EdgeLinkStrokeWidth; + strcpy(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor); + Style->EdgeLinkDotStyle = this->EdgeLinkDotStyle; + Style->FaceFill = this->FaceFill; + Style->FaceStroke = this->FaceStroke; + Style->FaceDisplacementX = this->FaceDisplacementX; + Style->FaceDisplacementY = this->FaceDisplacementY; + Style->FacePerpendicularOffset = this->FacePerpendicularOffset; + Style->FaceFillOpacity = this->FaceFillOpacity; + strcpy(Style->FaceFillColor, this->FaceFillColor); + Style->FaceStrokeOpacity = this->FaceStrokeOpacity; + Style->FaceStrokeWidth = this->FaceStrokeWidth; + strcpy(Style->FaceStrokeColor, this->FaceStrokeColor); + Style->EdgeLinkSeedOpacity = this->EdgeLinkSeedOpacity; + Style->EdgeLinkSeedSize = this->EdgeLinkSeedSize; + Style->EdgeLinkSeedRotation = this->EdgeLinkSeedRotation; + Style->EdgeLinkSeedAnchorX = this->EdgeLinkSeedAnchorX; + Style->EdgeLinkSeedAnchorY = this->EdgeLinkSeedAnchorY; + Style->EdgeLinkSeedDisplacementX = this->EdgeLinkSeedDisplacementX; + Style->EdgeLinkSeedDisplacementY = this->EdgeLinkSeedDisplacementY; + Style->EdgeLinkSeedWellKnownMark = this->EdgeLinkSeedWellKnownMark; + strcpy(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor); + strcpy(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor); + Style->FaceSeedOpacity = this->FaceSeedOpacity; + Style->FaceSeedSize = this->FaceSeedSize; + Style->FaceSeedRotation = this->FaceSeedRotation; + Style->FaceSeedAnchorX = this->FaceSeedAnchorX; + Style->FaceSeedAnchorY = this->FaceSeedAnchorY; + Style->FaceSeedDisplacementX = this->FaceSeedDisplacementX; + Style->FaceSeedDisplacementY = this->FaceSeedDisplacementY; + Style->FaceSeedWellKnownMark = this->FaceSeedWellKnownMark; + strcpy(Style->FaceSeedFillColor, this->FaceSeedFillColor); + strcpy(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor); + Style->XmlStyle = NULL; + return Style; +} + +bool QuickStyleTopologyObj::Compare(QuickStyleTopologyObj * Style) +{ +// +// comparing two Quick Style objects (Topology) +// + if (strcmp(Style->UUID, this->UUID) != 0) + return false; + if (Style->MinScaleEnabled != this->MinScaleEnabled) + return false; + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) + return false; + if (Style->ScaleMin != this->ScaleMin) + return false; + if (Style->ScaleMax != this->ScaleMax) + return false; + if (Style->NodeOpacity != this->NodeOpacity) + return false; + if (Style->NodeSize != this->NodeSize) + return false; + if (Style->NodeRotation != this->NodeRotation) + return false; + if (Style->NodeAnchorX != this->NodeAnchorX) + return false; + if (Style->NodeAnchorY != this->NodeAnchorY) + return false; + if (Style->NodeDisplacementX != this->NodeDisplacementX) + return false; + if (Style->NodeDisplacementY != this->NodeDisplacementY) + return false; + if (Style->NodeWellKnownMark != this->NodeWellKnownMark) + return false; + if (strcmp(Style->NodeFillColor, this->NodeFillColor) != 0) + return false; + if (strcmp(Style->NodeStrokeColor, this->NodeStrokeColor) != 0) + return false; + if (Style->EdgeLinkOpacity != this->EdgeLinkOpacity) + return false; + if (Style->EdgeLinkPerpendicularOffset != this->EdgeLinkPerpendicularOffset) + return false; + if (Style->EdgeLinkStrokeWidth != this->EdgeLinkStrokeWidth) + return false; + if (strcmp(Style->EdgeLinkStrokeColor, this->EdgeLinkStrokeColor) != 0) + return false; + if (Style->EdgeLinkDotStyle != this->EdgeLinkDotStyle) + return false; + if (Style->FaceFill != this->FaceFill) + return false; + if (Style->FaceStroke != this->FaceStroke) + return false; + if (Style->FaceDisplacementX != this->FaceDisplacementX) + return false; + if (Style->FaceDisplacementY != this->FaceDisplacementY) + return false; + if (Style->FacePerpendicularOffset != this->FacePerpendicularOffset) + return false; + if (Style->FaceFillOpacity != this->FaceFillOpacity) + return false; + if (strcmp(Style->FaceFillColor, this->FaceFillColor) != 0) + return false; + if (Style->FaceStrokeOpacity != this->FaceStrokeOpacity) + return false; + if (Style->FaceStrokeWidth != this->FaceStrokeWidth) + return false; + if (strcmp(Style->FaceStrokeColor, this->FaceStrokeColor) != 0) + return false; + if (Style->EdgeLinkSeedOpacity != this->EdgeLinkSeedOpacity) + return false; + if (Style->EdgeLinkSeedSize != this->EdgeLinkSeedSize) + return false; + if (Style->EdgeLinkSeedRotation != this->EdgeLinkSeedRotation) + return false; + if (Style->EdgeLinkSeedAnchorX != this->EdgeLinkSeedAnchorX) + return false; + if (Style->EdgeLinkSeedAnchorY != this->EdgeLinkSeedAnchorY) + return false; + if (Style->EdgeLinkSeedDisplacementX != this->EdgeLinkSeedDisplacementX) + return false; + if (Style->EdgeLinkSeedDisplacementY != this->EdgeLinkSeedDisplacementY) + return false; + if (Style->EdgeLinkSeedWellKnownMark != this->EdgeLinkSeedWellKnownMark) + return false; + if (strcmp(Style->EdgeLinkSeedFillColor, this->EdgeLinkSeedFillColor) != 0) + return false; + if (strcmp(Style->EdgeLinkSeedStrokeColor, this->EdgeLinkSeedStrokeColor) != + 0) + return false; + if (Style->FaceSeedOpacity != this->FaceSeedOpacity) + return false; + if (Style->FaceSeedSize != this->FaceSeedSize) + return false; + if (Style->FaceSeedRotation != this->FaceSeedRotation) + return false; + if (Style->FaceSeedAnchorX != this->FaceSeedAnchorX) + return false; + if (Style->FaceSeedAnchorY != this->FaceSeedAnchorY) + return false; + if (Style->FaceSeedDisplacementX != this->FaceSeedDisplacementX) + return false; + if (Style->FaceSeedDisplacementY != this->FaceSeedDisplacementY) + return false; + if (Style->FaceSeedWellKnownMark != this->FaceSeedWellKnownMark) + return false; + if (strcmp(Style->FaceSeedFillColor, this->FaceSeedFillColor) != 0) + return false; + if (strcmp(Style->FaceSeedStrokeColor, this->FaceSeedStrokeColor) != 0) + return false; + return true; +} + +void QuickStyleTopologyObj::UpdateXmlStyle() +{ +// +// updating the XML Style +// + if (XmlStyle != NULL) + sqlite3_free(XmlStyle); + XmlStyle = CreateXmlStyle(); +} + +char *QuickStyleTopologyObj::CreateXmlStyle() +{ +// +// creating the XML Style +// + char *prev; + char *xml2; + char *xml = sqlite3_mprintf("\r\n"); + prev = xml; + xml = sqlite3_mprintf("%s\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Quick Style - Topology"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (Type == MAP_LAYER_NETWORK) + { + // Links + xml2 = DoCreateEdgeLinkXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // Nodes + xml2 = DoCreateNodeXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // LinkSeeds + xml2 = DoCreateEdgeLinkSeedXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + } else + { + // Faces + xml2 = DoCreateFaceXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // Edges + xml2 = DoCreateEdgeLinkXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // Nodes + xml2 = DoCreateNodeXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // EdgeSeeds + xml2 = DoCreateEdgeLinkSeedXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + // EdgeSeeds + xml2 = DoCreateFaceSeedXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + } + xml = sqlite3_mprintf("%s\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleTopologyObj::DoCreateFaceXML() +{ +// +// creating the XML Style - Face +// + char *prev; + char *xml = sqlite3_mprintf("\t\r\n"); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\tFace\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\ttopoclass\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\tface\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + + const char *extra = "\t\t"; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + prev = xml; + if (FaceFill == true) + { + // Polygon Fill + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + // using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, + extra, FaceFillColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, FaceFillOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (FaceStroke == true) + { + // Polygon Stroke + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + // using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, + extra, FaceStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, FaceStrokeOpacity); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, FaceStrokeWidth); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (FaceDisplacementX != 0.0 || FaceDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t%1.4f\r\n", + prev, extra, FaceDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t%1.4f\r\n", + prev, extra, FaceDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (FacePerpendicularOffset != 0.0) + { + xml = + sqlite3_mprintf + ("%s%s\t%1.4f\r\n", prev, + extra, FacePerpendicularOffset); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleTopologyObj::DoCreateEdgeLinkXML() +{ +// +// creating the XML Style - Edge or Link +// + char *prev; + char *xml = sqlite3_mprintf("\t\r\n"); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + if (Type == MAP_LAYER_NETWORK) + xml = sqlite3_mprintf("%s\t\tLink\r\n", prev); + else + xml = sqlite3_mprintf("%s\t\tEdge\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\ttopoclass\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (Type == MAP_LAYER_NETWORK) + xml = + sqlite3_mprintf("%s\t\t\t\tlink\r\n", prev); + else + xml = + sqlite3_mprintf("%s\t\t\t\tedge\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + + const char *extra = "\t\t"; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, extra, + EdgeLinkStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, EdgeLinkOpacity); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, EdgeLinkStrokeWidth); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + const char *dashArray; + switch (EdgeLinkDotStyle) + { + case QUICK_STYLE_DOT_LINE: + dashArray = "5.0, 10.0"; + break; + case QUICK_STYLE_DASH_LINE: + dashArray = "20.0, 20.0"; + break; + case QUICK_STYLE_DASH_DOT_LINE: + dashArray = "20.0, 10.0, 5.0, 10.0"; + break; + default: + dashArray = NULL; + break; + }; + if (dashArray != NULL) + { + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", + prev, extra, dashArray); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (EdgeLinkPerpendicularOffset != 0.0) + { + xml = + sqlite3_mprintf + ("%s%s\t%1.2f\r\n", prev, + extra, EdgeLinkPerpendicularOffset); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleTopologyObj::DoCreateNodeXML() +{ +// +// creating the XML Style - Node +// + const char *cstr; + char *prev; + char *xml = sqlite3_mprintf("\t\r\n"); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\tNode\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\ttopoclass\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\tnode\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + + const char *extra = "\t\t"; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// mark symbol + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + switch (NodeWellKnownMark) + { + case RL2_GRAPHIC_MARK_CIRCLE: + cstr = "circle"; + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + cstr = "triangle"; + break; + case RL2_GRAPHIC_MARK_STAR: + cstr = "star"; + break; + case RL2_GRAPHIC_MARK_CROSS: + cstr = "cross"; + break; + case RL2_GRAPHIC_MARK_X: + cstr = "x"; + break; + default: + cstr = "square"; + break; + }; + xml = + sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, + extra, cstr); + sqlite3_free(prev); + prev = xml; +// Mark Fill + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, NodeFillColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// Mark Stroke + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, NodeStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%1.2f\r\n", + prev, extra, 1.0); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (NodeOpacity != 1.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + NodeOpacity); + sqlite3_free(prev); + prev = xml; + } + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, NodeSize); + sqlite3_free(prev); + prev = xml; + if (NodeRotation != 0.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + NodeRotation); + sqlite3_free(prev); + prev = xml; + } + if (NodeAnchorX != 0.5 || NodeAnchorY != 0.5) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, NodeAnchorX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, NodeAnchorY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (NodeDisplacementX != 0.0 || NodeDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, NodeDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, NodeDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleTopologyObj::DoCreateEdgeLinkSeedXML() +{ +// +// creating the XML Style - Edge or Link Seed +// + const char *cstr; + char *prev; + char *xml = sqlite3_mprintf("\t\r\n"); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + if (Type == MAP_LAYER_NETWORK) + xml = sqlite3_mprintf("%s\t\tLinkSeed\r\n", prev); + else + xml = sqlite3_mprintf("%s\t\tEdgeSeed\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\ttopoclass\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (Type == MAP_LAYER_NETWORK) + xml = + sqlite3_mprintf("%s\t\t\t\tlink_seed\r\n", + prev); + else + xml = + sqlite3_mprintf("%s\t\t\t\tedge_seed\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + + const char *extra = "\t\t"; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// mark symbol + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + switch (EdgeLinkSeedWellKnownMark) + { + case RL2_GRAPHIC_MARK_CIRCLE: + cstr = "circle"; + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + cstr = "triangle"; + break; + case RL2_GRAPHIC_MARK_STAR: + cstr = "star"; + break; + case RL2_GRAPHIC_MARK_CROSS: + cstr = "cross"; + break; + case RL2_GRAPHIC_MARK_X: + cstr = "x"; + break; + default: + cstr = "square"; + break; + }; + xml = + sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, + extra, cstr); + sqlite3_free(prev); + prev = xml; +// Mark Fill + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, EdgeLinkSeedFillColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// Mark Stroke + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, EdgeLinkSeedStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%1.2f\r\n", + prev, extra, 1.0); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (EdgeLinkSeedOpacity != 1.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + EdgeLinkSeedOpacity); + sqlite3_free(prev); + prev = xml; + } + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + EdgeLinkSeedSize); + sqlite3_free(prev); + prev = xml; + if (EdgeLinkSeedRotation != 0.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + EdgeLinkSeedRotation); + sqlite3_free(prev); + prev = xml; + } + if (EdgeLinkSeedAnchorX != 0.5 || EdgeLinkSeedAnchorY != 0.5) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, EdgeLinkSeedAnchorX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, EdgeLinkSeedAnchorY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (EdgeLinkSeedDisplacementX != 0.0 || EdgeLinkSeedDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, EdgeLinkSeedDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, EdgeLinkSeedDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleTopologyObj::DoCreateFaceSeedXML() +{ +// +// creating the XML Style - FaceSeed +// + const char *cstr; + char *prev; + char *xml = sqlite3_mprintf("\t\r\n"); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\tFaceSeed\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\r\n\t\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\ttopoclass\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\tface_seed\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\r\n\t\t\r\n", + prev); + sqlite3_free(prev); + prev = xml; + + const char *extra = "\t\t"; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// mark symbol + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + switch (FaceSeedWellKnownMark) + { + case RL2_GRAPHIC_MARK_CIRCLE: + cstr = "circle"; + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + cstr = "triangle"; + break; + case RL2_GRAPHIC_MARK_STAR: + cstr = "star"; + break; + case RL2_GRAPHIC_MARK_CROSS: + cstr = "cross"; + break; + case RL2_GRAPHIC_MARK_X: + cstr = "x"; + break; + default: + cstr = "square"; + break; + }; + xml = + sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, + extra, cstr); + sqlite3_free(prev); + prev = xml; +// Mark Fill + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, FaceSeedFillColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// Mark Stroke + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, FaceSeedStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%1.2f\r\n", + prev, extra, 1.0); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (FaceSeedOpacity != 1.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + FaceSeedOpacity); + sqlite3_free(prev); + prev = xml; + } + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + FaceSeedSize); + sqlite3_free(prev); + prev = xml; + if (FaceSeedRotation != 0.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + FaceSeedRotation); + sqlite3_free(prev); + prev = xml; + } + if (FaceSeedAnchorX != 0.5 || FaceSeedAnchorY != 0.5) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, FaceSeedAnchorX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, FaceSeedAnchorY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (FaceSeedDisplacementX != 0.0 || FaceSeedDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, FaceSeedDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, FaceSeedDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +const unsigned char *QuickStyleTopologyObj::CloneXmlStyle() +{ +// +// cloning the XML Style definition +// + if (XmlStyle == NULL) + XmlStyle = CreateXmlStyle(); + if (XmlStyle == NULL) + return NULL; + int len = strlen(XmlStyle); + char *cloned = (char *) malloc(len + 1); + strcpy(cloned, XmlStyle); + return (const unsigned char *) cloned; +} + +bool QuickStyleTopologyDialog::Create(MyMapPanel * parent, MapLayer * layer) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + Type = Layer->GetType(); + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + IsConfigChanged = false; + + wxString title = wxT("QuickStyle (Topology) Edit"); + if (Type == MAP_LAYER_NETWORK) + title = wxT("QuickStyle (Network) Edit"); + if (wxPropertySheetDialog::Create(parent, wxID_ANY, title) == false) + return false; + if (Layer->GetQuickStyleTopology() != NULL) + Style = Layer->CloneQuickStyleTopology(); + else + Style = new QuickStyleTopologyObj(Type); + + wxBookCtrlBase *book = GetBookCtrl(); +// creates individual panels + wxPanel *mainPage = CreateMainPage(book); + book->AddPage(mainPage, wxT("General"), true); + if (Type == MAP_LAYER_NETWORK) + { + wxPanel *nodePage = CreateNodePage(book); + book->AddPage(nodePage, wxT("Nodes"), false); + wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); + book->AddPage(edgeLinkPage, wxT("Links"), false); + wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); + book->AddPage(edgeLinkSeedPage, wxT("Link Seeds"), false); + } else + { + wxPanel *nodePage = CreateNodePage(book); + book->AddPage(nodePage, wxT("Nodes"), false); + wxPanel *edgeLinkPage = CreateEdgeLinkPage(book); + book->AddPage(edgeLinkPage, wxT("Edges"), false); + wxPanel *facePage = CreateFacePage(book); + book->AddPage(facePage, wxT("Faces"), false); + wxPanel *edgeLinkSeedPage = CreateEdgeLinkSeedPage(book); + book->AddPage(edgeLinkSeedPage, wxT("Edge Seeds"), false); + wxPanel *faceSeedPage = CreateFaceSeedPage(book); + book->AddPage(faceSeedPage, wxT("Face Seeds"), false); + } + + CreateButtons(); + LayoutDialog(); +// appends event handler for TAB/PAGE changing + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanging); + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnPageChanged); +// appends event handler for buttons + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnQuit); + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnOk); + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnApply); + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnExport); + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleTopologyDialog::OnCopy); +// centers the dialog window + Centre(); + UpdateMainPage(); + return true; +} + +void QuickStyleTopologyDialog::CreateButtons() +{ +// +// adding the common Buttons +// + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *exp = + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + btnBox->AddSpacer(100); + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +} + +wxPanel *QuickStyleTopologyDialog::CreateMainPage(wxWindow * parent) +{ +// +// creating the MAIN page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// First row: Layer name + boxSizer->AddSpacer(50); + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, + wxT("Layer FullName"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString fullName = DbPrefix + wxT(".") + LayerName; + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, + wxT("Geometry Type"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); + nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString typeName = wxT("UNKNOWN"); + if (Type == MAP_LAYER_NETWORK) + typeName = wxT("Network (ISO TopoNet)"); + if (Type == MAP_LAYER_TOPOLOGY) + typeName = wxT("Topology (ISO TopoGeo)"); + wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, + wxT("QuickStyle Name"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString uuid = wxString::FromUTF8(Style->GetUUID()); + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + boxSizer->AddSpacer(25); +// second row: Visibility Range + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Visibility Range"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *visibilitySizer = + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, + 5); + wxString range[4]; + range[0] = wxT("&None"); + range[1] = wxT("&Min"); + range[2] = wxT("&Max"); + range[3] = wxT("&Both"); + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, + wxT("&Range Type"), + wxDefaultPosition, + wxDefaultSize, 4, + range, 2, + wxRA_SPECIFY_COLS); + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + rangeBox->SetSelection(0); + visibilitySizer->AddSpacer(20); + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *minScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *minScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + minScaleCtrl->Enable(false); + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxStaticText *maxScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *maxScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), + wxDefaultPosition, wxSize(100, 22)); + maxScaleCtrl->Enable(false); + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdScaleChanged); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Visibility Range selection changed +// + wxRadioBox *scaleModeCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + switch (scaleModeCtrl->GetSelection()) + { + case 0: + Style->EnableMinScale(false); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 1: + Style->EnableMinScale(true); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 2: + Style->EnableMinScale(false); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + case 3: + Style->EnableMinScale(true); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + }; +} + +wxPanel *QuickStyleTopologyDialog::CreateNodePage(wxWindow * parent) +{ +// +// creating the Node Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: Opacity + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_NODE_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Well Known Mark Name + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString mark[6]; + mark[0] = wxT("&Square"); + mark[1] = wxT("&Circle"); + mark[2] = wxT("&Triangle"); + mark[3] = wxT("&Star"); + mark[4] = wxT("&Cross"); + mark[5] = wxT("&X"); + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_NODE_MARK, + wxT("&Mark"), + wxDefaultPosition, + wxDefaultSize, 6, + mark, 1, + wxRA_SPECIFY_COLS); + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + markBox->SetSelection(0); +// second row: Size and Rotation + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row A: Size + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *sizeCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_SIZE, wxT("16.0"), + wxDefaultPosition, wxSize(100, 22)); + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Rotation + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Rotation"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *rotCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ROTATION, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row: AnchorNode and Displacement + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// third row A: Anchor Node + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Anchor Node"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_X, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_ANCHOR_Y, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Displacement + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + anchorBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// fourth row: colors + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// first row A: Fill Color + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *fillColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_FILL_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFillCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickFill = new wxButton(panel, ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, + wxT("&Pick a color")); + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + box3Sizer->AddSpacer(30); + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorStrokeSizer = + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *strokeColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_NODE_STROKE_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sampleStrokeCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickStroke = + new wxButton(panel, ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, + wxT("&Pick a color")); + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_NODE_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdNodeMarkChanged); + Connect(ID_SYMBOLIZER_NODE_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdNodeColorFillPicker); + Connect(ID_SYMBOLIZER_NODE_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdNodeColorFillChanged); + Connect(ID_SYMBOLIZER_NODE_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdNodeColorStrokePicker); + Connect(ID_SYMBOLIZER_NODE_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdNodeColorStrokeChanged); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdNodeMarkChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Mark selection changed +// + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); + switch (markCtrl->GetSelection()) + { + case 1: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); + break; + case 2: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); + break; + case 3: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_STAR); + break; + case 4: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_CROSS); + break; + case 5: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_X); + break; + default: + Style->SetNodeWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); + break; + }; +} + +void QuickStyleTopologyDialog:: +OnCmdNodeColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_FILL_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdNodeColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleTopologyDialog:: +OnCmdNodeColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdNodeColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkPage(wxWindow * parent) +{ +// +// creating the EdgeLink Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: the Stroke #1 Opacity and Perpendicular Offset + boxSizer->AddSpacer(50); + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// first row B: PerpendicularOffset + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); + opacityBoxSizer->Add(perpendicularBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Perpendicular Offset"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *perpendicularSizer = + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); + perpendicularBoxSizer->Add(perpendicularSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *perpendicularCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Draw lines in parallel to the original geometry.")); + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Positive to the left-hand side. Negative numbers mean right.")); + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row: Stroke color or Graphic + wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row B: Stroke Color + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *colorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick = + new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row: Stroke-Width + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row A: StrokeWidth + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Width"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *widthCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), + wxDefaultPosition, wxSize(100, 22)); + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row D: DashArray and DashOffset + wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString dot[4]; + if (Type == MAP_LAYER_NETWORK) + { + dot[0] = wxT("&Solid Link"); + dot[1] = wxT("&Dotted Link"); + dot[2] = wxT("&Dashed Link"); + dot[3] = wxT("&Dashed/Dotted Link"); + } else + { + dot[0] = wxT("&Solid Edge"); + dot[1] = wxT("&Dotted Edge"); + dot[2] = wxT("&Dashed Edge"); + dot[3] = wxT("&Dashed/Dotted Edge"); + } + wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, + wxT("&Dash/Dot Style"), + wxDefaultPosition, + wxDefaultSize, 4, + dot, 1, + wxRA_SPECIFY_COLS); + dotBox->SetSelection(0); + dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkColorChanged); + Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkColorPicker); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkColorChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleTopologyDialog::CreateFacePage(wxWindow * parent) +{ +// +// creating the Face Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row: the Face Displacement and Perpendicular Offset + wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// first row A: Displacement + wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); + polygonBoxSizer->Add(displacementBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + displacementBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// first row B: PerpendicularOffset + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); + polygonBoxSizer->Add(perpendicularBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Perpendicular Offset"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *perpendicularSizer = + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); + perpendicularBoxSizer->Add(perpendicularSizer, 0, + wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *perpendicularCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Positive: larger. / Negative: smaller.")); + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row: Fill Opacity + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Face Fill"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableCtrl->SetValue(Style->IsFaceFill()); + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(400, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityCtrl->Enable(Style->IsFaceFill()); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Fill Color + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); + auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *colorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + sampleCtrl->Enable(Style->IsFaceFill()); + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick = + new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); + pick->Enable(Style->IsFaceFill()); + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// first row A: the Stroke #1 Opacity + wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Face Stroke"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); + opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enable2Ctrl->SetValue(Style->IsFaceStroke()); + enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); + enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacity2Ctrl = + new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(250, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacity2Ctrl->Enable(Style->IsFaceStroke()); + opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); + enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); + color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *color2Ctrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + color2Ctrl->Enable(Style->IsFaceStroke()); + color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sample2Ctrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + sample2Ctrl->Enable(Style->IsFaceStroke()); + color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); + color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick2 = + new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); + pick2->Enable(Style->IsFaceStroke()); + picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row: Stroke-Width, + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row A: StrokeWidth + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Width"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *widthCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), + wxDefaultPosition, wxSize(100, 22)); + widthCtrl->Enable(false); + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceStrokeChanged); + Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceFillChanged); + Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceColorFillChanged); + Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceColorFillPicker); + Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceColorStrokeChanged); + Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceColorStrokePicker); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdFaceStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->SetFaceStroke(true); + else + Style->SetFaceStroke(false); + RetrieveFacePage(false); + UpdateFacePage(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->SetFaceFill(true); + else + Style->SetFaceFill(false); + RetrieveFacePage(false); + UpdateFacePage(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleTopologyDialog:: +OnCmdFaceColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleTopologyDialog::CreateEdgeLinkSeedPage(wxWindow * parent) +{ +// +// creating the EdgeLinkSeed Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: Opacity + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_EDGELINK_SEED_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Well Known Mark Name + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString mark[6]; + mark[0] = wxT("&Square"); + mark[1] = wxT("&Circle"); + mark[2] = wxT("&Triangle"); + mark[3] = wxT("&Star"); + mark[4] = wxT("&Cross"); + mark[5] = wxT("&X"); + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_EDGELINK_SEED_MARK, + wxT("&Mark"), + wxDefaultPosition, + wxDefaultSize, 6, + mark, 1, + wxRA_SPECIFY_COLS); + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + markBox->SetSelection(0); +// second row: Size and Rotation + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row A: Size + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *sizeCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_SIZE, wxT("16.0"), + wxDefaultPosition, wxSize(100, 22)); + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Rotation + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Rotation"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *rotCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ROTATION, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row: AnchorEdgeLinkSeed and Displacement + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// third row A: Anchor EdgeLinkSeed + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Anchor EdgeLinkSeed"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Displacement + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + anchorBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X, + wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y, + wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// fourth row: colors + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// first row A: Fill Color + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *fillColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFillCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickFill = + new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, + wxT("&Pick a color")); + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + box3Sizer->AddSpacer(30); + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorStrokeSizer = + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *strokeColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sampleStrokeCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX, + bmp, + wxDefaultPosition, wxSize(32, 32)); + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickStroke = + new wxButton(panel, ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, + wxT("&Pick a color")); + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_EDGELINK_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedMarkChanged); + Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_BTN, + wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillPicker); + Connect(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorFillChanged); + Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_BTN, + wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokePicker); + Connect(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdEdgeLinkSeedColorStrokeChanged); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Mark selection changed +// + wxRadioBox *markCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); + switch (markCtrl->GetSelection()) + { + case 1: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); + break; + case 2: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); + break; + case 3: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); + break; + case 4: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); + break; + case 5: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_X); + break; + default: + Style->SetEdgeLinkSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); + break; + }; +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) + FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdEdgeLinkSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleTopologyDialog::CreateFaceSeedPage(wxWindow * parent) +{ +// +// creating the FaceSeed Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: Opacity + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_FACE_SEED_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Well Known Mark Name + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString mark[6]; + mark[0] = wxT("&Square"); + mark[1] = wxT("&Circle"); + mark[2] = wxT("&Triangle"); + mark[3] = wxT("&Star"); + mark[4] = wxT("&Cross"); + mark[5] = wxT("&X"); + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_FACE_SEED_MARK, + wxT("&Mark"), + wxDefaultPosition, + wxDefaultSize, 6, + mark, 1, + wxRA_SPECIFY_COLS); + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + markBox->SetSelection(0); +// second row: Size and Rotation + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row A: Size + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *sizeCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_SIZE, wxT("16.0"), + wxDefaultPosition, wxSize(100, 22)); + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Rotation + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Rotation"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *rotCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ROTATION, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row: AnchorFaceSeed and Displacement + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// third row A: Anchor FaceSeed + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Anchor FaceSeed"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_X, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Displacement + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + anchorBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// fourth row: colors + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// first row A: Fill Color + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *fillColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFillCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickFill = + new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, + wxT("&Pick a color")); + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + box3Sizer->AddSpacer(30); + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorStrokeSizer = + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *strokeColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sampleStrokeCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickStroke = + new wxButton(panel, ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, + wxT("&Pick a color")); + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_FACE_SEED_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceSeedMarkChanged); + Connect(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceSeedColorFillPicker); + Connect(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceSeedColorFillChanged); + Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_BTN, + wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokePicker); + Connect(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleTopologyDialog::OnCmdFaceSeedColorStrokeChanged); + return panel; +} + +void QuickStyleTopologyDialog:: +OnCmdFaceSeedMarkChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Mark selection changed +// + wxRadioBox *markCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); + switch (markCtrl->GetSelection()) + { + case 1: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); + break; + case 2: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); + break; + case 3: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_STAR); + break; + case 4: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_CROSS); + break; + case 5: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_X); + break; + default: + Style->SetFaceSeedWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); + break; + }; +} + +void QuickStyleTopologyDialog:: +OnCmdFaceSeedColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceSeedColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleTopologyDialog:: +OnCmdFaceSeedColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleTopologyDialog:: +OnCmdFaceSeedColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + + + + + +bool QuickStyleTopologyDialog::RetrieveMainPage() +{ +// +// retrieving params from the MAIN page +// + double min = Style->GetScaleMin(); + double max = Style->GetScaleMax(); + if (Style->IsMinScaleEnabled() == true) + { + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxString value = minCtrl->GetValue(); + if (value.ToDouble(&min) != true) + { + wxMessageBox(wxT + ("MIN_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (min < 0.0) + { + wxMessageBox(wxT + ("MIN_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMaxScaleEnabled() == true) + { + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + wxString value = maxCtrl->GetValue(); + if (value.ToDouble(&max) != true) + { + wxMessageBox(wxT + ("MAX_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (max < 0.0) + { + wxMessageBox(wxT + ("MAX_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) + { + if (min >= max) + { + wxMessageBox(wxT + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + Style->SetScaleMin(min); + Style->SetScaleMax(max); + return true; +} + +void QuickStyleTopologyDialog::UpdateMainPage() +{ +// +// updating the MAIN page +// + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(0); + else if (Style->IsMinScaleEnabled() == true + && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(1); + else if (Style->IsMinScaleEnabled() != true + && Style->IsMaxScaleEnabled() == true) + rangeBox->SetSelection(2); + else + rangeBox->SetSelection(3); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + char dummy[64]; + wxString str; + if (Style->IsMinScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMin()); + str = wxString::FromUTF8(dummy); + minCtrl->SetValue(str); + minCtrl->Enable(true); + } else + { + str = wxT("0.0"); + minCtrl->SetValue(str); + minCtrl->Enable(false); + } + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + if (Style->IsMaxScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMax()); + str = wxString::FromUTF8(dummy); + maxCtrl->SetValue(str); + maxCtrl->Enable(true); + } else + { + str = wxT("+Infinite"); + maxCtrl->SetValue(str); + maxCtrl->Enable(false); + } +} + +bool QuickStyleTopologyDialog::RetrieveNodePage(bool check) +{ +// +// retrieving params from the Node Nodeizer page +// + double opacity; + double size; + double rotation; + double anchorNodeX; + double anchorNodeY; + double displacementX; + double displacementY; + char fillColor[8]; + char strokeColor[8]; + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&size) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (size < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); + value = rotationCtrl->GetValue(); + if (value.ToDouble(&rotation) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ROTATION isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); + value = anchorXCtrl->GetValue(); + if (value.ToDouble(&anchorNodeX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorNodeX < 0.0 || anchorNodeX > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); + value = anchorYCtrl->GetValue(); + if (value.ToDouble(&anchorNodeY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorNodeY < 0.0 || anchorNodeY > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); + value = displXCtrl->GetValue(); + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); + color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + Style->SetNodeOpacity(opacity); + Style->SetNodeSize(size); + Style->SetNodeRotation(rotation); + Style->SetNodeAnchorX(anchorNodeX); + Style->SetNodeAnchorY(anchorNodeY); + Style->SetNodeDisplacementX(displacementX); + Style->SetNodeDisplacementY(displacementY); + Style->SetNodeFillColor(fillColor); + Style->SetNodeStrokeColor(strokeColor); + return true; +} + +void QuickStyleTopologyDialog::UpdateNodePage() +{ +// +// updating the Node Nodeizer page +// + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_NODE_OPACITY); + opacityCtrl->SetValue(Style->GetNodeOpacity() * 100.0); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetNodeSize()); + wxString str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ROTATION); + sprintf(dummy, "%1.2f", Style->GetNodeRotation()); + str = wxString::FromUTF8(dummy); + rotationCtrl->SetValue(str); + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_X); + sprintf(dummy, "%1.2f", Style->GetNodeAnchorX()); + str = wxString::FromUTF8(dummy); + anchorXCtrl->SetValue(str); + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_ANCHOR_Y); + sprintf(dummy, "%1.2f", Style->GetNodeAnchorY()); + str = wxString::FromUTF8(dummy); + anchorYCtrl->SetValue(str); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_X); + sprintf(dummy, "%1.2f", Style->GetNodeDisplacementX()); + str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetNodeDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_NODE_MARK); + switch (Style->GetNodeWellKnownMark()) + { + case RL2_GRAPHIC_MARK_CIRCLE: + markCtrl->SetSelection(1); + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + markCtrl->SetSelection(2); + break; + case RL2_GRAPHIC_MARK_STAR: + markCtrl->SetSelection(3); + break; + case RL2_GRAPHIC_MARK_CROSS: + markCtrl->SetSelection(4); + break; + case RL2_GRAPHIC_MARK_X: + markCtrl->SetSelection(5); + break; + default: + markCtrl->SetSelection(0); + break; + }; + wxTextCtrl *colorFillCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_FILL_COLOR); + wxString fillColor = wxString::FromUTF8(Style->GetNodeFillColor()); + colorFillCtrl->SetValue(fillColor); + wxTextCtrl *colorStrokeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_NODE_STROKE_COLOR); + wxString strokeColor = wxString::FromUTF8(Style->GetNodeStrokeColor()); + colorStrokeCtrl->SetValue(strokeColor); +} + +bool QuickStyleTopologyDialog::RetrieveEdgeLinkPage(bool check) +{ +// +// retrieving params from the EdgeLink Symbolizer page +// + double opacity; + double perpendicularOffset; + char strokeColor[8]; + double strokeWidth; + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); + wxString value = perpCtrl->GetValue(); + if (value.ToDouble(&perpendicularOffset) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); + value = widthCtrl->GetValue(); + if (value.ToDouble(&strokeWidth) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (strokeWidth <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); + switch (dotCtrl->GetSelection()) + { + case 1: + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DOT_LINE); + break; + case 2: + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_LINE); + break; + case 3: + Style->SetEdgeLinkDotStyle(QUICK_STYLE_DASH_DOT_LINE); + break; + default: + Style->SetEdgeLinkDotStyle(QUICK_STYLE_SOLID_LINE); + break; + }; + Style->SetEdgeLinkOpacity(opacity); + Style->SetEdgeLinkPerpendicularOffset(perpendicularOffset); + Style->SetEdgeLinkStrokeWidth(strokeWidth); + Style->SetEdgeLinkStrokeColor(strokeColor); + return true; +} + +void QuickStyleTopologyDialog::UpdateEdgeLinkPage() +{ +// +// updating the EdgeLink Symbolizer page +// + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); + opacityCtrl->SetValue(Style->GetEdgeLinkOpacity() * 100.0); + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetEdgeLinkPerpendicularOffset()); + wxString str = wxString::FromUTF8(dummy); + perpCtrl->SetValue(str); + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); + colorCtrl->Enable(true); + pick->Enable(true); + wxString strokeColor = wxString::FromUTF8(Style->GetEdgeLinkStrokeColor()); + colorCtrl->SetValue(strokeColor); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkStrokeWidth()); + str = wxString::FromUTF8(dummy); + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); + switch (Style->GetEdgeLinkDotStyle()) + { + case QUICK_STYLE_DOT_LINE: + dotCtrl->SetSelection(1); + break; + case QUICK_STYLE_DASH_LINE: + dotCtrl->SetSelection(2); + break; + case QUICK_STYLE_DASH_DOT_LINE: + dotCtrl->SetSelection(3); + break; + default: + dotCtrl->SetSelection(0); + break; + }; + widthCtrl->SetValue(str); +} + +bool QuickStyleTopologyDialog::RetrieveFacePage(bool check) +{ +// +// retrieving params from the Face Synbolizer page +// + double fillOpacity; + double displacementX; + double displacementY; + double perpendicularOffset; + char fillColor[8]; + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); + fillOpacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); + wxString value = displXCtrl->GetValue(); + if (Style->IsFaceFill() != true && Style->IsFaceStroke() != true) + { + if (check == true) + { + wxMessageBox(wxT + ("You can't disable both FILL and STROKE at the same time !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); + value = perpCtrl->GetValue(); + if (value.ToDouble(&perpendicularOffset) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + Style->SetFaceFillOpacity(fillOpacity); + Style->SetFaceDisplacementX(displacementX); + Style->SetFaceDisplacementY(displacementY); + Style->SetFacePerpendicularOffset(perpendicularOffset); + Style->SetFaceFillColor(fillColor); + return true; +} + +void QuickStyleTopologyDialog::UpdateFacePage() +{ +// +// updating the Face Symbolizer page +// + wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); + enableBox->SetValue(Style->IsFaceFill()); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetFaceDisplacementX()); + wxString str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetFaceDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); + sprintf(dummy, "%1.2f", Style->GetFacePerpendicularOffset()); + str = wxString::FromUTF8(dummy); + perpCtrl->SetValue(str); + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); + opacityCtrl->SetValue(Style->GetFaceFillOpacity() * 100.0); + opacityCtrl->Enable(Style->IsFaceFill()); + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); + wxColour color = wxNullColour; + str = wxString::FromUTF8(Style->GetFaceFillColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } + colorCtrl->Enable(Style->IsFaceFill()); + pick->Enable(Style->IsFaceFill()); + wxSlider *opacity2Ctrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); + opacity2Ctrl->SetValue(Style->GetFaceStrokeOpacity() * 100.0); + opacity2Ctrl->Enable(Style->IsFaceStroke()); + wxTextCtrl *color2Ctrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); + color = wxNullColour; + str = wxString::FromUTF8(Style->GetFaceStrokeColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + color2Ctrl->SetValue(str); + } + color2Ctrl->Enable(Style->IsFaceStroke()); + pick2->Enable(Style->IsFaceStroke()); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); + sprintf(dummy, "%1.2f", Style->GetFaceStrokeWidth()); + str = wxString::FromUTF8(dummy); + widthCtrl->SetValue(str); + widthCtrl->Enable(Style->IsFaceStroke()); +} + +bool QuickStyleTopologyDialog::RetrieveEdgeLinkSeedPage(bool check) +{ +// +// retrieving params from the EdgeLinkSeed EdgeLinkSeedizer page +// + double opacity; + double size; + double rotation; + double anchorEdgeLinkSeedX; + double anchorEdgeLinkSeedY; + double displacementX; + double displacementY; + char fillColor[8]; + char strokeColor[8]; + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *sizeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&size) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (size < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); + value = rotationCtrl->GetValue(); + if (value.ToDouble(&rotation) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ROTATION isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); + value = anchorXCtrl->GetValue(); + if (value.ToDouble(&anchorEdgeLinkSeedX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorEdgeLinkSeedX < 0.0 || anchorEdgeLinkSeedX > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); + value = anchorYCtrl->GetValue(); + if (value.ToDouble(&anchorEdgeLinkSeedY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorEdgeLinkSeedY < 0.0 || anchorEdgeLinkSeedY > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); + value = displXCtrl->GetValue(); + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); + color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + Style->SetEdgeLinkSeedOpacity(opacity); + Style->SetEdgeLinkSeedSize(size); + Style->SetEdgeLinkSeedRotation(rotation); + Style->SetEdgeLinkSeedAnchorX(anchorEdgeLinkSeedX); + Style->SetEdgeLinkSeedAnchorY(anchorEdgeLinkSeedY); + Style->SetEdgeLinkSeedDisplacementX(displacementX); + Style->SetEdgeLinkSeedDisplacementY(displacementY); + Style->SetEdgeLinkSeedFillColor(fillColor); + Style->SetEdgeLinkSeedStrokeColor(strokeColor); + return true; +} + +void QuickStyleTopologyDialog::UpdateEdgeLinkSeedPage() +{ +// +// updating the EdgeLinkSeed EdgeLinkSeedizer page +// + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_OPACITY); + opacityCtrl->SetValue(Style->GetEdgeLinkSeedOpacity() * 100.0); + wxTextCtrl *sizeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedSize()); + wxString str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ROTATION); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedRotation()); + str = wxString::FromUTF8(dummy); + rotationCtrl->SetValue(str); + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_X); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorX()); + str = wxString::FromUTF8(dummy); + anchorXCtrl->SetValue(str); + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_ANCHOR_Y); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedAnchorY()); + str = wxString::FromUTF8(dummy); + anchorYCtrl->SetValue(str); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_X); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementX()); + str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetEdgeLinkSeedDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxRadioBox *markCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_MARK); + switch (Style->GetEdgeLinkSeedWellKnownMark()) + { + case RL2_GRAPHIC_MARK_CIRCLE: + markCtrl->SetSelection(1); + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + markCtrl->SetSelection(2); + break; + case RL2_GRAPHIC_MARK_STAR: + markCtrl->SetSelection(3); + break; + case RL2_GRAPHIC_MARK_CROSS: + markCtrl->SetSelection(4); + break; + case RL2_GRAPHIC_MARK_X: + markCtrl->SetSelection(5); + break; + default: + markCtrl->SetSelection(0); + break; + }; + wxTextCtrl *colorFillCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_FILL_COLOR); + wxString fillColor = wxString::FromUTF8(Style->GetEdgeLinkSeedFillColor()); + colorFillCtrl->SetValue(fillColor); + wxTextCtrl *colorStrokeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_EDGELINK_SEED_STROKE_COLOR); + wxString strokeColor = + wxString::FromUTF8(Style->GetEdgeLinkSeedStrokeColor()); + colorStrokeCtrl->SetValue(strokeColor); +} + +bool QuickStyleTopologyDialog::RetrieveFaceSeedPage(bool check) +{ +// +// retrieving params from the FaceSeed FaceSeedizer page +// + double opacity; + double size; + double rotation; + double anchorFaceSeedX; + double anchorFaceSeedY; + double displacementX; + double displacementY; + char fillColor[8]; + char strokeColor[8]; + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *sizeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&size) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (size < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); + value = rotationCtrl->GetValue(); + if (value.ToDouble(&rotation) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ROTATION isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); + value = anchorXCtrl->GetValue(); + if (value.ToDouble(&anchorFaceSeedX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorFaceSeedX < 0.0 || anchorFaceSeedX > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); + value = anchorYCtrl->GetValue(); + if (value.ToDouble(&anchorFaceSeedY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorFaceSeedY < 0.0 || anchorFaceSeedY > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); + value = displXCtrl->GetValue(); + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); + color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + Style->SetFaceSeedOpacity(opacity); + Style->SetFaceSeedSize(size); + Style->SetFaceSeedRotation(rotation); + Style->SetFaceSeedAnchorX(anchorFaceSeedX); + Style->SetFaceSeedAnchorY(anchorFaceSeedY); + Style->SetFaceSeedDisplacementX(displacementX); + Style->SetFaceSeedDisplacementY(displacementY); + Style->SetFaceSeedFillColor(fillColor); + Style->SetFaceSeedStrokeColor(strokeColor); + return true; +} + +void QuickStyleTopologyDialog::UpdateFaceSeedPage() +{ +// +// updating the FaceSeed FaceSeedizer page +// + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FACE_SEED_OPACITY); + opacityCtrl->SetValue(Style->GetFaceSeedOpacity() * 100.0); + wxTextCtrl *sizeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetFaceSeedSize()); + wxString str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ROTATION); + sprintf(dummy, "%1.2f", Style->GetFaceSeedRotation()); + str = wxString::FromUTF8(dummy); + rotationCtrl->SetValue(str); + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_X); + sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorX()); + str = wxString::FromUTF8(dummy); + anchorXCtrl->SetValue(str); + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_ANCHOR_Y); + sprintf(dummy, "%1.2f", Style->GetFaceSeedAnchorY()); + str = wxString::FromUTF8(dummy); + anchorYCtrl->SetValue(str); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_X); + sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementX()); + str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetFaceSeedDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxRadioBox *markCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_FACE_SEED_MARK); + switch (Style->GetFaceSeedWellKnownMark()) + { + case RL2_GRAPHIC_MARK_CIRCLE: + markCtrl->SetSelection(1); + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + markCtrl->SetSelection(2); + break; + case RL2_GRAPHIC_MARK_STAR: + markCtrl->SetSelection(3); + break; + case RL2_GRAPHIC_MARK_CROSS: + markCtrl->SetSelection(4); + break; + case RL2_GRAPHIC_MARK_X: + markCtrl->SetSelection(5); + break; + default: + markCtrl->SetSelection(0); + break; + }; + wxTextCtrl *colorFillCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_FILL_COLOR); + wxString fillColor = wxString::FromUTF8(Style->GetFaceSeedFillColor()); + colorFillCtrl->SetValue(fillColor); + wxTextCtrl *colorStrokeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FACE_SEED_STROKE_COLOR); + wxString strokeColor = wxString::FromUTF8(Style->GetFaceSeedStrokeColor()); + colorStrokeCtrl->SetValue(strokeColor); +} + +void QuickStyleTopologyDialog::OnPageChanging(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changing +// + bool ret = false; + int idx = event.GetOldSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else if (idx == 1) + ret = RetrieveNodePage(); + else if (idx == 2) + ret = RetrieveEdgeLinkPage(); + else + { + if (Type == MAP_LAYER_NETWORK) + { + if (idx == 3) + ret = RetrieveEdgeLinkSeedPage(); + } else + { + if (idx == 3) + ret = RetrieveFacePage(); + if (idx == 4) + ret = RetrieveEdgeLinkSeedPage(); + if (idx == 5) + ret = RetrieveFaceSeedPage(); + } + } + if (ret != true) + event.Veto(); +} + +void QuickStyleTopologyDialog::OnPageChanged(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changed +// + int idx = event.GetSelection(); + if (idx == 0) + UpdateMainPage(); + else if (idx == 1) + UpdateNodePage(); + else if (idx == 2) + UpdateEdgeLinkPage(); + else + { + if (Type == MAP_LAYER_NETWORK) + { + if (idx == 3) + UpdateEdgeLinkSeedPage(); + } else + { + if (idx == 3) + UpdateFacePage(); + if (idx == 4) + UpdateEdgeLinkSeedPage(); + if (idx == 5) + UpdateFaceSeedPage(); + } + } +} + +bool QuickStyleTopologyDialog::UpdateStyle() +{ +// +// updating the QuickStyle +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else if (idx == 1) + ret = RetrieveNodePage(); + else if (idx == 2) + ret = RetrieveEdgeLinkPage(); + else + { + if (Type == MAP_LAYER_NETWORK) + { + if (idx == 3) + ret = RetrieveEdgeLinkSeedPage(); + } else + { + if (idx == 3) + ret = RetrieveFacePage(); + if (idx == 4) + ret = RetrieveEdgeLinkSeedPage(); + if (idx == 5) + ret = RetrieveFaceSeedPage(); + } + } + if (ret == false) + return false; + + VectorLayerConfig *config = Layer->GetVectorConfig(); + bool setCurrentStyle = false; + if (config->GetStyle() == NULL) + setCurrentStyle = true; + else + { + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) + setCurrentStyle = true; + } + if (setCurrentStyle == true) + { + config->SetStyle(Style->GetUUID()); + IsConfigChanged = true; + } + IsConfigChanged = Layer->UpdateQuickStyle(Style); + return true; +} + +void QuickStyleTopologyDialog::OnOk(wxCommandEvent & WXUNUSED(event)) +{ +// +// permanently saving the QuickStyle and quitting +// + if (UpdateStyle() == true) + wxDialog::EndModal(wxID_OK); +} + +void QuickStyleTopologyDialog::OnApply(wxCommandEvent & WXUNUSED(event)) +{ +// +// applying the QuickStyle and continuing +// + if (UpdateStyle() == true) + { + if (IsConfigChanged == true) + MapPanel->RefreshMap(); + } +} + +void QuickStyleTopologyDialog::OnExport(wxCommandEvent & WXUNUSED(event)) +{ +// +// exporting the Quick Style as an external file +// + bool xret = false; + int ret; + wxString path; + wxString lastDir; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + xret = RetrieveMainPage(); + else if (idx == 1) + xret = RetrieveNodePage(); + else if (idx == 2) + xret = RetrieveEdgeLinkPage(); + else + { + if (Type == MAP_LAYER_NETWORK) + { + if (idx == 3) + xret = RetrieveEdgeLinkSeedPage(); + } else + { + if (idx == 3) + xret = RetrieveFacePage(); + if (idx == 4) + xret = RetrieveEdgeLinkSeedPage(); + if (idx == 5) + xret = RetrieveFaceSeedPage(); + } + } + if (xret == false) + return; + + wxFileDialog fileDialog(this, + wxT("Exporting an SLD/SE QuickStyle to a file"), + wxT(""), wxT("style.xml"), + wxT("XML Document|*.xml|All files (*.*)|*.*"), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, + wxDefaultSize, wxT("filedlg")); + lastDir = MainFrame->GetLastDirectory(); + if (lastDir.Len() >= 1) + fileDialog.SetDirectory(lastDir); + ret = fileDialog.ShowModal(); + if (ret == wxID_OK) + { + wxFileName file(fileDialog.GetPath()); + path = file.GetPath(); + path += file.GetPathSeparator(); + path += file.GetName(); + lastDir = file.GetPath(); + path = fileDialog.GetPath(); + FILE *out = fopen(path.ToUTF8(), "wb"); + if (out == NULL) + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + else + { + char *xml = Style->CreateXmlStyle(); + fwrite(xml, 1, strlen(xml), out); + sqlite3_free(xml); + fclose(out); + wxMessageBox(wxT + ("SLD/SE QuickStyle successfully saved into:\n\n\"") + + path + wxT("\""), wxT("spatialite_gui"), + wxOK | wxICON_INFORMATION, this); + } + } +} + +void QuickStyleTopologyDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Quick Style into the Clipboard +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else if (idx == 1) + ret = RetrieveNodePage(); + else if (idx == 2) + ret = RetrieveEdgeLinkPage(); + else + { + if (Type == MAP_LAYER_NETWORK) + { + if (idx == 3) + ret = RetrieveEdgeLinkSeedPage(); + } else + { + if (idx == 3) + ret = RetrieveFacePage(); + if (idx == 4) + ret = RetrieveEdgeLinkSeedPage(); + if (idx == 5) + ret = RetrieveFaceSeedPage(); + } + } + if (ret == false) + return; + + char *xml = Style->CreateXmlStyle(); + wxString XMLstring = wxString::FromUTF8(xml); + sqlite3_free(xml); + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); + wxTheClipboard->Close(); + } +} + +void QuickStyleTopologyDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} ADDED QuickStylesVector.cpp Index: QuickStylesVector.cpp ================================================================== --- QuickStylesVector.cpp +++ QuickStylesVector.cpp @@ -0,0 +1,5342 @@ +/* +/ QuickStylesVector.cpp +/ Quick Styles wizards (Vector layers) +/ +/ version 2.0, 2017 May 26 +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2017 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include "Classdef.h" + +#include "wx/spinctrl.h" +#include "wx/imaglist.h" +#include "wx/colordlg.h" +#include "wx/filename.h" +#include "wx/clipbrd.h" + +QuickStyleObj::QuickStyleObj(int type) +{ +// ctor + DoGetUUID(UUID); + Type = type; + MinScaleEnabled = false; + MaxScaleEnabled = false; + ScaleMin = 0.0; + ScaleMax = 0.0; + SymbolOpacity = 1.0; + SymbolSize = 16; + SymbolRotation = 0.0; + SymbolAnchorX = 0.5; + SymbolAnchorY = 0.5; + SymbolDisplacementX = 0.0; + SymbolDisplacementY = 0.0; + SymbolWellKnownMark = RandomWellKnownMark(); + RandomColor(SymbolFillColor); + RandomColor(SymbolStrokeColor); + LineOpacity = 1.0; + LinePerpendicularOffset = 0.0; + LineStrokeWidth = 1.0; + RandomColor(LineStrokeColor); + LineDotStyle = QUICK_STYLE_SOLID_LINE; + PolygonFill = true; + PolygonStroke = true; + PolygonDisplacementX = 0.0; + PolygonDisplacementY = 0.0; + PolygonPerpendicularOffset = 0.0; + PolygonFillOpacity = 1.0; + RandomColor(PolygonFillColor); + PolygonStrokeOpacity = 1.0; + PolygonStrokeWidth = 1.0; + RandomColor(PolygonStrokeColor); + LabelLinePlacement = true; + LabelPrint = false; + LabelColumn = NULL; + FontFacename = NULL; + FontSize = 10.0; + FontStyle = RL2_FONTSTYLE_NORMAL; + FontWeight = RL2_FONTWEIGHT_NORMAL; + FontOpacity = 1.0; + strcpy(FontColor, "#000000"); + HasHalo = false; + HaloRadius = 1.0; + HaloOpacity = 1.0; + strcpy(HaloColor, "#ffffff"); + LabelAnchorX = 0.5; + LabelAnchorY = 0.5; + LabelDisplacementX = 0.0; + LabelDisplacementY = 0.0; + LabelRotation = 0.0; + LabelPerpendicularOffset = 0.0; + RepeatedLabel = false; + LabelInitialGap = 0.0; + LabelGap = 0.0; + LabelIsAligned = false; + LabelGeneralizeLine = false; + XmlStyle = NULL; +} + +QuickStyleObj *QuickStyleObj::Clone() +{ +// +// cloning a Quick Style +// + QuickStyleObj *Style = new QuickStyleObj(this->Type); + strcpy(Style->UUID, this->UUID); + Style->MinScaleEnabled = this->MinScaleEnabled; + Style->MaxScaleEnabled = this->MaxScaleEnabled; + Style->ScaleMin = this->ScaleMin; + Style->ScaleMax = this->ScaleMax; + Style->SymbolOpacity = this->SymbolOpacity; + Style->SymbolSize = this->SymbolSize; + Style->SymbolRotation = this->SymbolRotation; + Style->SymbolAnchorX = this->SymbolAnchorX; + Style->SymbolAnchorY = this->SymbolAnchorY; + Style->SymbolDisplacementX = this->SymbolDisplacementX; + Style->SymbolDisplacementY = this->SymbolDisplacementY; + Style->SymbolWellKnownMark = this->SymbolWellKnownMark; + strcpy(Style->SymbolFillColor, this->SymbolFillColor); + strcpy(Style->SymbolStrokeColor, this->SymbolStrokeColor); + Style->LineOpacity = this->LineOpacity; + Style->LinePerpendicularOffset = this->LinePerpendicularOffset; + Style->LineStrokeWidth = this->LineStrokeWidth; + strcpy(Style->LineStrokeColor, this->LineStrokeColor); + Style->LineDotStyle = this->LineDotStyle; + Style->PolygonFill = this->PolygonFill; + Style->PolygonStroke = this->PolygonStroke; + Style->PolygonDisplacementX = this->PolygonDisplacementX; + Style->PolygonDisplacementY = this->PolygonDisplacementY; + Style->PolygonPerpendicularOffset = this->PolygonPerpendicularOffset; + Style->PolygonFillOpacity = this->PolygonFillOpacity; + strcpy(Style->PolygonFillColor, this->PolygonFillColor); + Style->PolygonStrokeOpacity = this->PolygonStrokeOpacity; + Style->PolygonStrokeWidth = this->PolygonStrokeWidth; + strcpy(Style->PolygonStrokeColor, this->PolygonStrokeColor); + Style->LabelLinePlacement = this->LabelLinePlacement; + Style->LabelPrint = this->LabelPrint; + if (this->LabelColumn == NULL) + Style->LabelColumn = NULL; + else + { + int len = strlen(this->LabelColumn); + Style->LabelColumn = (char *) malloc(len + 1); + strcpy(Style->LabelColumn, this->LabelColumn); + } + if (this->FontFacename == NULL) + Style->FontFacename = NULL; + else + { + int len = strlen(this->FontFacename); + Style->FontFacename = (char *) malloc(len + 1); + strcpy(Style->FontFacename, this->FontFacename); + } + Style->FontSize = this->FontSize; + Style->FontStyle = this->FontStyle; + Style->FontWeight = this->FontWeight; + Style->FontOpacity = this->FontOpacity; + strcpy(Style->FontColor, this->FontColor); + Style->HasHalo = this->HasHalo; + Style->HaloRadius = this->HaloRadius; + Style->HaloOpacity = this->HaloOpacity; + strcpy(Style->HaloColor, this->HaloColor); + Style->LabelAnchorX = this->LabelAnchorX; + Style->LabelAnchorY = this->LabelAnchorY; + Style->LabelDisplacementX = this->LabelDisplacementX; + Style->LabelDisplacementY = this->LabelDisplacementY; + Style->LabelRotation = this->LabelRotation; + Style->LabelPerpendicularOffset = this->LabelPerpendicularOffset; + Style->RepeatedLabel = this->RepeatedLabel; + Style->LabelInitialGap = this->LabelInitialGap; + Style->LabelGap = this->LabelGap; + Style->LabelIsAligned = this->LabelIsAligned; + Style->LabelGeneralizeLine = this->LabelGeneralizeLine; + Style->XmlStyle = NULL; + return Style; +} + +bool QuickStyleObj::Compare(QuickStyleObj * Style) +{ +// +// comparing two Quick Style objects +// + if (Style == NULL) + return false; + if (strcmp(Style->UUID, this->UUID) != 0) + return false; + if (Style->MinScaleEnabled != this->MinScaleEnabled) + return false; + if (Style->MaxScaleEnabled != this->MaxScaleEnabled) + return false; + if (Style->ScaleMin != this->ScaleMin) + return false; + if (Style->ScaleMax != this->ScaleMax) + return false; + if (Style->SymbolOpacity != this->SymbolOpacity) + return false; + if (Style->SymbolSize != this->SymbolSize) + return false; + if (Style->SymbolRotation != this->SymbolRotation) + return false; + if (Style->SymbolAnchorX != this->SymbolAnchorX) + return false; + if (Style->SymbolAnchorY != this->SymbolAnchorY) + return false; + if (Style->SymbolDisplacementX != this->SymbolDisplacementX) + return false; + if (Style->SymbolDisplacementY != this->SymbolDisplacementY) + return false; + if (Style->SymbolWellKnownMark != this->SymbolWellKnownMark) + return false; + if (strcmp(Style->SymbolFillColor, this->SymbolFillColor) != 0) + return false; + if (strcmp(Style->SymbolStrokeColor, this->SymbolStrokeColor) != 0) + return false; + if (Style->LineOpacity != this->LineOpacity) + return false; + if (Style->LinePerpendicularOffset != this->LinePerpendicularOffset) + return false; + if (Style->LineStrokeWidth != this->LineStrokeWidth) + return false; + if (strcmp(Style->LineStrokeColor, this->LineStrokeColor) != 0) + return false; + if (Style->LineDotStyle != this->LineDotStyle) + return false; + if (Style->PolygonFill != this->PolygonFill) + return false; + if (Style->PolygonStroke != this->PolygonStroke) + return false; + if (Style->PolygonDisplacementX != this->PolygonDisplacementX) + return false; + if (Style->PolygonDisplacementY != this->PolygonDisplacementY) + return false; + if (Style->PolygonPerpendicularOffset != this->PolygonPerpendicularOffset) + return false; + if (Style->PolygonFillOpacity != this->PolygonFillOpacity) + return false; + if (strcmp(Style->PolygonFillColor, this->PolygonFillColor) != 0) + return false; + if (Style->PolygonStrokeOpacity != this->PolygonStrokeOpacity) + return false; + if (Style->PolygonStrokeWidth != this->PolygonStrokeWidth) + return false; + if (strcmp(Style->PolygonStrokeColor, this->PolygonStrokeColor) != 0) + return false; + if (Style->LabelLinePlacement != this->LabelLinePlacement) + return false; + if (Style->LabelPrint != this->LabelPrint) + return false; + if (Style->LabelColumn == NULL && this->LabelColumn == NULL) + ; + else if (Style->LabelColumn == NULL && this->LabelColumn != NULL) + return false; + else if (Style->LabelColumn != NULL && this->LabelColumn == NULL) + return false; + else if (strcmp(Style->LabelColumn, this->LabelColumn) != 0) + return false; + if (Style->FontFacename == NULL && this->FontFacename == NULL) + ; + else if (Style->FontFacename == NULL && this->FontFacename != NULL) + return false; + else if (Style->FontFacename != NULL && this->FontFacename == NULL) + return false; + else if (strcmp(Style->FontFacename, this->FontFacename) != 0) + return false; + if (Style->FontSize != this->FontSize) + return false; + if (Style->FontStyle != this->FontStyle) + return false; + if (Style->FontWeight != this->FontWeight) + return false; + if (Style->FontOpacity != this->FontOpacity) + return false; + if (strcmp(Style->FontColor, this->FontColor) != 0) + return false; + if (Style->HasHalo != this->HasHalo) + return false; + if (Style->HaloRadius != this->HaloRadius) + return false; + if (Style->HaloOpacity != this->HaloOpacity) + return false; + if (strcmp(Style->HaloColor, this->HaloColor) != 0) + return false; + if (Style->LabelAnchorX != this->LabelAnchorX) + return false; + if (Style->LabelAnchorY != this->LabelAnchorY) + return false; + if (Style->LabelDisplacementX != this->LabelDisplacementX) + return false; + if (Style->LabelDisplacementY != this->LabelDisplacementY) + return false; + if (Style->LabelRotation != this->LabelRotation) + return false; + if (Style->LabelPerpendicularOffset != this->LabelPerpendicularOffset) + return false; + if (Style->RepeatedLabel != this->RepeatedLabel) + return false; + if (Style->LabelInitialGap != this->LabelInitialGap) + return false; + if (Style->LabelGap != this->LabelGap) + return false; + if (Style->LabelIsAligned != this->LabelIsAligned) + return false; + if (Style->LabelGeneralizeLine != this->LabelGeneralizeLine) + return false; + return true; +} + +void QuickStyleObj::SetLabelColumn(const char *x) +{ +// +// setting the Label Column +// + int len; + if (LabelColumn != NULL) + free(LabelColumn); + LabelColumn = NULL; + if (x == NULL) + return; + len = strlen(x); + LabelColumn = (char *) malloc(len + 1); + strcpy(LabelColumn, x); +} + +void QuickStyleObj::SetFontFacename(const char *x) +{ +// +// setting the Font Facename +// + int len; + if (FontFacename != NULL) + free(FontFacename); + FontFacename = NULL; + if (x == NULL) + return; + len = strlen(x); + FontFacename = (char *) malloc(len + 1); + strcpy(FontFacename, x); +} + +void QuickStyleObj::UpdateXmlStyle() +{ +// +// updating the XML Style +// + if (XmlStyle != NULL) + sqlite3_free(XmlStyle); + XmlStyle = CreateXmlStyle(); +} + +char *QuickStyleObj::CreateXmlStyle() +{ +// +// creating the XML Style +// + char *xml; + if ((MinScaleEnabled == true || MaxScaleEnabled == true) || LabelPrint == true + || Type == QUICK_STYLE_GEOMETRY) + xml = DoCreateFeatureTypeXML(); + else + xml = DoCreateSymbolizerXML(false); + return xml; + +} + +char *QuickStyleObj::DoCreateFeatureTypeXML() +{ +// +// creating a FeatureType XML Style +// + char *prev; + char *xml2; + char *xml = sqlite3_mprintf("\r\n"); + prev = xml; + xml = sqlite3_mprintf("%s\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t%s\r\n", prev, "Quick Style"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (MinScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMin); + sqlite3_free(prev); + prev = xml; + } + if (MaxScaleEnabled == true) + { + xml = + sqlite3_mprintf + ("%s\t\t%1.2f\r\n", prev, + ScaleMax); + sqlite3_free(prev); + prev = xml; + } + xml2 = NULL; + if (Type == QUICK_STYLE_POINT) + xml2 = DoCreatePointSymbolizerXML(true); + if (Type == QUICK_STYLE_LINE) + xml2 = DoCreateLineSymbolizerXML(true); + if (Type == QUICK_STYLE_POLYGON) + xml2 = DoCreatePolygonSymbolizerXML(true); + else + { + // mixed-type Symbolizers + xml2 = DoCreatePointSymbolizerXML(true); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + xml2 = DoCreateLineSymbolizerXML(true); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + xml2 = DoCreatePolygonSymbolizerXML(true); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + xml2 = NULL; + prev = xml; + } + } + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + if (LabelPrint == true) + { + // adding a Text Symbolizer + xml2 = NULL; + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) + xml2 = DoCreateTextPointSymbolizerXML(); + if (Type == QUICK_STYLE_LINE) + xml2 = DoCreateTextLineSymbolizerXML(); + if (xml2 != NULL) + { + xml = sqlite3_mprintf("%s%s", prev, xml2); + sqlite3_free(prev); + sqlite3_free(xml2); + prev = xml; + } + } + xml = sqlite3_mprintf("%s\t\r\n\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleObj::DoCreateSymbolizerXML(bool subordered) +{ +// +// creating a Symbolizer XML Style +// + if (Type == QUICK_STYLE_POINT) + return DoCreatePointSymbolizerXML(subordered); + if (Type == QUICK_STYLE_LINE) + return DoCreateLineSymbolizerXML(subordered); + if (Type == QUICK_STYLE_POLYGON) + return DoCreatePolygonSymbolizerXML(subordered); + return NULL; +} + +char *QuickStyleObj::DoCreatePointSymbolizerXML(bool subordered) +{ +// +// creating a Point Symbolizer XML Style +// + const char *cstr; + char *prev; + const char *extra = ""; + char *xml = sqlite3_mprintf("\r\n"); + if (subordered == true) + { + extra = "\t\t"; + sqlite3_free(xml); + prev = (char *) ""; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + } else + { + prev = xml; + xml = sqlite3_mprintf("%s\r\n", + prev, cstr); + sqlite3_free(prev); + } + prev = xml; + if (subordered != true) + { + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Quick Style - PointSymbolizer"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// mark symbol + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + switch (SymbolWellKnownMark) + { + case RL2_GRAPHIC_MARK_CIRCLE: + cstr = "circle"; + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + cstr = "triangle"; + break; + case RL2_GRAPHIC_MARK_STAR: + cstr = "star"; + break; + case RL2_GRAPHIC_MARK_CROSS: + cstr = "cross"; + break; + case RL2_GRAPHIC_MARK_X: + cstr = "x"; + break; + default: + cstr = "square"; + break; + }; + xml = + sqlite3_mprintf("%s%s\t\t\t%s\r\n", prev, + extra, cstr); + sqlite3_free(prev); + prev = xml; +// Mark Fill + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, SymbolFillColor); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// Mark Stroke + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%s\r\n", + prev, extra, SymbolStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\t%1.2f\r\n", + prev, extra, 1.0); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (SymbolOpacity != 1.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + SymbolOpacity); + sqlite3_free(prev); + prev = xml; + } + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, SymbolSize); + sqlite3_free(prev); + prev = xml; + if (SymbolRotation != 0.0) + { + xml = + sqlite3_mprintf("%s%s\t\t%1.2f\r\n", prev, extra, + SymbolRotation); + sqlite3_free(prev); + prev = xml; + } + if (SymbolAnchorX != 0.5 || SymbolAnchorY != 0.5) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, SymbolAnchorX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, SymbolAnchorY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (SymbolDisplacementX != 0.0 || SymbolDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, SymbolDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t\t%1.4f\r\n", + prev, extra, SymbolDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleObj::DoCreateLineSymbolizerXML(bool subordered) +{ +// +// creating a Line Symbolizer XML Style +// + const char *cstr; + char *prev; + const char *extra = ""; + char *xml = sqlite3_mprintf("\r\n"); + prev = xml; + if (subordered == true) + { + extra = "\t\t"; + sqlite3_free(xml); + prev = (char *) ""; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + } else + { + xml = sqlite3_mprintf("%s\r\n", + prev, cstr); + sqlite3_free(prev); + } + prev = xml; + if (subordered != true) + { + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Quick Style - LineSymbolizer"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; +// using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, extra, + LineStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, LineOpacity); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, LineStrokeWidth); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + const char *dashArray; + switch (LineDotStyle) + { + case QUICK_STYLE_DOT_LINE: + dashArray = "5.0, 10.0"; + break; + case QUICK_STYLE_DASH_LINE: + dashArray = "20.0, 20.0"; + break; + case QUICK_STYLE_DASH_DOT_LINE: + dashArray = "20.0, 10.0, 5.0, 10.0"; + break; + default: + dashArray = NULL; + break; + }; + if (dashArray != NULL) + { + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", + prev, extra, dashArray); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + if (LinePerpendicularOffset != 0.0) + { + xml = + sqlite3_mprintf + ("%s%s\t%1.2f\r\n", prev, + extra, LinePerpendicularOffset); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleObj::DoCreatePolygonSymbolizerXML(bool subordered) +{ +// +// creating a Polygon Symbolizer XML Style +// + const char *cstr; + char *prev; + const char *extra = ""; + char *xml = sqlite3_mprintf("\r\n"); + prev = xml; + if (subordered == true) + { + extra = "\t\t"; + sqlite3_free(xml); + prev = (char *) ""; + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + } else + { + xml = sqlite3_mprintf("%s\r\n", + prev, cstr); + sqlite3_free(prev); + } + prev = xml; + if (subordered != true) + { + xml = sqlite3_mprintf("%s\t%s\r\n", prev, UUID); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Quick Style - Polygon Symbolizer"); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t%s\r\n", prev, + "Created by SpatialiteGUI"); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (PolygonFill == true) + { + // Polygon Fill + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + // using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, + extra, PolygonFillColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, PolygonFillOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (PolygonStroke == true) + { + // Polygon Stroke + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + // using a Solid Color + xml = + sqlite3_mprintf + ("%s%s\t\t%s\r\n", prev, + extra, PolygonStrokeColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, PolygonStrokeOpacity); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\t%1.2f\r\n", + prev, extra, PolygonStrokeWidth); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s%s\t\tround\r\n", + prev, extra); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (PolygonDisplacementX != 0.0 || PolygonDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t%1.4f\r\n", + prev, extra, PolygonDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s%s\t\t%1.4f\r\n", + prev, extra, PolygonDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\r\n", prev, extra); + sqlite3_free(prev); + prev = xml; + } + if (PolygonPerpendicularOffset != 0.0) + { + xml = + sqlite3_mprintf + ("%s%s\t%1.4f\r\n", prev, + extra, PolygonPerpendicularOffset); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s%s\r\n", prev, extra); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleObj::DoCreateTextPointSymbolizerXML() +{ +// +// creating a Text Symbolizer (Point Placement) +// + char *xml; + char *prev; + xml = sqlite3_mprintf("\t\t\r\n"); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev, LabelColumn); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + const char *font; + if (strcmp(FontFacename, "ToyFont: serif") == 0) + font = "serif"; + else if (strcmp(FontFacename, "ToyFont: sans-serif") == 0) + font = "sans serif"; + else if (strcmp(FontFacename, "ToyFont: monospace") == 0) + font = "monospace"; + else + font = FontFacename; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%s\r\n", prev, + font); + sqlite3_free(prev); + prev = xml; + if (FontStyle == RL2_FONTSTYLE_ITALIC) + xml = + sqlite3_mprintf + ("%s\t\t\t\titalic\r\n", + prev); + else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) + xml = + sqlite3_mprintf + ("%s\t\t\t\toblique\r\n", + prev); + else + xml = + sqlite3_mprintf + ("%s\t\t\t\tnormal\r\n", + prev); + sqlite3_free(prev); + prev = xml; + if (FontWeight == RL2_FONTWEIGHT_BOLD) + xml = + sqlite3_mprintf + ("%s\t\t\t\tbold\r\n", + prev); + else + xml = + sqlite3_mprintf + ("%s\t\t\t\tnormal\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%1.2f\r\n", + prev, FontSize); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\n", prev); + sqlite3_free(prev); + prev = xml; +// PointPlacement + xml = sqlite3_mprintf("%s\t\t\t\t\n", prev); + sqlite3_free(prev); + prev = xml; + if (LabelAnchorX != 0.5 || LabelAnchorY != 0.5) + { + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t\t%1.4f\r\n", prev, + LabelAnchorX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t\t%1.4f\r\n", prev, + LabelAnchorY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (LabelDisplacementX != 0.0 || LabelDisplacementY != 0.0) + { + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t\t%1.4f\r\n", prev, + LabelDisplacementX); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t\t%1.4f\r\n", prev, + LabelDisplacementY); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (LabelRotation != 0.0) + { + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%1.2f\r\n", prev, LabelRotation); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (HasHalo == true) + { + // Halo + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", prev, + HaloRadius); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%s\r\n", + prev, HaloColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%1.2f\r\n", + prev, HaloOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%s\r\n", prev, + FontColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%1.2f\r\n", + prev, FontOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +char *QuickStyleObj::DoCreateTextLineSymbolizerXML() +{ +// +// creating a Text Symbolizer (Line Placement) +// + char *xml; + char *prev; + xml = sqlite3_mprintf("\t\t\r\n"); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev, LabelColumn); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + const char *font; + if (strcmp(FontFacename, "ToyFont: serif") == 0) + font = "serif"; + else if (strcmp(FontFacename, "ToyFont: sans-serif") == 0) + font = "sans serif"; + else if (strcmp(FontFacename, "ToyFont: monospace") == 0) + font = "monospace"; + else + font = FontFacename; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%s\r\n", prev, + font); + sqlite3_free(prev); + prev = xml; + if (FontStyle == RL2_FONTSTYLE_ITALIC) + xml = + sqlite3_mprintf + ("%s\t\t\t\titalic\r\n", + prev); + else if (FontStyle == RL2_FONTSTYLE_OBLIQUE) + xml = + sqlite3_mprintf + ("%s\t\t\t\toblique\r\n", + prev); + else + xml = + sqlite3_mprintf + ("%s\t\t\t\tnormal\r\n", + prev); + sqlite3_free(prev); + prev = xml; + if (FontWeight == RL2_FONTWEIGHT_BOLD) + xml = + sqlite3_mprintf + ("%s\t\t\t\tbold\r\n", + prev); + else + xml = + sqlite3_mprintf + ("%s\t\t\t\tnormal\r\n", + prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%1.2f\r\n", + prev, FontSize); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\n", prev); + sqlite3_free(prev); + prev = xml; +// LinePlacement + xml = sqlite3_mprintf("%s\t\t\t\t\n", prev); + sqlite3_free(prev); + prev = xml; + if (LabelPerpendicularOffset != 0.0) + { + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%1.4f\r\n", + prev, LabelPerpendicularOffset); + sqlite3_free(prev); + prev = xml; + } + if (RepeatedLabel == true) + { + // Repeated: InitialGap and Gap + xml = + sqlite3_mprintf("%s\t\t\t\t\ttrue\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%1.4f\r\n", prev, + LabelInitialGap); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\t%1.4f\r\n", prev, LabelGap); + sqlite3_free(prev); + prev = xml; + } + if (LabelIsAligned == true) + { + xml = + sqlite3_mprintf("%s\t\t\t\t\ttrue\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + if (LabelGeneralizeLine == true) + { + xml = + sqlite3_mprintf + ("%s\t\t\t\t\ttrue\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + if (HasHalo == true) + { + // Halo + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf("%s\t\t\t\t%1.2f\r\n", prev, + HaloRadius); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%s\r\n", + prev, HaloColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t\t%1.2f\r\n", + prev, HaloOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + } + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%s\r\n", prev, + FontColor); + sqlite3_free(prev); + prev = xml; + xml = + sqlite3_mprintf + ("%s\t\t\t\t%1.2f\r\n", + prev, FontOpacity); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); + sqlite3_free(prev); + prev = xml; + xml = sqlite3_mprintf("%s\t\t\r\n", prev); + sqlite3_free(prev); + return xml; +} + +const unsigned char *QuickStyleObj::CloneXmlStyle() +{ +// +// cloning the XML Style definition +// + if (XmlStyle == NULL) + XmlStyle = CreateXmlStyle(); + if (XmlStyle == NULL) + return NULL; + int len = strlen(XmlStyle); + char *cloned = (char *) malloc(len + 1); + strcpy(cloned, XmlStyle); + return (const unsigned char *) cloned; +} + +void QuickStyleObj::DoGetUUID(char *uuid) +{ +// +// creating an UUID value +// + unsigned char rnd[16]; + char *p = uuid; + int i; + sqlite3_randomness(16, rnd); + for (i = 0; i < 16; i++) + { + if (i == 4 || i == 6 || i == 8 || i == 10) + *p++ = '-'; + sprintf(p, "%02x", rnd[i]); + p += 2; + } + *p = '\0'; + uuid[14] = '4'; + uuid[19] = '8'; +} + +int QuickStyleObj::RandomWellKnownMark() +{ +// +// returning a random Symbol Well Known Mark +// + int wkt; + int mod = rand() % 6; + switch (mod) + { + case 0: + wkt = RL2_GRAPHIC_MARK_SQUARE; + break; + case 1: + wkt = RL2_GRAPHIC_MARK_CIRCLE; + break; + case 2: + wkt = RL2_GRAPHIC_MARK_TRIANGLE; + break; + case 3: + wkt = RL2_GRAPHIC_MARK_STAR; + break; + case 4: + wkt = RL2_GRAPHIC_MARK_CROSS; + break; + default: + wkt = RL2_GRAPHIC_MARK_X; + break; + }; + return wkt; +} + +void QuickStyleObj::RandomColor(char *color) +{ +// +// setting a random Color +// + unsigned char red = rand() % 256; + unsigned char green = rand() % 256; + unsigned char blue = rand() % 256; + sprintf(color, "#%02x%02x%02x", red, green, blue); +} + +bool QuickStyleVectorDialog::Create(MyMapPanel * parent, MapLayer * layer, + int type) +{ +// +// creating the dialog +// + MainFrame = parent->GetParent(); + MapPanel = parent; + Layer = layer; + Type = type; + DbPrefix = layer->GetDbPrefix(); + LayerName = layer->GetName(); + IsConfigChanged = false; + + if (wxPropertySheetDialog::Create + (parent, wxID_ANY, wxT("QuickStyle (Vector) Edit")) == false) + return false; + if (Layer->GetQuickStyle() != NULL) + Style = Layer->CloneQuickStyle(); + else + Style = new QuickStyleObj(Type); + + wxBookCtrlBase *book = GetBookCtrl(); +// creates individual panels + int next = 1; + PagePointIndex = 0; + PageLineIndex = 0; + PagePolygonIndex = 0; + PageTextPointIndex = 0; + PageTextLineIndex = 0; + wxPanel *mainPage = CreateMainPage(book); + book->AddPage(mainPage, wxT("General"), true); + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_GEOMETRY) + { + wxPanel *pointPage = CreatePointPage(book); + book->AddPage(pointPage, wxT("Point Symbolizer"), false); + PagePointIndex = next++; + } + if (Type == QUICK_STYLE_LINE || Type == QUICK_STYLE_GEOMETRY) + { + wxPanel *linePage = CreateLinePage(book); + book->AddPage(linePage, wxT("Line Symbolyzer"), false); + PageLineIndex = next++; + } + if (Type == QUICK_STYLE_POLYGON || Type == QUICK_STYLE_GEOMETRY) + { + wxPanel *polygonPage = CreatePolygonPage(book); + book->AddPage(polygonPage, wxT("Polygon Symbolizer"), false); + PagePolygonIndex = next++; + } + if (Type == QUICK_STYLE_POINT || Type == QUICK_STYLE_POLYGON) + { + wxPanel *textPointPage = CreateTextPointPage(book); + book->AddPage(textPointPage, wxT("Text Symbolizer"), false); + PageTextPointIndex = next++; + } + if (Type == QUICK_STYLE_LINE) + { + wxPanel *textLinePage = CreateTextLinePage(book); + book->AddPage(textLinePage, wxT("Text Symbolizer"), false); + PageTextLineIndex = next++; + } + + CreateButtons(); + LayoutDialog(); +// appends event handler for TAB/PAGE changing + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanging); + Connect(wxID_ANY, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnPageChanged); +// appends event handler for buttons + Connect(wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnQuit); + Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnOk); + Connect(ID_QUICK_STYLE_APPLY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnApply); + Connect(ID_QUICK_STYLE_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnExport); + Connect(ID_QUICK_STYLE_COPY, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCopy); +// centers the dialog window + Centre(); + UpdateMainPage(); + return true; +} + +void QuickStyleVectorDialog::CreateButtons() +{ +// +// adding the common Buttons +// + wxBoxSizer *topSizer = (wxBoxSizer *) (this->GetSizer()); + wxBoxSizer *btnBox = new wxBoxSizer(wxHORIZONTAL); + topSizer->Add(btnBox, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *save = new wxButton(this, ID_QUICK_STYLE_APPLY, wxT("&Apply")); + btnBox->Add(save, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *exp = + new wxButton(this, ID_QUICK_STYLE_EXPORT, wxT("&Export to file")); + btnBox->Add(exp, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *copy = new wxButton(this, ID_QUICK_STYLE_COPY, wxT("&Copy")); + btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + btnBox->AddSpacer(100); + wxButton *ok = new wxButton(this, wxID_OK, wxT("&Ok")); + btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *cancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); + btnBox->Add(cancel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +} + +wxPanel *QuickStyleVectorDialog::CreateMainPage(wxWindow * parent) +{ +// +// creating the MAIN page +// + wxPanel *panel = new wxPanel(parent, ID_PANE_MAIN); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// First row: Layer name + boxSizer->AddSpacer(50); + wxBoxSizer *lyrBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(lyrBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *nameSizer = new wxBoxSizer(wxVERTICAL); + lyrBoxSizer->Add(nameSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *nameBox = new wxStaticBox(panel, wxID_ANY, + wxT("Layer FullName"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *nameBoxSizer = new wxStaticBoxSizer(nameBox, wxHORIZONTAL); + nameSizer->Add(nameBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString fullName = DbPrefix + wxT(".") + LayerName; + wxTextCtrl *nameCtrl = new wxTextCtrl(panel, ID_VECTOR_LAYER, fullName, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + nameBoxSizer->Add(nameCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *typeBox = new wxStaticBox(panel, wxID_ANY, + wxT("Geometry Type"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *typeBoxSizer = new wxStaticBoxSizer(typeBox, wxHORIZONTAL); + nameSizer->Add(typeBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString typeName = wxT("UNKNOWN"); + if (Type == QUICK_STYLE_POINT) + typeName = wxT("POINT-Type Geometries"); + if (Type == QUICK_STYLE_LINE) + typeName = wxT("LINE-Type Geometries"); + if (Type == QUICK_STYLE_POLYGON) + typeName = wxT("POLYGON-Type Geometries"); + if (Type == QUICK_STYLE_GEOMETRY) + typeName = wxT("MIXED-Type Geometries"); + wxTextCtrl *typeCtrl = new wxTextCtrl(panel, ID_VECTOR_TYPE, typeName, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + typeBoxSizer->Add(typeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *uuidBox = new wxStaticBox(panel, wxID_ANY, + wxT("QuickStyle Name"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *uuidBoxSizer = new wxStaticBoxSizer(uuidBox, wxHORIZONTAL); + nameSizer->Add(uuidBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxString uuid = wxString::FromUTF8(Style->GetUUID()); + wxTextCtrl *uuidCtrl = new wxTextCtrl(panel, ID_VECTOR_UUID, uuid, + wxDefaultPosition, wxSize(370, 22), + wxTE_READONLY); + uuidBoxSizer->Add(uuidCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + boxSizer->AddSpacer(25); +// second row: Visibility Range + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(miscSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxStaticBox *visibilityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Visibility Range"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *visibilitySizer = + new wxStaticBoxSizer(visibilityBox, wxHORIZONTAL); + visibilityBoxSizer->Add(visibilitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, + 5); + wxString range[4]; + range[0] = wxT("&None"); + range[1] = wxT("&Min"); + range[2] = wxT("&Max"); + range[3] = wxT("&Both"); + wxRadioBox *rangeBox = new wxRadioBox(panel, ID_SYMBOLIZER_MINMAX_SCALE, + wxT("&Range Type"), + wxDefaultPosition, + wxDefaultSize, 4, + range, 2, + wxRA_SPECIFY_COLS); + visibilitySizer->Add(rangeBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + rangeBox->SetSelection(0); + visibilitySizer->AddSpacer(20); + wxBoxSizer *scaleBoxSizer = new wxBoxSizer(wxVERTICAL); + visibilitySizer->Add(scaleBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMinSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMinSizer, 0, wxALIGN_RIGHT | wxALL, 5); + wxStaticText *minScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Min Scale:")); + scaleMinSizer->Add(minScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *minScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MIN_SCALE, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + minScaleCtrl->Enable(false); + scaleMinSizer->Add(minScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *scaleMaxSizer = new wxBoxSizer(wxHORIZONTAL); + scaleBoxSizer->Add(scaleMaxSizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxStaticText *maxScaleLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Max Scale:")); + scaleMaxSizer->Add(maxScaleLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *maxScaleCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_MAX_SCALE, wxT("+Infinite"), + wxDefaultPosition, wxSize(100, 22)); + maxScaleCtrl->Enable(false); + scaleMaxSizer->Add(maxScaleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_MINMAX_SCALE, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdScaleChanged); + return panel; +} + +void QuickStyleVectorDialog:: +OnCmdScaleChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Visibility Range selection changed +// + wxRadioBox *scaleModeCtrl = + (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + switch (scaleModeCtrl->GetSelection()) + { + case 0: + Style->EnableMinScale(false); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 1: + Style->EnableMinScale(true); + Style->EnableMaxScale(false); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("+Infinite")); + maxCtrl->Enable(false); + break; + case 2: + Style->EnableMinScale(false); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("0.0")); + minCtrl->Enable(false); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + case 3: + Style->EnableMinScale(true); + Style->EnableMaxScale(true); + minCtrl->SetValue(wxT("")); + minCtrl->Enable(true); + maxCtrl->SetValue(wxT("")); + maxCtrl->Enable(true); + break; + }; +} + +wxPanel *QuickStyleVectorDialog::CreatePointPage(wxWindow * parent) +{ +// +// creating the Point Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_POINT); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: Opacity + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Well Known Mark Name + wxBoxSizer *box1Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box1Sizer, 0, wxALIGN_CENTER | wxALL, 5); + wxBoxSizer *markSizer = new wxBoxSizer(wxHORIZONTAL); + box1Sizer->Add(markSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString mark[6]; + mark[0] = wxT("&Square"); + mark[1] = wxT("&Circle"); + mark[2] = wxT("&Triangle"); + mark[3] = wxT("&Star"); + mark[4] = wxT("&Cross"); + mark[5] = wxT("&X"); + wxRadioBox *markBox = new wxRadioBox(panel, ID_SYMBOLIZER_MARK, + wxT("&Mark"), + wxDefaultPosition, + wxDefaultSize, 6, + mark, 1, + wxRA_SPECIFY_COLS); + markSizer->Add(markBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + markBox->SetSelection(0); +// second row: Size and Rotation + wxBoxSizer *box2Sizer = new wxBoxSizer(wxVERTICAL); + box1Sizer->Add(box2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *sizeBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(sizeBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row A: Size + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); + sizeBoxSizer->Add(sizeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *size1Sizer = new wxBoxSizer(wxHORIZONTAL); + sizeSizer->Add(size1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *sizeCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_SIZE, wxT("16.0"), + wxDefaultPosition, wxSize(100, 22)); + size1Sizer->Add(sizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Rotation + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Rotation"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); + sizeBoxSizer->Add(rotSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *rotCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_ROTATION, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row: AnchorPoint and Displacement + wxBoxSizer *anchorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + box2Sizer->Add(anchorBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// third row A: Anchor Point + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Anchor Point"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); + anchorBoxSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_X, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_ANCHOR_Y, wxT("0.5"), + wxDefaultPosition, wxSize(100, 22)); + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Displacement + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + anchorBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 20); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// fourth row: colors + wxBoxSizer *box3Sizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(box3Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// first row A: Fill Color + wxBoxSizer *fillBoxSizer = new wxBoxSizer(wxVERTICAL); + box3Sizer->Add(fillBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorFillBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorFillSizer = new wxStaticBoxSizer(colorFillBox, wxVERTICAL); + box3Sizer->Add(colorFillSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *fill1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorFillSizer->Add(fill1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *fillColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + fill1Sizer->Add(fillColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFillCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + fill1Sizer->Add(sampleFillCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickFill = + new wxButton(panel, ID_SYMBOLIZER_FILL_PICKER_BTN, wxT("&Pick a color")); + fill1Sizer->Add(pickFill, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + box3Sizer->AddSpacer(30); + wxStaticBox *colorStrokeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorStrokeSizer = + new wxStaticBoxSizer(colorStrokeBox, wxVERTICAL); + box3Sizer->Add(colorStrokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *stroke1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorStrokeSizer->Add(stroke1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxTextCtrl *strokeColorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + stroke1Sizer->Add(strokeColorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sampleStrokeCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + stroke1Sizer->Add(sampleStrokeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxButton *pickStroke = + new wxButton(panel, ID_SYMBOLIZER_STROKE_PICKER_BTN, wxT("&Pick a color")); + stroke1Sizer->Add(pickStroke, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_MARK, wxEVT_COMMAND_RADIOBOX_SELECTED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdMarkChanged); + Connect(ID_SYMBOLIZER_FILL_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPointColorFillPicker); + Connect(ID_SYMBOLIZER_FILL_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPointColorFillChanged); + Connect(ID_SYMBOLIZER_STROKE_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPointColorStrokePicker); + Connect(ID_SYMBOLIZER_STROKE_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPointColorStrokeChanged); + return panel; +} + +void QuickStyleVectorDialog::OnCmdMarkChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Mark selection changed +// + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); + switch (markCtrl->GetSelection()) + { + case 1: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CIRCLE); + break; + case 2: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_TRIANGLE); + break; + case 3: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_STAR); + break; + case 4: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_CROSS); + break; + case 5: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_X); + break; + default: + Style->SetSymbolWellKnownMark(RL2_GRAPHIC_MARK_SQUARE); + break; + }; +} + +void QuickStyleVectorDialog:: +OnCmdPointColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdPointColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdPointColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdPointColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleVectorDialog::CreateLinePage(wxWindow * parent) +{ +// +// creating the Line Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxPanel *panel = new wxPanel(parent, ID_PANE_LINE); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row A: the Stroke #1 Opacity and Perpendicular Offset + boxSizer->AddSpacer(50); + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxVERTICAL); + boxSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxHORIZONTAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_STROKE1_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(600, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// first row B: PerpendicularOffset + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); + opacityBoxSizer->Add(perpendicularBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Perpendicular Offset"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *perpendicularSizer = + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); + perpendicularBoxSizer->Add(perpendicularSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *perpendicularCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_PERPENDICULAR, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Draw lines in parallel to the original geometry.")); + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Positive to the left-hand side. Negative numbers mean right.")); + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row: Stroke color or Graphic + wxBoxSizer *strokeSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(strokeSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row B: Stroke Color + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxHORIZONTAL); + strokeSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *colorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE1_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick = + new wxButton(panel, ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxT("&Pick a color")); + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row: Stroke-Width + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + colorBoxSizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row A: StrokeWidth + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Width"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *widthCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE1_WIDTH, wxT("1.0"), + wxDefaultPosition, wxSize(100, 22)); + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row D: DashArray and DashOffset + wxBoxSizer *dashBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(dashBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxString dot[4]; + dot[0] = wxT("&Solid Line"); + dot[1] = wxT("&Dotted Line"); + dot[2] = wxT("&Dashed Line"); + dot[3] = wxT("&Dashed/Dotted Line"); + wxRadioBox *dotBox = new wxRadioBox(panel, ID_SYMBOLIZER_DASH_DOT, + wxT("&Dash/Dot Style"), + wxDefaultPosition, + wxDefaultSize, 4, + dot, 1, + wxRA_SPECIFY_COLS); + dotBox->SetSelection(0); + dashBoxSizer->Add(dotBox, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_STROKE1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdLineColorChanged); + Connect(ID_SYMBOLIZER_STROKE1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdLineColorPicker); + return panel; +} + +void QuickStyleVectorDialog:: +OnCmdLineColorChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdLineColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +wxPanel *QuickStyleVectorDialog::CreatePolygonPage(wxWindow * parent) +{ +// +// creating the Polygon Symbolizer page +// + wxString StrokeColor = wxT("#000000"); + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_FILL2); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// first row: the Polygon Displacement and Perpendicular Offset + wxBoxSizer *polygonBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(polygonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// first row A: Displacement + wxBoxSizer *displacementBoxSizer = new wxBoxSizer(wxHORIZONTAL); + polygonBoxSizer->Add(displacementBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + displacementBoxSizer->Add(displacementSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// first row B: PerpendicularOffset + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); + polygonBoxSizer->Add(perpendicularBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Perpendicular Offset"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *perpendicularSizer = + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); + perpendicularBoxSizer->Add(perpendicularSizer, 0, + wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *perpendicularCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_POLYGON1_PERPENDICULAR, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Positive: larger. / Negative: smaller.")); + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Drawing polygons smaller or larger than their actual geometry (Buffer).")); + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row: Fill Opacity + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Polygon Fill"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxHORIZONTAL); + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(enableSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_FILL2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableCtrl->SetValue(Style->IsPolygonFill()); + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *opacityBoxSizer = new wxBoxSizer(wxHORIZONTAL); + enableSizer->Add(opacityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *opacityBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacitySizer = new wxStaticBoxSizer(opacityBox, wxVERTICAL); + opacityBoxSizer->Add(opacitySizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacityCtrl = + new wxSlider(panel, ID_SYMBOLIZER_FILL2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(400, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityCtrl->Enable(Style->IsPolygonFill()); + opacitySizer->Add(opacityCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// third row B: Fill Color + wxBoxSizer *colorBoxSizer = new wxBoxSizer(wxVERTICAL); + auxSizer->Add(colorBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *colorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Fill Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *colorSizer = new wxStaticBoxSizer(colorBox, wxVERTICAL); + colorBoxSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *color1Sizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(color1Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *colorCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FILL2_COLOR, FillColor, + wxDefaultPosition, wxSize(80, 22)); + color1Sizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FILL2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + sampleCtrl->Enable(Style->IsPolygonFill()); + color1Sizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); + colorSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick = + new wxButton(panel, ID_SYMBOLIZER_FILL2_PICKER_BTN, wxT("&Pick a color")); + pick->Enable(Style->IsPolygonFill()); + pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// first row A: the Stroke #1 Opacity + wxBoxSizer *opacity2BoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(opacity2BoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxStaticBox *enableBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Polygon Stroke"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *enable2Sizer = new wxStaticBoxSizer(enableBox, wxHORIZONTAL); + opacity2BoxSizer->Add(enable2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxCheckBox *enable2Ctrl = new wxCheckBox(panel, ID_SYMBOLIZER_STROKE2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enable2Ctrl->SetValue(Style->IsPolygonStroke()); + enable2Sizer->Add(enable2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *opacity2Box = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacity2Sizer = new wxStaticBoxSizer(opacity2Box, wxVERTICAL); + enable2Sizer->Add(opacity2Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacity2Ctrl = + new wxSlider(panel, ID_SYMBOLIZER_STROKE2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(250, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacity2Ctrl->Enable(Style->IsPolygonStroke()); + opacity2Sizer->Add(opacity2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row B: Stroke Color + wxStaticBox *color2Box = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *color2Sizer = new wxStaticBoxSizer(color2Box, wxVERTICAL); + enable2Sizer->Add(color2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *color3Sizer = new wxBoxSizer(wxHORIZONTAL); + color2Sizer->Add(color3Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *color2Ctrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_COLOR, StrokeColor, + wxDefaultPosition, wxSize(80, 22)); + color2Ctrl->Enable(Style->IsPolygonStroke()); + color3Sizer->Add(color2Ctrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBitmap *sample2Ctrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_STROKE2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + sample2Ctrl->Enable(Style->IsPolygonStroke()); + color3Sizer->Add(sample2Ctrl, 0, wxALIGN_RIGHT | wxALL, 5); + wxBoxSizer *picker2Sizer = new wxBoxSizer(wxHORIZONTAL); + color2Sizer->Add(picker2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxButton *pick2 = + new wxButton(panel, ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxT("&Pick a color")); + pick2->Enable(Style->IsPolygonStroke()); + picker2Sizer->Add(pick2, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row: Stroke-Width, + wxBoxSizer *miscSizer = new wxBoxSizer(wxHORIZONTAL); + enable2Sizer->Add(miscSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// third row A: StrokeWidth + wxBoxSizer *widthBoxSizer = new wxBoxSizer(wxHORIZONTAL); + miscSizer->Add(widthBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *widthBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Stroke Width"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *widthSizer = new wxStaticBoxSizer(widthBox, wxVERTICAL); + widthBoxSizer->Add(widthSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *widthCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_STROKE2_WIDTH, wxT("1.0"), + wxDefaultPosition, wxSize(100, 22)); + widthCtrl->Enable(false); + widthSizer->Add(widthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_STROKE2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonStrokeChanged); + Connect(ID_SYMBOLIZER_FILL2_ENABLE, wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonFillChanged); + Connect(ID_SYMBOLIZER_FILL2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonColorFillChanged); + Connect(ID_SYMBOLIZER_FILL2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonColorFillPicker); + Connect(ID_SYMBOLIZER_STROKE2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonColorStrokeChanged); + Connect(ID_SYMBOLIZER_STROKE2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdPolygonColorStrokePicker); + return panel; +} + +void QuickStyleVectorDialog:: +OnCmdPolygonStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->SetPolygonStroke(true); + else + Style->SetPolygonStroke(false); + RetrievePolygonPage(false); + UpdatePolygonPage(); +} + +void QuickStyleVectorDialog:: +OnCmdPolygonFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->SetPolygonFill(true); + else + Style->SetPolygonFill(false); + RetrievePolygonPage(false); + UpdatePolygonPage(); +} + +void QuickStyleVectorDialog:: +OnCmdPolygonColorFillChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Fill color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdPolygonColorFillPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdPolygonColorStrokeChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Stroke color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdPolygonColorStrokePicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +bool QuickStyleVectorDialog::DoCheckDatasource(const char *prefix, + const char *coverage, + char *table, char *geometry) +{ +// +// retrieving the real table and geometry column names +// + sqlite3 *sqlite = MainFrame->GetSqlite(); + char *sql; + int ret; + char **results; + int rows; + int columns; + int i; + char *qprefix; + bool ok = false; + + qprefix = gaiaDoubleQuotedSql(prefix); + sql = sqlite3_mprintf("SELECT f_table_name, f_geometry_column, view_name, " + "view_geometry, virt_name, virt_geometry " + "FROM \"%s\".vector_coverages WHERE coverage_name = %Q", + qprefix, coverage); + free(qprefix); + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return false; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *t = results[(i * columns) + 0]; + const char *g = results[(i * columns) + 1]; + if (t != NULL && g != NULL) + { + strcpy(table, t); + strcpy(geometry, g); + ok = true; + } + t = results[(i * columns) + 2]; + g = results[(i * columns) + 3]; + if (t != NULL && g != NULL) + { + strcpy(table, t); + strcpy(geometry, g); + ok = true; + } + t = results[(i * columns) + 4]; + g = results[(i * columns) + 5]; + if (t != NULL && g != NULL) + { + strcpy(table, t); + strcpy(geometry, g); + ok = true; + } + } + } + sqlite3_free_table(results); + return ok; +} + +void QuickStyleVectorDialog::InitializeComboColumns(wxComboBox * ctrl) +{ +// +// initializing a Column list ComboBox +// + sqlite3 *sqlite = MainFrame->GetSqlite(); + char *sql; + int ret; + char **results; + int rows; + int columns; + int i; + char prefix[1024]; + char coverage[1024]; + char table[1024]; + char geometry[1024]; + char *qprefix; + char *qtable; + + if (DbPrefix.Len() == 0) + strcpy(prefix, "MAIN"); + else + strcpy(prefix, DbPrefix.ToUTF8()); + strcpy(coverage, LayerName.ToUTF8()); + if (DoCheckDatasource(prefix, coverage, table, geometry) != true) + return; + + qprefix = gaiaDoubleQuotedSql(prefix); + qtable = gaiaDoubleQuotedSql(table); + sql = sqlite3_mprintf("PRAGMA \"%s\".table_info(\"%s\")", qprefix, qtable); + free(qprefix); + free(qtable); + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *value = results[(i * columns) + 1]; + if (strcasecmp(value, geometry) == 0) + continue; // skipping the Geometry column + wxString col = wxString::FromUTF8(value); + ctrl->Append(col); + } + } + sqlite3_free_table(results); +} + +void QuickStyleVectorDialog::InitializeComboFonts(wxComboBox * ctrl) +{ +// +// initializing a Font list ComboBox +// + sqlite3 *sqlite = MainFrame->GetSqlite(); + char *sql; + int ret; + char **results; + int rows; + int columns; + int i; + char prefix[1024]; + char *qprefix; + +// inserting the default TOY FONTS + wxString font = wxT("ToyFont: serif"); + ctrl->Append(font); + font = wxT("ToyFont: sans-serif"); + ctrl->Append(font); + font = wxT("ToyFont: monospace"); + ctrl->Append(font); + + if (DbPrefix.Len() == 0) + strcpy(prefix, "MAIN"); + else + strcpy(prefix, DbPrefix.ToUTF8()); + qprefix = gaiaDoubleQuotedSql(prefix); + sql = + sqlite3_mprintf + ("SELECT font_facename FROM \"%s\".SE_fonts ORDER BY font_facename", + qprefix); + free(qprefix); + ret = sqlite3_get_table(sqlite, sql, &results, &rows, &columns, NULL); + sqlite3_free(sql); + if (ret != SQLITE_OK) + return; + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + { + const char *value = results[(i * columns) + 0]; + wxString col = wxString::FromUTF8(value); + ctrl->Append(col); + } + } + sqlite3_free_table(results); +} + +wxPanel *QuickStyleVectorDialog::CreateTextPointPage(wxWindow * parent) +{ +// +// creating the Text Symbolizer page (Point Placement) +// + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// enable/disable Labels + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Labels"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableCtrl->SetValue(Style->IsLabelPrint()); + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + wxStaticText *columnLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); + enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxComboBox *columnList = + new wxComboBox(panel, ID_SYMBOLIZER_TEXT1_LABEL, wxT(""), wxDefaultPosition, + wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + InitializeComboColumns(columnList); + enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + + + wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); + auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Second row: Font Name, Size and Fill + wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); + font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); + fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Font Name + wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); + font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); + wxComboBox *fontList = + new wxComboBox(panel, ID_SYMBOLIZER_FONT1_NAME, wxT(""), wxDefaultPosition, + wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + InitializeComboFonts(fontList); + fontList->Select(0); + fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Font Size + wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); + fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxHORIZONTAL); + fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *sizeCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_SIZE, wxT("15.0"), + wxDefaultPosition, wxSize(100, 22)); + sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxVERTICAL); + fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Style"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxVERTICAL); + boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *italicSizer = new wxBoxSizer(wxVERTICAL); + boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); + wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_ITALIC, + wxT("Italic"), + wxDefaultPosition, wxDefaultSize); + italicCtrl->SetValue(false); + italicCtrl->Enable(false); + italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT1_BOLD, + wxT("Bold"), + wxDefaultPosition, wxDefaultSize); + boldCtrl->SetValue(false); + boldCtrl->Enable(false); + italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Font Opacity + wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacityFontSizer = + new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); + fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacityFontCtrl = + new wxSlider(panel, ID_SYMBOLIZER_FONT1_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(150, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Font color + wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxVERTICAL); + fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *font2Sizer = new wxBoxSizer(wxHORIZONTAL); + fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT1_COLOR, + FillColor, + wxDefaultPosition, wxSize(80, 22)); + font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFontCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT1_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + font2Sizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT1_PICKER_BTN, + wxT("&Pick a color")); + fontColorSizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); +// first row: PointPlacement + wxBoxSizer *pointBoxSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(pointBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *pointBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Label Point Placement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *pointSizer = new wxStaticBoxSizer(pointBox, wxHORIZONTAL); + pointBoxSizer->Add(pointSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// first row A: Anchor Point + wxStaticBox *anchorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Anchor Point"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *anchorSizer = new wxStaticBoxSizer(anchorBox, wxVERTICAL); + pointSizer->Add(anchorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *anchor1Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + anchor1Sizer->Add(anchor1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_X, wxT("0.5"), + wxDefaultPosition, wxSize(60, 22)); + anchor1Sizer->Add(anchorXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *anchor2Sizer = new wxBoxSizer(wxHORIZONTAL); + anchorSizer->Add(anchor2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *anchor2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + anchor2Sizer->Add(anchor2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *anchorYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ANCHOR_Y, wxT("0.5"), + wxDefaultPosition, wxSize(60, 22)); + anchor2Sizer->Add(anchorYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// first row B: Displacement + wxStaticBox *displacementBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Displacement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *displacementSizer = + new wxStaticBoxSizer(displacementBox, wxVERTICAL); + pointSizer->Add(displacementSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *displ1Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ1Label = new wxStaticText(panel, wxID_STATIC, wxT("X")); + displ1Sizer->Add(displ1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementXCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_X, wxT("0.0"), + wxDefaultPosition, wxSize(60, 22)); + displ1Sizer->Add(displacementXCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *displ2Sizer = new wxBoxSizer(wxHORIZONTAL); + displacementSizer->Add(displ2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticText *displ2Label = new wxStaticText(panel, wxID_STATIC, wxT("Y")); + displ2Sizer->Add(displ2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *displacementYCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y, wxT("0.0"), + wxDefaultPosition, wxSize(60, 22)); + displ2Sizer->Add(displacementYCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// first row C: Rotation + wxStaticBox *rotBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Rotation"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *rotSizer = new wxStaticBoxSizer(rotBox, wxVERTICAL); + pointSizer->Add(rotSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *rot1Sizer = new wxBoxSizer(wxHORIZONTAL); + rotSizer->Add(rot1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *rotCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_ROTATION, wxT("0.0"), + wxDefaultPosition, wxSize(60, 22)); + rot1Sizer->Add(rotCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Font Halo + wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Halo"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); + pointBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBoxSizer *halo1Sizer = new wxBoxSizer(wxHORIZONTAL); + haloSizer->Add(halo1Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO1_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableHaloCtrl->SetValue(Style->IsHaloEnabled()); + enableHaloCtrl->Enable(false); + halo1Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Halo Radius + wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Radius"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); + halo1Sizer->Add(radiusSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *radiusCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_RADIUS, wxT("1.0"), + wxDefaultPosition, wxSize(50, 22)); + radiusCtrl->Enable(false); + radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Halo Opacity + wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacityHaloSizer = + new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); + halo1Sizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxSlider *opacityHaloCtrl = + new wxSlider(panel, ID_SYMBOLIZER_HALO1_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(75, 45), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + opacityHaloCtrl->Enable(false); +// Halo color + wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); + haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO1_COLOR, + FillColor, + wxDefaultPosition, wxSize(80, 22)); + haloColorSizer->Add(haloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + haloCtrl->Enable(false); + color = wxColour(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleHaloCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO1_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO1_PICKER_BTN, + wxT("&Pick a color")); + haloColorSizer->Add(pickHalo, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + pickHalo->Enable(false); + + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_TEXT1_ENABLE, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel1Changed); + Connect(ID_SYMBOLIZER_FONT1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdFont1ColorPicker); + Connect(ID_SYMBOLIZER_FONT1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdFont1ColorChanged); + Connect(ID_SYMBOLIZER_FONT1_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont1Changed); + Connect(ID_SYMBOLIZER_HALO1_ENABLE, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdHalo1EnableChanged); + Connect(ID_SYMBOLIZER_HALO1_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdColorHalo1Picker); + Connect(ID_SYMBOLIZER_HALO1_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdColorHalo1Changed); + return panel; +} + +void QuickStyleVectorDialog:: +OnCmdLabel1Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// Label enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); + if (enableCtrl->IsChecked() == true) + { + Style->SetLabelPrint(true); + Style->SetLabelLinePlacement(false); + } else + Style->SetLabelPrint(false); + RetrieveTextPointPage(false); + UpdateTextPointPage(); +} + +void QuickStyleVectorDialog::OnFont1Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// the Font is changed +// + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); + wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); + wxString font = fontList->GetValue(); + char facename[1024]; + strcpy(facename, font.ToUTF8()); + if (strncmp(facename, "ToyFont: ", 9) == 0) + { + boldCtrl->Enable(true); + italicCtrl->Enable(true); + } else + { + bool bold = false; + bool italic = false; + MainFrame->CheckTTFont(facename, &bold, &italic); + boldCtrl->SetValue(bold); + italicCtrl->SetValue(italic); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + } +} + +void QuickStyleVectorDialog:: +OnCmdFont1ColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdFont1ColorChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Font Color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdColorHalo1Picker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdColorHalo1Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// Halo Color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdHalo1EnableChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Graphic Halo enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->EnableHalo(true); + else + Style->EnableHalo(false); + RetrieveTextPointPage(false); + UpdateTextPointPage(); +} + +wxPanel *QuickStyleVectorDialog::CreateTextLinePage(wxWindow * parent) +{ +// +// creating the Text Symbolizer page (Line Placement) +// + wxString FillColor = wxT("#808080"); + wxPanel *panel = new wxPanel(parent, ID_PANE_TEXT1); + wxBoxSizer *topSizer = new wxBoxSizer(wxVERTICAL); + panel->SetSizer(topSizer); + wxBoxSizer *boxSizer = new wxBoxSizer(wxVERTICAL); + topSizer->Add(boxSizer, 0, wxALIGN_CENTER | wxALL, 5); +// enable/disable Labels + wxBoxSizer *auxBoxSizer = new wxBoxSizer(wxHORIZONTAL); + boxSizer->Add(auxBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *auxBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Labels"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *auxSizer = new wxStaticBoxSizer(auxBox, wxVERTICAL); + auxBoxSizer->Add(auxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *enableSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(enableSizer, 0, wxALIGN_LEFT | wxALL, 5); + wxCheckBox *enableCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableCtrl->SetValue(Style->IsLabelPrint()); + enableSizer->Add(enableCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + enableSizer->AddSpacer(20); + wxStaticText *columnLabel = + new wxStaticText(panel, wxID_STATIC, wxT("&Column:")); + enableSizer->Add(columnLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxComboBox *columnList = + new wxComboBox(panel, ID_SYMBOLIZER_TEXT2_LABEL, wxT(""), wxDefaultPosition, + wxSize(400, 22), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + InitializeComboColumns(columnList); + enableSizer->Add(columnList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + + + wxStaticBox *fontBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *font9Sizer = new wxStaticBoxSizer(fontBox, wxHORIZONTAL); + auxSizer->Add(font9Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Second row: Font Name, Size and Fill + wxBoxSizer *fontSizer = new wxBoxSizer(wxHORIZONTAL); + font9Sizer->Add(fontSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxBoxSizer *font0Sizer = new wxBoxSizer(wxHORIZONTAL); + fontSizer->Add(font0Sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Font Name + wxBoxSizer *fontXSizer = new wxBoxSizer(wxVERTICAL); + font0Sizer->Add(fontXSizer, 0, wxALIGN_LEFT | wxALL, 0); + wxComboBox *fontList = + new wxComboBox(panel, ID_SYMBOLIZER_FONT2_NAME, wxT(""), wxDefaultPosition, + wxSize(250, 21), 0, NULL, wxCB_DROPDOWN | wxCB_READONLY); + InitializeComboFonts(fontList); + fontList->Select(0); + fontXSizer->Add(fontList, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Font Size + wxBoxSizer *fontYSizer = new wxBoxSizer(wxHORIZONTAL); + fontXSizer->Add(fontYSizer, 0, wxALIGN_LEFT | wxALL, 0); + wxStaticBox *sizeBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Size"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *sizeSizer = new wxStaticBoxSizer(sizeBox, wxVERTICAL); + fontYSizer->Add(sizeSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxTextCtrl *sizeCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_SIZE, wxT("15.0"), + wxDefaultPosition, wxSize(100, 22)); + sizeSizer->Add(sizeCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *boldBoxSizer = new wxBoxSizer(wxHORIZONTAL); + fontYSizer->Add(boldBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *boldBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Style"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *boldSizer = new wxStaticBoxSizer(boldBox, wxHORIZONTAL); + boldBoxSizer->Add(boldSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxBoxSizer *italicSizer = new wxBoxSizer(wxHORIZONTAL); + boldSizer->Add(italicSizer, 0, wxALIGN_LEFT | wxALL, 5); + wxCheckBox *italicCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_ITALIC, + wxT("Italic"), + wxDefaultPosition, wxDefaultSize); + italicCtrl->SetValue(false); + italicCtrl->Enable(false); + italicSizer->Add(italicCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxCheckBox *boldCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_TEXT2_BOLD, + wxT("Bold"), + wxDefaultPosition, wxDefaultSize); + boldCtrl->SetValue(false); + boldCtrl->Enable(false); + italicSizer->Add(boldCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); +// Font Opacity + wxStaticBox *opacityFontBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacityFontSizer = + new wxStaticBoxSizer(opacityFontBox, wxVERTICAL); + fontSizer->Add(opacityFontSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxSlider *opacityFontCtrl = + new wxSlider(panel, ID_SYMBOLIZER_FONT2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(150, 35), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityFontSizer->Add(opacityFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Font color + wxStaticBox *fontColorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *fontColorSizer = new wxStaticBoxSizer(fontColorBox, wxHORIZONTAL); + fontSizer->Add(fontColorSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxBoxSizer *font2Sizer = new wxBoxSizer(wxVERTICAL); + fontColorSizer->Add(font2Sizer, 0, wxALIGN_RIGHT | wxALL, 0); + wxTextCtrl *fontCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_FONT2_COLOR, + FillColor, + wxDefaultPosition, wxSize(80, 22)); + font2Sizer->Add(fontCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleFontCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_FONT2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + fontColorSizer->Add(sampleFontCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxButton *pickFont = new wxButton(panel, ID_SYMBOLIZER_FONT2_PICKER_BTN, + wxT("&Pick a color")); + font2Sizer->Add(pickFont, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); +// second row: LinePlacement + wxBoxSizer *lineBoxSizer = new wxBoxSizer(wxHORIZONTAL); + auxSizer->Add(lineBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *lineBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Label Line Placement"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *lineSizer = new wxStaticBoxSizer(lineBox, wxVERTICAL); + lineBoxSizer->Add(lineSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row A: PerpendicularOffset + wxBoxSizer *perpendicularBoxSizer = new wxBoxSizer(wxHORIZONTAL); + lineSizer->Add(perpendicularBoxSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *perpendicularBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Perpendicular Offset"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *perpendicularSizer = + new wxStaticBoxSizer(perpendicularBox, wxVERTICAL); + perpendicularBoxSizer->Add(perpendicularSizer, 0, + wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *perp1Sizer = new wxBoxSizer(wxHORIZONTAL); + perpendicularSizer->Add(perp1Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *perpendicularCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_PERPENDICULAR, wxT("0.0"), + wxDefaultPosition, wxSize(100, 22)); + perp1Sizer->Add(perpendicularCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + perpendicularCtrl->Enable(false); + wxStaticText *perp1Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Draw lines in parallel to the original geometry.")); + perp1Sizer->Add(perp1Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxStaticText *perp2Label = new wxStaticText(panel, wxID_STATIC, + wxT + ("Positive to the left-hand side. Negative numbers mean right.")); + perpendicularSizer->Add(perp2Label, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); +// second row B: IsRepeated, InitialGap and Gap + wxBoxSizer *repeatedBoxSizer = new wxBoxSizer(wxHORIZONTAL); + lineSizer->Add(repeatedBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxStaticBox *repeatedBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Repeated Label"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *repeatedSizer = new wxStaticBoxSizer(repeatedBox, wxHORIZONTAL); + repeatedBoxSizer->Add(repeatedSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxCheckBox *isRepeatedCtrl = + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_REPEATED, + wxT("Repeated"), + wxDefaultPosition, wxDefaultSize); + isRepeatedCtrl->SetValue(false); + isRepeatedCtrl->Enable(false); + repeatedSizer->Add(isRepeatedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *inigapBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Initial Gap"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *inigapSizer = new wxStaticBoxSizer(inigapBox, wxVERTICAL); + repeatedSizer->Add(inigapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *inigapCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_INITIAL_GAP, wxT("0.0"), + wxDefaultPosition, wxSize(60, 22)); + inigapCtrl->Enable(false); + inigapSizer->Add(inigapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxStaticBox *gapBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Gap"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *gapSizer = new wxStaticBoxSizer(gapBox, wxVERTICAL); + repeatedSizer->Add(gapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxTextCtrl *gapCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_TEXT_GAP, wxT("0.0"), + wxDefaultPosition, wxSize(60, 22)); + gapCtrl->Enable(false); + gapSizer->Add(gapCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// second row C: IsAligned and Generalize + wxBoxSizer *optBoxSizer = new wxBoxSizer(wxHORIZONTAL); + repeatedBoxSizer->Add(optBoxSizer, 0, wxALIGN_LEFT | wxALL, 0); + wxStaticBox *optBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Options"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *optSizer = new wxStaticBoxSizer(optBox, wxVERTICAL); + optBoxSizer->Add(optSizer, 0, wxALIGN_LEFT | wxALL, 5); + wxCheckBox *isAlignedCtrl = + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_IS_ALIGNED, + wxT("Aligned"), + wxDefaultPosition, wxDefaultSize); + isAlignedCtrl->SetValue(false); + isAlignedCtrl->Enable(false); + optSizer->Add(isAlignedCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxCheckBox *generalizeCtrl = + new wxCheckBox(panel, ID_SYMBOLIZER_TEXT_GENERALIZE, + wxT("Generalize"), + wxDefaultPosition, wxDefaultSize); + generalizeCtrl->SetValue(false); + generalizeCtrl->Enable(false); + optSizer->Add(generalizeCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Halo + wxBoxSizer *haloBoxSizer = new wxBoxSizer(wxVERTICAL); + lineBoxSizer->Add(haloBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); + wxStaticBox *haloBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Font Halo"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *haloSizer = new wxStaticBoxSizer(haloBox, wxVERTICAL); + haloBoxSizer->Add(haloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + wxBoxSizer *halo0Sizer = new wxBoxSizer(wxHORIZONTAL); + haloSizer->Add(halo0Sizer, 0, wxALIGN_LEFT | wxALL, 0); + wxCheckBox *enableHaloCtrl = new wxCheckBox(panel, ID_SYMBOLIZER_HALO2_ENABLE, + wxT("Enable"), + wxDefaultPosition, wxDefaultSize); + enableHaloCtrl->SetValue(Style->IsHaloEnabled()); + enableHaloCtrl->Enable(false); + halo0Sizer->Add(enableHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); +// Halo Radius + wxStaticBox *radiusBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Radius"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *radiusSizer = new wxStaticBoxSizer(radiusBox, wxVERTICAL); + halo0Sizer->Add(radiusSizer, 0, wxALIGN_RIGHT | wxALL, 2); + wxTextCtrl *radiusCtrl = + new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_RADIUS, wxT("1.0"), + wxDefaultPosition, wxSize(50, 22)); + radiusCtrl->Enable(false); + radiusSizer->Add(radiusCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); +// Halo Opacity + wxStaticBox *opacityHaloBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Opacity"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *opacityHaloSizer = + new wxStaticBoxSizer(opacityHaloBox, wxVERTICAL); + haloSizer->Add(opacityHaloSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); + wxSlider *opacityHaloCtrl = + new wxSlider(panel, ID_SYMBOLIZER_HALO2_OPACITY, 100, 0, 100, + wxDefaultPosition, wxSize(130, 35), + wxSL_HORIZONTAL | wxSL_LABELS); + opacityHaloSizer->Add(opacityHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + opacityHaloCtrl->Enable(false); +// Halo color + wxStaticBox *haloColorBox = new wxStaticBox(panel, wxID_STATIC, + wxT("Color"), + wxDefaultPosition, + wxDefaultSize); + wxBoxSizer *haloColorSizer = new wxStaticBoxSizer(haloColorBox, wxHORIZONTAL); + haloSizer->Add(haloColorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); + wxBoxSizer *halo2Sizer = new wxBoxSizer(wxVERTICAL); + haloColorSizer->Add(halo2Sizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); + wxTextCtrl *haloCtrl = new wxTextCtrl(panel, ID_SYMBOLIZER_HALO2_COLOR, + FillColor, + wxDefaultPosition, wxSize(80, 22)); + halo2Sizer->Add(haloCtrl, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); + haloCtrl->Enable(false); + color = wxColour(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleHaloCtrl = + new wxStaticBitmap(panel, ID_SYMBOLIZER_HALO2_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + haloColorSizer->Add(sampleHaloCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + wxButton *pickHalo = new wxButton(panel, ID_SYMBOLIZER_HALO2_PICKER_BTN, + wxT("&Pick a color")); + halo2Sizer->Add(pickHalo, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); + pickHalo->Enable(false); + + panel->SetSizer(topSizer); + topSizer->Fit(panel); +// appends event handlers + Connect(ID_SYMBOLIZER_TEXT2_ENABLE, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnCmdLabel2Changed); + Connect(ID_SYMBOLIZER_FONT2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdFont2ColorPicker); + Connect(ID_SYMBOLIZER_FONT2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdFont2ColorChanged); + Connect(ID_SYMBOLIZER_TEXT_IS_REPEATED, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdIsRepeatedChanged); + Connect(ID_SYMBOLIZER_TEXT_IS_ALIGNED, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdIsAlignedChanged); + Connect(ID_SYMBOLIZER_TEXT_GENERALIZE, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdGeneralizeLineChanged); + Connect(ID_SYMBOLIZER_FONT2_NAME, wxEVT_COMMAND_COMBOBOX_SELECTED, + (wxObjectEventFunction) & QuickStyleVectorDialog::OnFont2Changed); + Connect(ID_SYMBOLIZER_HALO2_ENABLE, + wxEVT_COMMAND_CHECKBOX_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdHalo2EnableChanged); + Connect(ID_SYMBOLIZER_HALO2_PICKER_BTN, wxEVT_COMMAND_BUTTON_CLICKED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdColorHalo2Picker); + Connect(ID_SYMBOLIZER_HALO2_COLOR, wxEVT_COMMAND_TEXT_UPDATED, + (wxObjectEventFunction) & + QuickStyleVectorDialog::OnCmdColorHalo2Changed); + return panel; +} + +void QuickStyleVectorDialog:: +OnCmdLabel2Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// Label enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); + if (enableCtrl->IsChecked() == true) + { + Style->SetLabelPrint(true); + Style->SetLabelLinePlacement(true); + } else + Style->SetLabelPrint(false); + RetrieveTextLinePage(false); + UpdateTextLinePage(); +} + +void QuickStyleVectorDialog::OnFont2Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// the Font is changed +// + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); + wxComboBox *fontList = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); + wxString font = fontList->GetValue(); + char facename[1024]; + strcpy(facename, font.ToUTF8()); + if (strncmp(facename, "ToyFont: ", 9) == 0) + { + boldCtrl->Enable(true); + italicCtrl->Enable(true); + } else + { + bool bold = false; + bool italic = false; + MainFrame->CheckTTFont(facename, &bold, &italic); + boldCtrl->SetValue(bold); + italicCtrl->SetValue(italic); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + } +} + +void QuickStyleVectorDialog:: +OnCmdFont2ColorPicker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdFont2ColorChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Font Color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdIsRepeatedChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Label IsRepeated enable/disable +// + wxCheckBox *repeatedCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); + if (repeatedCtrl->IsChecked() == true) + Style->SetRepeatedLabel(true); + else + Style->SetRepeatedLabel(false); + RetrieveTextLinePage(false); + UpdateTextLinePage(); +} + +void QuickStyleVectorDialog:: +OnCmdIsAlignedChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Label IsAligned enable/disable +// + wxCheckBox *alignedCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); + if (alignedCtrl->IsChecked() == true) + Style->SetLabelIsAligned(true); + else + Style->SetLabelIsAligned(false); +} + +void QuickStyleVectorDialog:: +OnCmdGeneralizeLineChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Label GeneralizeLine enable/disable +// + wxCheckBox *generalizeCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); + if (generalizeCtrl->IsChecked() == true) + Style->SetLabelGeneralizeLine(true); + else + Style->SetLabelGeneralizeLine(false); +} + +void QuickStyleVectorDialog:: +OnCmdColorHalo2Picker(wxCommandEvent & WXUNUSED(event)) +{ +// +// color picker +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); + wxColour clr = wxNullColour; + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, clr); + wxColour color = wxGetColourFromUser(this, clr); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } +} + +void QuickStyleVectorDialog:: +OnCmdColorHalo2Changed(wxCommandEvent & WXUNUSED(event)) +{ +// +// Halo Color changed: updating the visual sample +// + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_HEX); + wxColour back = wxColour(255, 255, 255); + wxString str = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(str) == true) + ColorMapEntry::GetWxColor(str, back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); + sampleCtrl->Refresh(); + sampleCtrl->Update(); +} + +void QuickStyleVectorDialog:: +OnCmdHalo2EnableChanged(wxCommandEvent & WXUNUSED(event)) +{ +// +// Graphic Halo enable/disable +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); + if (enableCtrl->IsChecked() == true) + Style->EnableHalo(true); + else + Style->EnableHalo(false); + RetrieveTextLinePage(false); + UpdateTextLinePage(); +} + +bool QuickStyleVectorDialog::RetrieveMainPage() +{ +// +// retrieving params from the MAIN page +// + double min = Style->GetScaleMin(); + double max = Style->GetScaleMax(); + if (Style->IsMinScaleEnabled() == true) + { + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + wxString value = minCtrl->GetValue(); + if (value.ToDouble(&min) != true) + { + wxMessageBox(wxT + ("MIN_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (min < 0.0) + { + wxMessageBox(wxT + ("MIN_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMaxScaleEnabled() == true) + { + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + wxString value = maxCtrl->GetValue(); + if (value.ToDouble(&max) != true) + { + wxMessageBox(wxT + ("MAX_SCALE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + if (max < 0.0) + { + wxMessageBox(wxT + ("MAX_SCALE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsMinScaleEnabled() == true && Style->IsMaxScaleEnabled() == true) + { + if (min >= max) + { + wxMessageBox(wxT + ("MAX_SCALE is always expected to be greater than MIN_SCALE !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + Style->SetScaleMin(min); + Style->SetScaleMax(max); + return true; +} + +void QuickStyleVectorDialog::UpdateMainPage() +{ +// +// updating the MAIN page +// + wxRadioBox *rangeBox = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MINMAX_SCALE); + if (Style->IsMinScaleEnabled() != true && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(0); + else if (Style->IsMinScaleEnabled() == true + && Style->IsMaxScaleEnabled() != true) + rangeBox->SetSelection(1); + else if (Style->IsMinScaleEnabled() != true + && Style->IsMaxScaleEnabled() == true) + rangeBox->SetSelection(2); + else + rangeBox->SetSelection(3); + wxTextCtrl *minCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MIN_SCALE); + char dummy[64]; + wxString str; + if (Style->IsMinScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMin()); + str = wxString::FromUTF8(dummy); + minCtrl->SetValue(str); + minCtrl->Enable(true); + } else + { + str = wxT("0.0"); + minCtrl->SetValue(str); + minCtrl->Enable(false); + } + wxTextCtrl *maxCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_MAX_SCALE); + if (Style->IsMaxScaleEnabled() == true) + { + sprintf(dummy, "%1.2f", Style->GetScaleMax()); + str = wxString::FromUTF8(dummy); + maxCtrl->SetValue(str); + maxCtrl->Enable(true); + } else + { + str = wxT("+Infinite"); + maxCtrl->SetValue(str); + maxCtrl->Enable(false); + } +} + +bool QuickStyleVectorDialog::RetrievePointPage(bool check) +{ +// +// retrieving params from the Point Symbolizer page +// + double opacity; + double size; + double rotation; + double anchorPointX; + double anchorPointY; + double displacementX; + double displacementY; + char fillColor[8]; + char strokeColor[8]; + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&size) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (size < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("SIZE must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); + value = rotationCtrl->GetValue(); + if (value.ToDouble(&rotation) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ROTATION isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); + value = anchorXCtrl->GetValue(); + if (value.ToDouble(&anchorPointX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorPointX < 0.0 || anchorPointX > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); + value = anchorYCtrl->GetValue(); + if (value.ToDouble(&anchorPointY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorPointY < 0.0 || anchorPointY > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); + value = displXCtrl->GetValue(); + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); + color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + + Style->SetSymbolOpacity(opacity); + Style->SetSymbolSize(size); + Style->SetSymbolAnchorX(anchorPointX); + Style->SetSymbolAnchorY(anchorPointY); + Style->SetSymbolRotation(rotation); + Style->SetSymbolDisplacementX(displacementX); + Style->SetSymbolDisplacementY(displacementY); + Style->SetSymbolFillColor(fillColor); + Style->SetSymbolStrokeColor(strokeColor); + return true; +} + +void QuickStyleVectorDialog::UpdatePointPage() +{ +// +// updating the Point Symbolizer page +// + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_OPACITY); + opacityCtrl->SetValue(Style->GetSymbolOpacity() * 100.0); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetSymbolSize()); + wxString str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + wxTextCtrl *rotationCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ROTATION); + sprintf(dummy, "%1.2f", Style->GetSymbolRotation()); + str = wxString::FromUTF8(dummy); + rotationCtrl->SetValue(str); + wxTextCtrl *anchorXCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_X); + sprintf(dummy, "%1.2f", Style->GetSymbolAnchorX()); + str = wxString::FromUTF8(dummy); + anchorXCtrl->SetValue(str); + wxTextCtrl *anchorYCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_ANCHOR_Y); + sprintf(dummy, "%1.2f", Style->GetSymbolAnchorY()); + str = wxString::FromUTF8(dummy); + anchorYCtrl->SetValue(str); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_X); + sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementX()); + str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetSymbolDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxRadioBox *markCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_MARK); + switch (Style->GetSymbolWellKnownMark()) + { + case RL2_GRAPHIC_MARK_CIRCLE: + markCtrl->SetSelection(1); + break; + case RL2_GRAPHIC_MARK_TRIANGLE: + markCtrl->SetSelection(2); + break; + case RL2_GRAPHIC_MARK_STAR: + markCtrl->SetSelection(3); + break; + case RL2_GRAPHIC_MARK_CROSS: + markCtrl->SetSelection(4); + break; + case RL2_GRAPHIC_MARK_X: + markCtrl->SetSelection(5); + break; + default: + markCtrl->SetSelection(0); + break; + }; + wxTextCtrl *colorFillCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL_COLOR); + wxString fillColor = wxString::FromUTF8(Style->GetSymbolFillColor()); + colorFillCtrl->SetValue(fillColor); + wxTextCtrl *colorStrokeCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE_COLOR); + wxString strokeColor = wxString::FromUTF8(Style->GetSymbolStrokeColor()); + colorStrokeCtrl->SetValue(strokeColor); +} + +bool QuickStyleVectorDialog::RetrieveLinePage(bool check) +{ +// +// retrieving params from the Line Symbolizer page +// + double opacity; + double perpendicularOffset; + char strokeColor[8]; + double strokeWidth; + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); + opacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); + wxString value = perpCtrl->GetValue(); + if (value.ToDouble(&perpendicularOffset) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); + value = widthCtrl->GetValue(); + if (value.ToDouble(&strokeWidth) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (strokeWidth <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); + switch (dotCtrl->GetSelection()) + { + case 1: + Style->SetLineDotStyle(QUICK_STYLE_DOT_LINE); + break; + case 2: + Style->SetLineDotStyle(QUICK_STYLE_DASH_LINE); + break; + case 3: + Style->SetLineDotStyle(QUICK_STYLE_DASH_DOT_LINE); + break; + default: + Style->SetLineDotStyle(QUICK_STYLE_SOLID_LINE); + break; + }; + Style->SetLineOpacity(opacity); + Style->SetLinePerpendicularOffset(perpendicularOffset); + Style->SetLineStrokeWidth(strokeWidth); + Style->SetLineStrokeColor(strokeColor); + return true; +} + +void QuickStyleVectorDialog::UpdateLinePage() +{ +// +// updating the Line Symbolizer page +// + wxSlider *opacityCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE1_OPACITY); + opacityCtrl->SetValue(Style->GetLineOpacity() * 100.0); + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_PERPENDICULAR); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetLinePerpendicularOffset()); + wxString str = wxString::FromUTF8(dummy); + perpCtrl->SetValue(str); + wxTextCtrl *colorCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_COLOR); + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE1_PICKER_BTN); + colorCtrl->Enable(true); + pick->Enable(true); + wxString strokeColor = wxString::FromUTF8(Style->GetLineStrokeColor()); + colorCtrl->SetValue(strokeColor); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE1_WIDTH); + sprintf(dummy, "%1.2f", Style->GetLineStrokeWidth()); + str = wxString::FromUTF8(dummy); + wxRadioBox *dotCtrl = (wxRadioBox *) FindWindow(ID_SYMBOLIZER_DASH_DOT); + switch (Style->GetLineDotStyle()) + { + case QUICK_STYLE_DOT_LINE: + dotCtrl->SetSelection(1); + break; + case QUICK_STYLE_DASH_LINE: + dotCtrl->SetSelection(2); + break; + case QUICK_STYLE_DASH_DOT_LINE: + dotCtrl->SetSelection(3); + break; + default: + dotCtrl->SetSelection(0); + break; + }; + widthCtrl->SetValue(str); +} + +bool QuickStyleVectorDialog::RetrievePolygonPage(bool check) +{ +// +// retrieving params from the Polygon Synbolizer page +// + double fillOpacity; + double displacementX; + double displacementY; + double perpendicularOffset; + char fillColor[8]; + double strokeOpacity; + char strokeColor[8]; + double strokeWidth; + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); + fillOpacity = opacityCtrl->GetValue() / 100.0; + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); + wxString value = displXCtrl->GetValue(); + if (Style->IsPolygonFill() != true && Style->IsPolygonStroke() != true) + { + if (check == true) + { + wxMessageBox(wxT + ("You can't disable both FILL and STROKE at the same time !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); + value = perpCtrl->GetValue(); + if (value.ToDouble(&perpendicularOffset) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FILL-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fillColor, color.ToUTF8()); + wxSlider *opacity2Ctrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); + strokeOpacity = opacity2Ctrl->GetValue() / 100.0; + wxTextCtrl *color2Ctrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + color = color2Ctrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(strokeColor, color.ToUTF8()); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); + value = widthCtrl->GetValue(); + if (value.ToDouble(&strokeWidth) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (strokeWidth <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("STROKE-WIDTH must be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + + Style->SetPolygonFillOpacity(fillOpacity); + Style->SetPolygonDisplacementX(displacementX); + Style->SetPolygonDisplacementY(displacementY); + Style->SetPolygonPerpendicularOffset(perpendicularOffset); + Style->SetPolygonFillColor(fillColor); + Style->SetPolygonStrokeOpacity(strokeOpacity); + Style->SetPolygonStrokeColor(strokeColor); + Style->SetPolygonStrokeWidth(strokeWidth); + return true; +} + +void QuickStyleVectorDialog::UpdatePolygonPage() +{ +// +// updating the Polygon Symbolizer page +// + wxCheckBox *enableBox = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_FILL2_ENABLE); + enableBox->SetValue(Style->IsPolygonFill()); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_X); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementX()); + wxString str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetPolygonDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_POLYGON1_PERPENDICULAR); + sprintf(dummy, "%1.2f", Style->GetPolygonPerpendicularOffset()); + str = wxString::FromUTF8(dummy); + perpCtrl->SetValue(str); + wxSlider *opacityCtrl = (wxSlider *) FindWindow(ID_SYMBOLIZER_FILL2_OPACITY); + opacityCtrl->SetValue(Style->GetPolygonFillOpacity() * 100.0); + opacityCtrl->Enable(Style->IsPolygonFill()); + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FILL2_COLOR); + wxButton *pick = (wxButton *) FindWindow(ID_SYMBOLIZER_FILL2_PICKER_BTN); + wxColour color = wxNullColour; + str = wxString::FromUTF8(Style->GetPolygonFillColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorCtrl->SetValue(str); + } + colorCtrl->Enable(Style->IsPolygonFill()); + pick->Enable(Style->IsPolygonFill()); + wxCheckBox *enable2Box = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_STROKE2_ENABLE); + enable2Box->SetValue(Style->IsPolygonStroke()); + wxSlider *opacity2Ctrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_STROKE2_OPACITY); + opacity2Ctrl->SetValue(Style->GetPolygonStrokeOpacity() * 100.0); + opacity2Ctrl->Enable(Style->IsPolygonStroke()); + wxTextCtrl *color2Ctrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_COLOR); + wxButton *pick2 = (wxButton *) FindWindow(ID_SYMBOLIZER_STROKE2_PICKER_BTN); + color = wxNullColour; + str = wxString::FromUTF8(Style->GetPolygonStrokeColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + color2Ctrl->SetValue(str); + } + color2Ctrl->Enable(Style->IsPolygonStroke()); + pick2->Enable(Style->IsPolygonStroke()); + wxTextCtrl *widthCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_STROKE2_WIDTH); + sprintf(dummy, "%1.2f", Style->GetPolygonStrokeWidth()); + str = wxString::FromUTF8(dummy); + widthCtrl->SetValue(str); + widthCtrl->Enable(Style->IsPolygonStroke()); +} + +bool QuickStyleVectorDialog::RetrieveTextPointPage(bool check) +{ +// +// retrieving params from the Text Symbolizer page - Point Placement +// + wxString column; + wxString font; + double fontSize; + int fontStyle; + int fontWeight; + double opacity; + char fontColor[8]; + double haloRadius; + double haloOpacity; + char haloColor[8]; + double rotation; + double anchorPointX; + double anchorPointY; + double displacementX; + double displacementY; + + if (Style->IsLabelPrint() == false) + return true; + + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); + int idSel = columnCtrl->GetSelection(); + if (idSel == wxNOT_FOUND) + { + if (check == true) + { + wxMessageBox(wxT + ("You must select some Column !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + column = columnCtrl->GetValue(); + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); + idSel = fontCtrl->GetSelection(); + if (idSel == wxNOT_FOUND) + { + if (check == true) + { + wxMessageBox(wxT + ("You must select some Font !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + font = fontCtrl->GetValue(); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&fontSize) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (fontSize <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-SIZE should be a positive numberr !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); + if (boldCtrl->GetValue() == true) + fontWeight = RL2_FONTWEIGHT_BOLD; + else + fontWeight = RL2_FONTWEIGHT_NORMAL; + if (italicCtrl->GetValue() == true) + fontStyle = RL2_FONTSTYLE_ITALIC; + else + fontStyle = RL2_FONTSTYLE_NORMAL; + wxSlider *opacityFontCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); + opacity = opacityFontCtrl->GetValue() / 100.0; + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fontColor, color.ToUTF8()); +// Point Placement + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); + value = rotationCtrl->GetValue(); + if (value.ToDouble(&rotation) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ROTATION isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); + value = anchorXCtrl->GetValue(); + if (value.ToDouble(&anchorPointX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorPointX < 0.0 || anchorPointX > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-X must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); + value = anchorYCtrl->GetValue(); + if (value.ToDouble(&anchorPointY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (anchorPointY < 0.0 || anchorPointY > 1.0) + { + if (check == true) + { + wxMessageBox(wxT + ("ANCHOR-POINT-Y must be between 0.0 and 1.0 !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); + value = displXCtrl->GetValue(); + if (value.ToDouble(&displacementX) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-X isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); + value = displYCtrl->GetValue(); + if (value.ToDouble(&displacementY) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("DISPLACEMENT-Y isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsHaloEnabled() == true) + { + wxSlider *opacityHaloCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); + haloOpacity = opacityHaloCtrl->GetValue() / 100.0; + wxTextCtrl *radiusCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); + wxString value = radiusCtrl->GetValue(); + if (value.ToDouble(&haloRadius) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-RADIUS isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (haloRadius <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-RADIUS should be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorHaloCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); + wxString color = colorHaloCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(haloColor, color.ToUTF8()); + } + + Style->SetLabelColumn(column.ToUTF8()); + Style->SetFontFacename(font.ToUTF8()); + Style->SetFontOpacity(opacity); + Style->SetFontSize(fontSize); + Style->SetFontStyle(fontStyle); + Style->SetFontWeight(fontWeight); + Style->SetFontColor(fontColor); + Style->SetLabelRotation(rotation); + Style->SetLabelAnchorX(anchorPointX); + Style->SetLabelAnchorY(anchorPointY); + Style->SetLabelDisplacementX(displacementX); + Style->SetLabelDisplacementY(displacementY); + if (Style->IsHaloEnabled() == true) + { + Style->SetHaloRadius(haloRadius); + Style->SetHaloOpacity(haloOpacity); + Style->SetHaloColor(haloColor); + } + return true; +} + +void QuickStyleVectorDialog::UpdateTextPointPage() +{ +// +// updating the Text Symbolizer page - Point Placement +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ENABLE); + enableCtrl->SetValue(Style->IsLabelPrint()); + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT1_LABEL); + wxString str = wxString::FromUTF8(Style->GetLabelColumn()); + int idSel = columnCtrl->FindString(str); + columnCtrl->SetSelection(idSel); + columnCtrl->Enable(Style->IsLabelPrint()); + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT1_NAME); + str = wxString::FromUTF8(Style->GetFontFacename()); + idSel = fontCtrl->FindString(str); + fontCtrl->SetSelection(idSel); + fontCtrl->Enable(Style->IsLabelPrint()); + wxSlider *opacityFontCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT1_OPACITY); + opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); + opacityFontCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *colorFontCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_COLOR); + wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT1_PICKER_BTN); + wxColour color = wxNullColour; + str = wxString::FromUTF8(Style->GetFontColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorFontCtrl->SetValue(str); + } + colorFontCtrl->Enable(Style->IsLabelPrint()); + pickFont->Enable(Style->IsLabelPrint()); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT1_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetFontSize()); + str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + sizeCtrl->Enable(Style->IsLabelPrint()); + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT1_ITALIC); + if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) + boldCtrl->SetValue(true); + else + boldCtrl->SetValue(false); + if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) + italicCtrl->SetValue(true); + else + italicCtrl->SetValue(false); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + if (Style->GetFontFacename() != NULL) + { + if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) + { + boldCtrl->Enable(Style->IsLabelPrint()); + italicCtrl->Enable(Style->IsLabelPrint()); + } else + { + bool bold = false; + bool italic = false; + MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); + boldCtrl->SetValue(bold); + italicCtrl->SetValue(italic); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + } + } +// Point Placement + wxTextCtrl *rotationCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ROTATION); + sprintf(dummy, "%1.2f", Style->GetLabelRotation()); + str = wxString::FromUTF8(dummy); + rotationCtrl->SetValue(str); + rotationCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *anchorXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_X); + sprintf(dummy, "%1.2f", Style->GetLabelAnchorX()); + str = wxString::FromUTF8(dummy); + anchorXCtrl->SetValue(str); + anchorXCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *anchorYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_ANCHOR_Y); + sprintf(dummy, "%1.2f", Style->GetLabelAnchorY()); + str = wxString::FromUTF8(dummy); + anchorYCtrl->SetValue(str); + anchorYCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *displXCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_X); + sprintf(dummy, "%1.2f", Style->GetLabelDisplacementX()); + str = wxString::FromUTF8(dummy); + displXCtrl->SetValue(str); + displXCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *displYCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_DISPLACEMENT_Y); + sprintf(dummy, "%1.2f", Style->GetLabelDisplacementY()); + str = wxString::FromUTF8(dummy); + displYCtrl->SetValue(str); + displYCtrl->Enable(Style->IsLabelPrint()); + wxCheckBox *enableHaloBox = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO1_ENABLE); + if (Style->IsHaloEnabled() == true) + enableHaloBox->SetValue(true); + else + enableHaloBox->SetValue(false); + enableHaloBox->Enable(Style->IsLabelPrint()); + bool enable = false; + if (Style->IsLabelPrint() == true) + enable = Style->IsHaloEnabled(); + wxTextCtrl *radiusCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_RADIUS); + radiusCtrl->Enable(enable); + wxTextCtrl *colorHaloCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO1_COLOR); + colorHaloCtrl->Enable(enable); + wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO1_PICKER_BTN); + pickHalo->Enable(enable); + wxSlider *opacityHaloCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO1_OPACITY); + opacityHaloCtrl->Enable(enable); + opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); + sprintf(dummy, "%1.2f", Style->GetHaloRadius()); + str = wxString::FromUTF8(dummy); + radiusCtrl->SetValue(str); + color = wxNullColour; + str = wxString::FromUTF8(Style->GetHaloColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorHaloCtrl->SetValue(str); + } + if (Style->IsHaloEnabled() == false) + { + opacityHaloCtrl->Enable(false); + pickHalo->Enable(false); + colorHaloCtrl->Enable(false); + radiusCtrl->Enable(false); + } else + { + opacityHaloCtrl->Enable(true); + pickHalo->Enable(true); + colorHaloCtrl->Enable(true); + radiusCtrl->Enable(true); + } +} + +bool QuickStyleVectorDialog::RetrieveTextLinePage(bool check) +{ +// +// retrieving params from the Text Symbolizer page - Line Placement +// + wxString column; + wxString font; + double fontSize; + int fontStyle; + int fontWeight; + double opacity; + char fontColor[8]; + double haloRadius; + double haloOpacity; + char haloColor[8]; + double perpendicularOffset; + double initialGap; + double gap; + + if (Style->IsLabelPrint() == false) + return true; + + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); + int idSel = columnCtrl->GetSelection(); + if (idSel == wxNOT_FOUND) + { + if (check == true) + { + wxMessageBox(wxT + ("You must select some Column !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + column = columnCtrl->GetValue(); + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); + idSel = fontCtrl->GetSelection(); + if (idSel == wxNOT_FOUND) + { + if (check == true) + { + wxMessageBox(wxT + ("You must select some Font !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + font = fontCtrl->GetValue(); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); + wxString value = sizeCtrl->GetValue(); + if (value.ToDouble(&fontSize) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-SIZE isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (fontSize <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-SIZE should be a positive numberr !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); + if (boldCtrl->GetValue() == true) + fontWeight = RL2_FONTWEIGHT_BOLD; + else + fontWeight = RL2_FONTWEIGHT_NORMAL; + if (italicCtrl->GetValue() == true) + fontStyle = RL2_FONTSTYLE_ITALIC; + else + fontStyle = RL2_FONTSTYLE_NORMAL; + wxSlider *opacityFontCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); + opacity = opacityFontCtrl->GetValue() / 100.0; + wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); + wxString color = colorCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("FONT-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(fontColor, color.ToUTF8()); +// Line Placement + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); + value = perpCtrl->GetValue(); + if (value.ToDouble(&perpendicularOffset) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("PERPENDICULAR-OFFSET isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *inigapCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); + value = inigapCtrl->GetValue(); + if (value.ToDouble(&initialGap) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("INITIAL-GAP isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (initialGap < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("INITIAL-GAP should be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); + value = gapCtrl->GetValue(); + if (value.ToDouble(&gap) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("GAP isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (gap < 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("GAP should be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (Style->IsHaloEnabled() == true) + { + wxSlider *opacityHaloCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); + haloOpacity = opacityHaloCtrl->GetValue() / 100.0; + wxTextCtrl *radiusCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); + wxString value = radiusCtrl->GetValue(); + if (value.ToDouble(&haloRadius) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-RADIUS isn't a valid decimal number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + if (haloRadius <= 0.0) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-RADIUS should be a positive number !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + wxTextCtrl *colorHaloCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); + wxString color = colorHaloCtrl->GetValue(); + if (ColorMapEntry::IsValidColor(color) != true) + { + if (check == true) + { + wxMessageBox(wxT + ("HALO-COLOR isn't a valid HexRGB color !!!"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } + } + strcpy(haloColor, color.ToUTF8()); + } + Style->SetLabelColumn(column.ToUTF8()); + Style->SetFontFacename(font.ToUTF8()); + Style->SetFontOpacity(opacity); + Style->SetFontSize(fontSize); + Style->SetFontStyle(fontStyle); + Style->SetFontWeight(fontWeight); + Style->SetFontColor(fontColor); + Style->SetLabelPerpendicularOffset(perpendicularOffset); + Style->SetLabelInitialGap(initialGap); + Style->SetLabelGap(gap); + if (Style->IsHaloEnabled() == true) + { + Style->SetHaloRadius(haloRadius); + Style->SetHaloOpacity(haloOpacity); + Style->SetHaloColor(haloColor); + } + return true; +} + +void QuickStyleVectorDialog::UpdateTextLinePage() +{ +// +// updating the Text Symbolizer page - Line Placement +// + wxCheckBox *enableCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ENABLE); + enableCtrl->SetValue(Style->IsLabelPrint()); + wxComboBox *columnCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_TEXT2_LABEL); + wxString str = wxString::FromUTF8(Style->GetLabelColumn()); + int idSel = columnCtrl->FindString(str); + columnCtrl->SetSelection(idSel); + columnCtrl->Enable(Style->IsLabelPrint()); + wxComboBox *fontCtrl = (wxComboBox *) FindWindow(ID_SYMBOLIZER_FONT2_NAME); + str = wxString::FromUTF8(Style->GetFontFacename()); + idSel = fontCtrl->FindString(str); + fontCtrl->SetSelection(idSel); + fontCtrl->Enable(Style->IsLabelPrint()); + wxSlider *opacityFontCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_FONT2_OPACITY); + opacityFontCtrl->SetValue(Style->GetFontOpacity() * 100.0); + opacityFontCtrl->Enable(Style->IsLabelPrint()); + wxTextCtrl *colorFontCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_COLOR); + wxButton *pickFont = (wxButton *) FindWindow(ID_SYMBOLIZER_FONT2_PICKER_BTN); + wxColour color = wxNullColour; + str = wxString::FromUTF8(Style->GetFontColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorFontCtrl->SetValue(str); + } + colorFontCtrl->Enable(Style->IsLabelPrint()); + pickFont->Enable(Style->IsLabelPrint()); + wxTextCtrl *sizeCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_FONT2_SIZE); + char dummy[64]; + sprintf(dummy, "%1.2f", Style->GetFontSize()); + str = wxString::FromUTF8(dummy); + sizeCtrl->SetValue(str); + sizeCtrl->Enable(Style->IsLabelPrint()); + wxCheckBox *boldCtrl = (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_BOLD); + wxCheckBox *italicCtrl = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT2_ITALIC); + if (Style->GetFontWeight() == RL2_FONTWEIGHT_BOLD) + boldCtrl->SetValue(true); + else + boldCtrl->SetValue(false); + if (Style->GetFontStyle() == RL2_FONTSTYLE_ITALIC) + italicCtrl->SetValue(true); + else + italicCtrl->SetValue(false); + italicCtrl->Enable(Style->IsLabelPrint()); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + if (Style->GetFontFacename() != NULL) + { + if (strncmp(Style->GetFontFacename(), "ToyFont: ", 9) == 0) + { + boldCtrl->Enable(Style->IsLabelPrint()); + italicCtrl->Enable(Style->IsLabelPrint()); + } else + { + bool bold = false; + bool italic = false; + MainFrame->CheckTTFont(Style->GetFontFacename(), &bold, &italic); + boldCtrl->SetValue(bold); + italicCtrl->SetValue(italic); + boldCtrl->Enable(false); + italicCtrl->Enable(false); + } + } +// Line Placement + wxTextCtrl *perpCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_PERPENDICULAR); + sprintf(dummy, "%1.2f", Style->GetLabelPerpendicularOffset()); + str = wxString::FromUTF8(dummy); + perpCtrl->SetValue(str); + perpCtrl->Enable(Style->IsLabelPrint()); + wxCheckBox *repeatBox = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_REPEATED); + repeatBox->SetValue(Style->IsRepeatedLabel()); + repeatBox->Enable(Style->IsLabelPrint()); + wxTextCtrl *inigapCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_INITIAL_GAP); + sprintf(dummy, "%1.2f", Style->GetLabelInitialGap()); + str = wxString::FromUTF8(dummy); + inigapCtrl->SetValue(str); + wxTextCtrl *gapCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_TEXT_GAP); + sprintf(dummy, "%1.2f", Style->GetLabelGap()); + str = wxString::FromUTF8(dummy); + gapCtrl->SetValue(str); + if (Style->IsLabelPrint() && Style->IsRepeatedLabel()) + { + inigapCtrl->Enable(true); + gapCtrl->Enable(true); + } else + { + inigapCtrl->Enable(false); + gapCtrl->Enable(false); + } + wxCheckBox *alignBox = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_IS_ALIGNED); + alignBox->SetValue(Style->IsLabelAligned()); + alignBox->Enable(Style->IsLabelPrint()); + wxCheckBox *generalizeBox = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_TEXT_GENERALIZE); + generalizeBox->SetValue(Style->IsLabelGeneralizeLine()); + generalizeBox->Enable(Style->IsLabelPrint()); + wxCheckBox *enableHaloBox = + (wxCheckBox *) FindWindow(ID_SYMBOLIZER_HALO2_ENABLE); + if (Style->IsHaloEnabled() == true) + enableHaloBox->SetValue(true); + else + enableHaloBox->SetValue(false); + enableHaloBox->Enable(Style->IsLabelPrint()); + bool enable = false; + if (Style->IsLabelPrint() == true) + enable = Style->IsHaloEnabled(); + wxTextCtrl *radiusCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_RADIUS); + radiusCtrl->Enable(enable); + wxTextCtrl *colorHaloCtrl = + (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_HALO2_COLOR); + colorHaloCtrl->Enable(enable); + wxButton *pickHalo = (wxButton *) FindWindow(ID_SYMBOLIZER_HALO2_PICKER_BTN); + pickHalo->Enable(enable); + wxSlider *opacityHaloCtrl = + (wxSlider *) FindWindow(ID_SYMBOLIZER_HALO2_OPACITY); + opacityHaloCtrl->Enable(enable); + opacityHaloCtrl->SetValue(Style->GetHaloOpacity() * 100.0); + sprintf(dummy, "%1.2f", Style->GetHaloRadius()); + str = wxString::FromUTF8(dummy); + radiusCtrl->SetValue(str); + color = wxNullColour; + str = wxString::FromUTF8(Style->GetHaloColor()); + ColorMapEntry::GetWxColor(str, color); + if (color.IsOk() == true) + { + char hex[16]; + sprintf(hex, "#%02x%02x%02x", color.Red(), color.Green(), color.Blue()); + wxString str = wxString::FromUTF8(hex); + colorHaloCtrl->SetValue(str); + } + if (Style->IsHaloEnabled() == false) + { + opacityHaloCtrl->Enable(false); + pickHalo->Enable(false); + colorHaloCtrl->Enable(false); + radiusCtrl->Enable(false); + } else + { + opacityHaloCtrl->Enable(true); + pickHalo->Enable(true); + colorHaloCtrl->Enable(true); + radiusCtrl->Enable(true); + } +} + +void QuickStyleVectorDialog::OnPageChanging(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changing +// + bool ret = false; + int idx = event.GetOldSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PagePointIndex) + ret = RetrievePointPage(); + if (idx == PageLineIndex) + ret = RetrieveLinePage(); + if (idx == PagePolygonIndex) + ret = RetrievePolygonPage(); + if (idx == PageTextPointIndex) + ret = RetrieveTextPointPage(); + if (idx == PageTextLineIndex) + ret = RetrieveTextLinePage(); + } + if (ret != true) + event.Veto(); +} + +void QuickStyleVectorDialog::OnPageChanged(wxNotebookEvent & event) +{ +// +// TAB/PAGE selection changed +// + int idx = event.GetSelection(); + if (idx == 0) + UpdateMainPage(); + else + { + if (idx == PagePointIndex) + UpdatePointPage(); + if (idx == PageLineIndex) + UpdateLinePage(); + if (idx == PagePolygonIndex) + UpdatePolygonPage(); + if (idx == PageTextPointIndex) + UpdateTextPointPage(); + if (idx == PageTextLineIndex) + UpdateTextLinePage(); + } +} + +bool QuickStyleVectorDialog::UpdateStyle() +{ +// +// updating the QuickStyle +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PagePointIndex) + ret = RetrievePointPage(); + if (idx == PageLineIndex) + ret = RetrieveLinePage(); + if (idx == PagePolygonIndex) + ret = RetrievePolygonPage(); + if (idx == PageTextPointIndex) + ret = RetrieveTextPointPage(); + if (idx == PageTextLineIndex) + ret = RetrieveTextLinePage(); + } + if (ret == false) + return false; + + VectorLayerConfig *config = Layer->GetVectorConfig(); + bool setCurrentStyle = false; + if (config->GetStyle() == NULL) + setCurrentStyle = true; + else + { + if (strcmp(Style->GetUUID(), config->GetStyle()) != 0) + setCurrentStyle = true; + } + if (setCurrentStyle == true) + { + config->SetStyle(Style->GetUUID()); + IsConfigChanged = true; + } + IsConfigChanged = Layer->UpdateQuickStyle(Style); + return true; +} + +void QuickStyleVectorDialog::OnOk(wxCommandEvent & WXUNUSED(event)) +{ +// +// permanently saving the QuickStyle and quitting +// + if (UpdateStyle() == true) + wxDialog::EndModal(wxID_OK); +} + +void QuickStyleVectorDialog::OnApply(wxCommandEvent & WXUNUSED(event)) +{ +// +// applying the QuickStyle and continuing +// + if (UpdateStyle() == true) + { + if (IsConfigChanged == true) + MapPanel->RefreshMap(); + } +} + +void QuickStyleVectorDialog::OnExport(wxCommandEvent & WXUNUSED(event)) +{ +// +// exporting the Quick Style as an external file +// + bool xret = false; + int ret; + wxString path; + wxString lastDir; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + xret = RetrieveMainPage(); + else + { + if (idx == PagePointIndex) + xret = RetrievePointPage(); + if (idx == PageLineIndex) + xret = RetrieveLinePage(); + if (idx == PagePolygonIndex) + xret = RetrievePolygonPage(); + if (idx == PageTextPointIndex) + xret = RetrieveTextPointPage(); + if (idx == PageTextLineIndex) + xret = RetrieveTextLinePage(); + } + if (xret == false) + return; + + wxFileDialog fileDialog(this, + wxT("Exporting an SLD/SE QuickStyle to a file"), + wxT(""), wxT("style.xml"), + wxT("XML Document|*.xml|All files (*.*)|*.*"), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition, + wxDefaultSize, wxT("filedlg")); + lastDir = MainFrame->GetLastDirectory(); + if (lastDir.Len() >= 1) + fileDialog.SetDirectory(lastDir); + ret = fileDialog.ShowModal(); + if (ret == wxID_OK) + { + wxFileName file(fileDialog.GetPath()); + path = file.GetPath(); + path += file.GetPathSeparator(); + path += file.GetName(); + lastDir = file.GetPath(); + path = fileDialog.GetPath(); + FILE *out = fopen(path.ToUTF8(), "wb"); + if (out == NULL) + wxMessageBox(wxT("ERROR: unable to create:\n\n\"") + path + wxT("\""), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + else + { + char *xml = Style->CreateXmlStyle(); + fwrite(xml, 1, strlen(xml), out); + sqlite3_free(xml); + fclose(out); + wxMessageBox(wxT + ("SLD/SE QuickStyle successfully saved into:\n\n\"") + + path + wxT("\""), wxT("spatialite_gui"), + wxOK | wxICON_INFORMATION, this); + } + } +} + +void QuickStyleVectorDialog::OnCopy(wxCommandEvent & WXUNUSED(event)) +{ +// +// Copying the Quick Style into the Clipboard +// + bool ret = false; + int idx = GetBookCtrl()->GetSelection(); + if (idx == 0) + ret = RetrieveMainPage(); + else + { + if (idx == PagePointIndex) + ret = RetrievePointPage(); + if (idx == PageLineIndex) + ret = RetrieveLinePage(); + if (idx == PagePolygonIndex) + ret = RetrievePolygonPage(); + if (idx == PageTextPointIndex) + ret = RetrieveTextPointPage(); + if (idx == PageTextLineIndex) + ret = RetrieveTextLinePage(); + } + if (ret == false) + return; + + char *xml = Style->CreateXmlStyle(); + wxString XMLstring = wxString::FromUTF8(xml); + sqlite3_free(xml); + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(XMLstring)); + wxTheClipboard->Close(); + } +} + +void QuickStyleVectorDialog::OnQuit(wxCommandEvent & WXUNUSED(event)) +{ +// +// all done: +// + wxDialog::EndModal(wxID_CANCEL); +} Index: Raster.cpp ================================================================== --- Raster.cpp +++ Raster.cpp @@ -2,11 +2,11 @@ / Raster.cpp / various dialog classes supporting Raster datasources / / version 1.8, 2015 March 10 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2015 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -294,21 +294,29 @@ wxDefaultSize); wxBoxSizer *ndSizer = new wxStaticBoxSizer(ndBox, wxVERTICAL); ndBoxSizer->Add(ndSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); wxBoxSizer *nodataSizer = new wxBoxSizer(wxHORIZONTAL); ndSizer->Add(nodataSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); - wxTextCtrl *nodataCtrl = new wxTextCtrl(this, ID_CVG_NODATA, wxT(""), + wxTextCtrl *nodataCtrl = new wxTextCtrl(this, ID_CVG_NODATA, wxT("NONE"), wxDefaultPosition, wxSize(200, 22)); nodataSizer->Add(nodataCtrl, 0, wxALIGN_RIGHT | wxALL, 1); wxStaticText *nodataLabel = new wxStaticText(this, wxID_STATIC, wxT - (" (list of comma-separated sample values) e.g.: ")); + (" (list of comma-separated values) e.g.: ")); nodataSizer->Add(nodataLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); wxStaticText *nodata2Label = - new wxStaticText(this, wxID_STATIC, wxT("255,255,255 ")); + new wxStaticText(this, wxID_STATIC, wxT("255,255,255")); nodata2Label->SetForegroundColour(wxColour(255, 0, 0)); nodataSizer->Add(nodata2Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); + + + wxStaticText *nodata3Label = + new wxStaticText(this, wxID_STATIC, wxT(" or ")); + nodataSizer->Add(nodata3Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); + wxStaticText *nodata4Label = new wxStaticText(this, wxID_STATIC, wxT("NONE")); + nodata4Label->SetForegroundColour(wxColour(255, 0, 0)); + nodataSizer->Add(nodata4Label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 1); // sixth row: other attributes wxBoxSizer *mixSizer = new wxBoxSizer(wxHORIZONTAL); boxSizer->Add(mixSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); // sixth row, column #1: Tile Size wxBoxSizer *tileBoxSizer = new wxBoxSizer(wxHORIZONTAL); @@ -1678,12 +1686,18 @@ // checking a NO-DATA value // int count = 0; int error = 0; char dummy[128]; - if (no_data.Len() == 0) + if (no_data.CmpNoCase(wxT("NONE")) == 0) return true; + if (no_data.Len() == 0) + { + wxMessageBox(wxT("You must specify some NO-DATA value"), + wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); + return false; + } wxStringTokenizer tokenizer(no_data, wxT(",")); while (tokenizer.HasMoreTokens()) { count++; wxString token = tokenizer.GetNextToken(); @@ -1873,14 +1887,10 @@ { wxMessageBox(wxT("Invalid number of Bands"), wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); return; } - wxRadioBox *pixelCtrl = (wxRadioBox *) FindWindow(ID_CVG_PIXEL); - wxRadioBox *sampleCtrl = (wxRadioBox *) FindWindow(ID_CVG_SAMPLE); - wxRadioBox *compressionCtrl = (wxRadioBox *) FindWindow(ID_CVG_COMPRESSION); - wxSpinCtrl *bandCtrl = (wxSpinCtrl *) FindWindow(ID_CVG_BANDS); if (PixelType == RL2_PIXEL_MULTIBAND) { if (RedBand >= 0) { if (RedBand >= NumBands) @@ -3244,11 +3254,10 @@ // sets dialog sizer GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); // centers the dialog window Centre(); - int count = 0; return true; } void RasterInfosDialog::CreateControls() { Index: RasterSymbolizers.cpp ================================================================== --- RasterSymbolizers.cpp +++ RasterSymbolizers.cpp @@ -2,11 +2,11 @@ / RasterSymbolizers.cpp / various dialog classes / / version 1.8, 2015 March 23 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2015 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -3613,11 +3613,12 @@ { // // refreshing the Grid // int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); int count = 1; ColorMapEntry *pE = Map.GetFirst(); while (pE) { // counting how many lines are there @@ -4713,11 +4714,12 @@ { // // refreshing the Grid // int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); int count = 0; ColorMapEntry *pE = Map.GetFirst(); while (pE) { // counting how many lines are there @@ -5352,11 +5354,11 @@ { // // creating the dialog // MainFrame = parent; - Color = wxT("#ff0000"); + Color = wxT("#000000"); MinScale = false; MaxScale = false; if (wxDialog::Create(parent, wxID_ANY, wxT("RasterSymbolizer: Recolored Monochrome")) == false) return false; @@ -5425,27 +5427,26 @@ wxStaticBox *remapBox = new wxStaticBox(this, wxID_STATIC, wxT("Black remapped Color"), wxDefaultPosition, wxDefaultSize); wxBoxSizer *remapSizer = new wxStaticBoxSizer(remapBox, wxVERTICAL); - remapBoxSizer->Add(remapSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + remapBoxSizer->Add(remapSizer, 0, wxALIGN_RIGHT | wxALL, 5); wxBoxSizer *colorSizer = new wxBoxSizer(wxHORIZONTAL); - remapSizer->Add(colorSizer, 0, wxALIGN_RIGHT | wxALL, 0); + remapSizer->Add(colorSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0); wxTextCtrl *colorCtrl = new wxTextCtrl(this, ID_SYMBOLIZER_COLOR, Color, wxDefaultPosition, wxSize(100, 22)); - colorSizer->Add(colorCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxTextCtrl *sampleCtrl = - new wxTextCtrl(this, ID_SYMBOLIZER_PICKER_HEX, wxT(" "), - wxDefaultPosition, wxSize(44, 22), wxTE_READONLY); - wxColour back = wxColour(255, 0, 0); - sampleCtrl->SetBackgroundColour(back); - colorSizer->Add(sampleCtrl, 0, wxALIGN_RIGHT | wxALL, 5); - wxBoxSizer *pickerSizer = new wxBoxSizer(wxHORIZONTAL); - remapSizer->Add(pickerSizer, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); + colorSizer->Add(colorCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); + wxBitmap bmp; + wxColour color(0, 0, 0); + ColorMapEntry::DoPaintColorSample(32, 32, color, bmp); + wxStaticBitmap *sampleCtrl = + new wxStaticBitmap(this, ID_SYMBOLIZER_PICKER_HEX, bmp, + wxDefaultPosition, wxSize(32, 32)); + colorSizer->Add(sampleCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); wxButton *pick = new wxButton(this, ID_SYMBOLIZER_PICKER_BTN, wxT("&Pick a color")); - pickerSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); + colorSizer->Add(pick, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2); // sixth row: optional Visibility Range miscSizer->AddSpacer(75); wxBoxSizer *visibilityBoxSizer = new wxBoxSizer(wxVERTICAL); miscSizer->Add(visibilityBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0); wxStaticBox *visibilityBox = new wxStaticBox(this, wxID_STATIC, @@ -5504,11 +5505,11 @@ wxButton *copy = new wxButton(this, ID_SYMBOLIZER_COPY, wxT("&Copy")); btnBox->Add(copy, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); btnBox->AddSpacer(100); wxButton *ok = new wxButton(this, wxID_OK, wxT("&Quit")); btnBox->Add(ok, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); -// appends event handler for OK button +// appends event handler for OK button; Connect(wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & RasterSymbolizerMonochromeDialog::OnQuit); Connect(ID_SYMBOLIZER_INSERT, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) & RasterSymbolizerMonochromeDialog::OnInsert); Connect(ID_SYMBOLIZER_EXPORT, wxEVT_COMMAND_BUTTON_CLICKED, @@ -5531,16 +5532,19 @@ { // // remapped color changed: updating the visual sample // wxTextCtrl *colorCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_COLOR); - wxTextCtrl *sampleCtrl = (wxTextCtrl *) FindWindow(ID_SYMBOLIZER_PICKER_HEX); + wxStaticBitmap *sampleCtrl = + (wxStaticBitmap *) FindWindow(ID_SYMBOLIZER_PICKER_HEX); wxColour back = wxColour(255, 255, 255); wxString str = colorCtrl->GetValue(); if (ColorMapEntry::IsValidColor(str) == true) ColorMapEntry::GetWxColor(str, back); - sampleCtrl->SetBackgroundColour(back); + wxBitmap bmp; + ColorMapEntry::DoPaintColorSample(32, 32, back, bmp); + sampleCtrl->SetBitmap(bmp); sampleCtrl->Refresh(); sampleCtrl->Update(); } void RasterSymbolizerMonochromeDialog:: @@ -5812,11 +5816,11 @@ xml = sqlite3_mprintf("%s\t\t\t\t\tRasterdata\r\n", prev); sqlite3_free(prev); prev = xml; - xml = sqlite3_mprintf("%s\t\t\t\t\t#ffffff\r\n", prev); + xml = sqlite3_mprintf("%s\t\t\t\t\t#000000\r\n", prev); sqlite3_free(prev); prev = xml; str = new char[strlen(Color.ToUTF8()) + 1]; strcpy(str, Color.ToUTF8()); xml = @@ -5913,11 +5917,11 @@ prev = xml; xml = sqlite3_mprintf("%s\t\t\tRasterdata\r\n", prev); sqlite3_free(prev); prev = xml; - xml = sqlite3_mprintf("%s\t\t\t#ffffff\r\n", prev); + xml = sqlite3_mprintf("%s\t\t\t#000000\r\n", prev); sqlite3_free(prev); prev = xml; str = new char[strlen(Color.ToUTF8()) + 1]; strcpy(str, Color.ToUTF8()); xml = Index: ResultSetView.cpp ================================================================== --- ResultSetView.cpp +++ ResultSetView.cpp @@ -2,11 +2,11 @@ / ResultSetView.cpp / a panel to show SQL query results / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -515,10 +515,11 @@ params->Finalize(); params->SetEndRow(end_row); params->SetMaxRow(i_row); goto ok; error: + params->Finalize(); params->SetError(); ok: wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, ID_RS_THREAD_FINISHED); params->GetMother()->GetEventHandler()->AddPendingEvent(event); #if defined(_WIN32) && !defined(__MINGW32__) @@ -725,11 +726,11 @@ } char *xSql = NULL; char err_msg[2048]; int i_row; clock_t clock_start; - sqlite3_stmt *stmt; + sqlite3_stmt *stmt = NULL; sqlite3 *sqlite = MainFrame->GetSqlite(); SqlErrorMsg = wxT(""); if (TableView) TableView->Destroy(); TableView = NULL; @@ -818,10 +819,11 @@ delete[]xSql; return false; } } sqlite3_finalize(stmt); + stmt = NULL; } delete[]xSql; CreateStatsGrid(); MainFrame->DisableAllTools(); @@ -978,12 +980,12 @@ { // preparing the insert row int numCols = 0; wxString *colNames = MainFrame->GetColumnNames(TableName, &numCols); CreateGrid(0, numCols + 1); - if (isView == false); - TableView->SetColLabelValue(0, wxT("ROWID")); + if (isView == false) + TableView->SetColLabelValue(0, wxT("ROWID")); for (i_col = 0; i_col < numCols; i_col++) TableView->SetColLabelValue(i_col + 1, *(colNames + i_col)); TableView->EnableEditing(true); delete[]colNames; } else @@ -1083,10 +1085,13 @@ switch (type) { case GAIA_GEOMETRY_BLOB: blobType = wxT("GEOMETRY"); break; + case GAIA_TINYPOINT_BLOB: + blobType = wxT("TinyPoint"); + break; case GAIA_GPB_BLOB: blobType = wxT("GeoPackageGEOMETRY"); break; case GAIA_XML_BLOB: blobType = wxT("XmlBLOB"); @@ -1833,11 +1838,12 @@ } } menuItem = new wxMenuItem(&menu, Grid_Blob, wxT("BLOB &explore")); menu.Append(menuItem); blob_type = gaiaGuessBlobType(blobVar->GetBlob(), blobVar->GetBlobSize()); - if (blob_type == GAIA_GEOMETRY_BLOB) + if (blob_type == GAIA_GEOMETRY_BLOB || blob_type == GAIA_TINYPOINT_BLOB + || blob_type == GAIA_GPB_BLOB) ; else if (blob_type == GAIA_XML_BLOB) { menu.AppendSeparator(); menuItem = @@ -2708,10 +2714,11 @@ case GAIA_WEBP_BLOB: blobValue += wxT("WEBP image"); break; case GAIA_JP2_BLOB: blobValue += wxT("JP2 image (Jpeg2000)"); + break; case GAIA_PDF_BLOB: blobValue += wxT("PDF document"); break; case GAIA_ZIP_BLOB: blobValue += wxT("ZIP archive"); Index: Shapefiles.cpp ================================================================== --- Shapefiles.cpp +++ Shapefiles.cpp @@ -2,11 +2,11 @@ / Shapefiles.cpp / methods related to Shapefile loading and saving / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by Index: SqlFiltersComposer.cpp ================================================================== --- SqlFiltersComposer.cpp +++ SqlFiltersComposer.cpp @@ -2,11 +2,11 @@ / SqlFiltersComposer.cpp / Sql Filters Composer / / version 2.0, 2016 August 9 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2016 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -28,13 +28,10 @@ void MyFrame::SqlFiltersComposer() { // // query/view composer invoked // - char *xsql; - int ret; - char *errMsg = NULL; SqlFiltersDialog dlg; if (SqlFilters.IsValid() == false) return; @@ -50,15 +47,14 @@ int pk = 0; int pb = 0; char **results; int rows; int columns; + char *xsql; int i; char *errMsg = NULL; wxString sql; - char *xsql; - char *column; char *type; char *xname; char *xname2; for (i = 0; i < 1024; i++) Index: Styles.cpp ================================================================== --- Styles.cpp +++ Styles.cpp @@ -2,11 +2,11 @@ / Styles.cpp / various dialog classes / / version 1.8, 2015 March 13 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2015 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -1284,11 +1284,12 @@ // attempting to register the new styles DoRegistetRasterCoverageStyles(&dlg); // updating the Grid int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindRasterCoverageStyles(CoverageName); int count = 0; RasterCoverageStyle *pS = List->GetFirst(); @@ -3381,11 +3382,12 @@ // attempting to register the new styles DoRegistetVectorCoverageStyles(&dlg); // updating the Grid int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindVectorCoverageStyles(CoverageName); int count = 0; VectorCoverageStyle *pS = List->GetFirst(); @@ -5285,11 +5287,10 @@ // sets dialog sizer GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); // centers the dialog window Centre(); - int count = 0; return true; } void VectorInfosDialog::CreateControls() { @@ -6945,11 +6946,12 @@ if (DoRegistetVectorCoverageSrid(srid) == true) { // updating the Grid GridCtrl->Show(false); int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindVectorAlternativeSRIDs(CoverageName); int count = 0; VectorCoverageSRID *pS = List->GetFirst(); @@ -7509,11 +7511,12 @@ // attempting to register the Keyword if (DoRegistetVectorCoverageKeyword(keyword) == true) { // updating the Grid int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindVectorKeywords(CoverageName); int count = 0; VectorCoverageKeyword *pK = List->GetFirst(); @@ -8048,11 +8051,12 @@ if (DoRegistetRasterCoverageSrid(srid) == true) { // updating the Grid GridCtrl->Show(false); int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindRasterAlternativeSRIDs(CoverageName); int count = 0; RasterCoverageSRID *pS = List->GetFirst(); @@ -8482,11 +8486,12 @@ // attempting to register the Keyword if (DoRegistetRasterCoverageKeyword(keyword) == true) { // updating the Grid int tot_rows = GridCtrl->GetNumberRows(); - GridCtrl->DeleteRows(0, tot_rows); + if (tot_rows > 0) + GridCtrl->DeleteRows(0, tot_rows); if (List != NULL) delete List; List = MainFrame->FindRasterKeywords(CoverageName); int count = 0; RasterCoverageKeyword *pK = List->GetFirst(); Index: TableTree.cpp ================================================================== --- TableTree.cpp +++ TableTree.cpp @@ -2,11 +2,11 @@ / TableTree.cpp / tree control to show tables, columns, indices and triggers / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -79,10 +79,14 @@ #include "icons/linestrings_on.xpm" #include "icons/points_on.xpm" #include "icons/polygons_on.xpm" #include "icons/clone.xpm" #include "icons/wms.xpm" +#include "icons/postgres.xpm" +#include "icons/postgres_schema.xpm" +#include "icons/postgres_table.xpm" +#include "icons/postgres_view.xpm" MyTableTree::MyTableTree(MyFrame * parent, wxWindowID id):wxTreeCtrl(parent, id) { // // constructor: TREE control to show DB objects @@ -112,10 +116,13 @@ RootVectorCoverages = AppendItem(Root, wxT("Vector Coverages")); SetItemData(RootVectorCoverages, (wxTreeItemData *) (new MyObject(MY_ROOT_VECTOR))); RootWMS = AppendItem(Root, wxT("Registered WMS layers")); SetItemData(RootWMS, (wxTreeItemData *) (new MyObject(MY_ROOT_WMS))); + RootPostgreSQL = AppendItem(Root, wxT("PostgreSQL")); + SetItemData(RootPostgreSQL, + (wxTreeItemData *) (new MyObject(MY_ROOT_POSTGRESQL))); RootMetadata = AppendItem(Root, wxT("Metadata")); SetItemData(RootMetadata, (wxTreeItemData *) (new MyObject(MY_ROOT_METADATA))); RootInternal = AppendItem(Root, wxT("Internal Data")); SetItemData(RootInternal, @@ -123,11 +130,11 @@ RootSpatialIndex = AppendItem(Root, wxT("Spatial Index")); SetItemData(RootSpatialIndex, (wxTreeItemData *) (new MyObject(MY_ROOT_RTREE))); // setting up icons Images = new wxImageList(16, 16, true); - wxIcon icons[36]; + wxIcon icons[40]; icons[0] = wxIcon(db_xpm); icons[1] = wxIcon(table_xpm); icons[2] = wxIcon(pkey_xpm); icons[3] = wxIcon(column_xpm); icons[4] = wxIcon(index_xpm); @@ -160,10 +167,14 @@ icons[31] = wxIcon(gpkgtable_xpm); icons[32] = wxIcon(gpkggeom_xpm); icons[33] = wxIcon(virtshp_xpm); icons[34] = wxIcon(virtgpkg_xpm); icons[35] = wxIcon(gpkg_spatialidx_xpm); + icons[36] = wxIcon(postgres_xpm); + icons[37] = wxIcon(postgres_schema_xpm); + icons[38] = wxIcon(postgres_table_xpm); + icons[39] = wxIcon(postgres_view_xpm); Images->Add(icons[0]); Images->Add(icons[1]); Images->Add(icons[2]); Images->Add(icons[3]); Images->Add(icons[4]); @@ -196,18 +207,23 @@ Images->Add(icons[31]); Images->Add(icons[32]); Images->Add(icons[33]); Images->Add(icons[34]); Images->Add(icons[35]); + Images->Add(icons[36]); + Images->Add(icons[37]); + Images->Add(icons[38]); + Images->Add(icons[39]); SetImageList(Images); SetItemImage(Root, 0); SetItemImage(RootUserData, 17); SetItemImage(RootTopologies, 20); SetItemImage(RootNetworks, 25); SetItemImage(RootRasterCoverages, 22); SetItemImage(RootVectorCoverages, 24); SetItemImage(RootWMS, 26); + SetItemImage(RootPostgreSQL, 36); SetItemImage(RootStyling, 17); SetItemImage(RootIsoMetadata, 17); SetItemImage(RootMetadata, 17); SetItemImage(RootInternal, 17); SetItemImage(RootSpatialIndex, 17); @@ -434,10 +450,20 @@ (wxObjectEventFunction) & MyTableTree::OnCmdDropTopoGeo); Connect(Tree_CreateTopoNet, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyTableTree::OnCmdCreateTopoNet); Connect(Tree_DropTopoNet, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) & MyTableTree::OnCmdDropTopoNet); + Connect(Tree_CreatePostgreSqlConn, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyTableTree::OnCmdCreatePostgreSqlConn); + Connect(Tree_CloseAllPostgreSqlConns, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyTableTree::OnCmdCloseAllPostgreSqlConns); + Connect(Tree_ClosePostgreSqlConn, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyTableTree::OnCmdClosePostgreSqlConn); + Connect(Tree_PostgreSqlInfos, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyTableTree::OnCmdPostgreSqlInfos); + Connect(Tree_PostgreSqlDropOrphans, wxEVT_COMMAND_MENU_SELECTED, + (wxObjectEventFunction) & MyTableTree::OnCmdPostgreSqlDropOrphans); } MyTableTree::~MyTableTree() { delete Images; @@ -454,10 +480,11 @@ DeleteNetworks(RootNetworks); DeleteRasterCoverages(RootRasterCoverages); DeleteVectorCoverages(RootVectorCoverages); DeleteChildren(RootStyling); DeleteChildren(RootWMS); + DeleteChildren(RootPostgreSQL); DeleteChildren(RootIsoMetadata); DeleteChildren(RootMetadata); DeleteChildren(RootInternal); DeleteChildren(RootSpatialIndex); while (ok) @@ -480,10 +507,12 @@ if (child == RootVectorCoverages) kill = false; if (child == RootStyling) kill = false; if (child == RootWMS) + kill = false; + if (child == RootPostgreSQL) kill = false; if (child == RootIsoMetadata) kill = false; if (child == RootMetadata) kill = false; @@ -514,10 +543,13 @@ { case MY_TABLE: case MY_VTABLE: case MY_TILE_DATA: case MY_VIEW: + case MY_POSTGRES_TABLE: + case MY_POSTGRES_VIEW: + case MY_POSTGIS_VIEW: DeleteChildren(item); AppendItem(item, wxT("placeholder"), 0); break; }; event.Skip(); @@ -551,10 +583,21 @@ if (obj->GetDbAlias().Len() == 0) ExpandView(item); else ExpandAttachedView(item); EnsureVisible(item); + return; + case MY_POSTGRES_TABLE: + case MY_POSTGRES_VIEW: + DeleteChildren(item); + ExpandPostgresTable(item); + EnsureVisible(item); + return; + case MY_POSTGIS_VIEW: + DeleteChildren(item); + ExpandPostGisView(item); + EnsureVisible(item); return; }; event.Skip(); } @@ -636,10 +679,14 @@ if (tableName == wxT("topologies")) return RootMetadata; if (tableName == wxT("networks")) return RootMetadata; if (tableName == wxT("data_licenses")) + return RootMetadata; + if (tableName == wxT("stored_procedures")) + return RootMetadata; + if (tableName == wxT("stored_variables")) return RootMetadata; if (tableName == wxT("wms_getcapabilities")) return RootMetadata; if (tableName == wxT("wms_getmap")) @@ -864,10 +911,14 @@ if (tableName == wxT("topologies")) return nodes->GetRootMetadata(); if (tableName == wxT("networks")) return nodes->GetRootMetadata(); if (tableName == wxT("data_licenses")) + return nodes->GetRootMetadata(); + if (tableName == wxT("stored_procedures")) + return nodes->GetRootMetadata(); + if (tableName == wxT("stored_variables")) return nodes->GetRootMetadata(); if (tableName == wxT("gpkg_spatial_ref_sys")) return nodes->GetRootMetadata(); if (tableName == wxT("gpkg_contents")) @@ -1100,10 +1151,21 @@ else data = (wxTreeItemData *) (new MyObject(MY_TABLE, dbAlias, tableName)); item = AppendItem(rootNode, tableName, icon, -1, data); AppendItem(item, wxT("placeholder"), 0); } + +void MyTableTree::AddTmpMetadata(wxString & name) +{ +// adding some TEMPORARY Metadata table + wxTreeItemId item; + wxString dbAlias = wxT("temp"); + wxTreeItemData *data = + (wxTreeItemData *) (new MyObject(MY_TABLE, dbAlias, name, true)); + item = AppendItem(RootMetadata, name, 1, -1, data); + AppendItem(item, wxT("placeholder"), 0); +} void MyTableTree::AddGeoPackageTable(wxString & tableName) { // // appends a GPKG table to the TREE list @@ -1514,10 +1576,194 @@ MyObject(MY_TRIGGER, empty, trgr->GetName()))); trgr = trgr->GetNext(); } } + +void MyTableTree::ExpandPostgresTable(wxTreeItemId & item) +{ +// +// expands a TreeItem of the POSTGRES TABLE type +// + MyTableInfo list; + MyColumnInfo *col; + wxString columnInfo; + wxTreeItemId item2; + MyPostgresTable *table = NULL; + MyObject *obj = (MyObject *) GetItemData(item); + if (obj == NULL) + return; + wxString tableName = obj->GetVirtName(); + if (obj->GetType() == MY_POSTGRES_TABLE) + table = MainFrame->FindPostgresTable(tableName); + + MainFrame->GetTableColumns(tableName, &list); + wxString empty = wxEmptyString; + col = list.GetFirstColumn(); + while (col) + { + int icon = 3; + columnInfo = col->GetName(); + if (table != NULL) + { + // checking for a PK column + if (table->IsPkColumn(columnInfo) == true) + icon = 2; + } + item2 = AppendItem(item, columnInfo, icon); + SetItemData(item2, + (wxTreeItemData *) (new + MyObject(MY_POSTGRES_COLUMN, empty, empty, + -1, empty, empty, empty, empty, + columnInfo, tableName))); + col = col->GetNext(); + } +} + +void MyTableTree::AddPostgresConnection(int num, MyPostgresConn * conn, + wxTreeItemId & connId) +{ +// +// appends a PostgreSQL Connection to the TREE list +// + wxTreeItemId item; + wxTreeItemData *data; + int icon = 36; + data = + (wxTreeItemData *) (new + MyObject(MY_POSTGRES_CONN, conn->GetHost(), + conn->GetHostAddr(), conn->GetPort(), + conn->GetDbName(), conn->GetUser(), + conn->IsReadOnly())); + char dummy[128]; + sprintf(dummy, "connection #%d", num); + item = AppendItem(RootPostgreSQL, wxString::FromUTF8(dummy), icon, -1, data); + connId = item; +} + +void MyTableTree::AddPostgresSchema(wxTreeItemId & parent, + MyPostgresConn * conn, wxString & schema, + wxTreeItemId & item) +{ +// +// appends a PostgreSQL Schema to the TREE list +// + wxTreeItemData *data; + int icon = 37; + data = + (wxTreeItemData *) (new + MyObject(MY_POSTGRES_SCHEMA, conn->GetHost(), + conn->GetHostAddr(), conn->GetPort(), + conn->GetDbName(), conn->GetUser(), schema)); + item = AppendItem(parent, schema, icon, -1, data); +} + +void MyTableTree::AddPostgresTable(MyPostgres * list, wxString & virtName) +{ +// +// appends a PostgreSQL Table or View to the TREE list +// + int icon; + int type = -1; + MyPostgresConn *conn; + wxTreeItemId parent; + wxString schema; + wxString table; + bool readOnly; + bool hasPK; + bool canSelect; + bool canInsertUpdateDelete; + MyPostgresConn *pC = list->GetFirst(); + while (pC != NULL) + { + readOnly = pC->IsReadOnly(); + MyPostgresSchema *pS = pC->GetFirst(); + while (pS != NULL) + { + MyPostgresTable *pT = pS->GetFirstTable(); + while (pT != NULL) + { + if (pT->GetFirst() != NULL) + { + if (virtName.Cmp(pT->GetPostGisName()) == 0) + { + conn = pC; + parent = pS->GetTreeNode(); + icon = 12; + type = MY_POSTGIS_VIEW; + schema = pS->GetName(); + table = pT->GetName(); + hasPK = pT->HasPK(); + canSelect = pT->CanSelect(); + canInsertUpdateDelete = pT->CanInsertUpdateDelete(); + goto done; + } + } + if (virtName.Cmp(pT->GetVirtName()) == 0) + { + MainFrame->InitPostgresPkColumns(pC, pS, pT); + conn = pC; + parent = pS->GetTreeNode(); + icon = 38; + type = MY_POSTGRES_TABLE; + schema = pS->GetName(); + table = pT->GetName(); + hasPK = pT->HasPK(); + canSelect = pT->CanSelect(); + canInsertUpdateDelete = pT->CanInsertUpdateDelete(); + goto done; + } + pT = pT->GetNext(); + } + MyPostgresView *pV = pS->GetFirstView(); + while (pV != NULL) + { + if (virtName.Cmp(pV->GetVirtName()) == 0) + { + conn = pC; + parent = pS->GetTreeNode(); + icon = 39; + type = MY_POSTGRES_VIEW; + schema = pS->GetName(); + table = pV->GetName(); + hasPK = false; + canSelect = pV->CanSelect(); + canInsertUpdateDelete = pV->CanInsertUpdateDelete(); + goto done; + } + pV = pV->GetNext(); + } + pS = pS->GetNext(); + } + pC = pC->GetNext(); + } +done: + if (type == -1) + return; + +// adding the TREE node + wxTreeItemId item; + wxTreeItemData *data; + if (type == MY_POSTGIS_VIEW) + data = + (wxTreeItemData *) (new + MyObject(type, conn->GetHost(), conn->GetHostAddr(), + conn->GetPort(), conn->GetDbName(), + conn->GetUser(), schema, table, + virtName, readOnly, hasPK, canSelect, + canInsertUpdateDelete)); + else + data = + (wxTreeItemData *) (new + MyObject(type, conn->GetHost(), conn->GetHostAddr(), + conn->GetPort(), conn->GetDbName(), + conn->GetUser(), schema, table, virtName, + readOnly, hasPK, canSelect, + canInsertUpdateDelete)); + item = AppendItem(parent, virtName, icon, -1, data); + AppendItem(item, wxT("placeholder"), 0); +} void MyTableTree::AddView(wxString & viewName, bool geometry) { // // appends a view to the TREE list @@ -1627,10 +1873,77 @@ MyObject(MY_TRIGGER, empty, trgr->GetName()))); trgr = trgr->GetNext(); } } + +void MyTableTree::ExpandPostGisView(wxTreeItemId & item) +{ +// +// expands a TreeItem of the PostGIS View Type (SpatiaLite wrapper) +// + MyViewInfo list; + MyColumnInfo *col; + MyTriggerInfo *trgr; + wxString columnInfo; + wxTreeItemId item2; + wxString empty = wxEmptyString; + MyPostgresTable *table = NULL; + MyObject *obj = (MyObject *) GetItemData(item); + if (obj == NULL) + return; + wxString viewName = obj->GetVirtName(); + table = MainFrame->FindPostGisView(viewName); + + MainFrame->GetViewColumns(viewName, &list); + MainFrame->GetViewTriggers(viewName, &list); + col = list.GetFirst(); + while (col) + { + int icon = 3; + columnInfo = col->GetName(); + if (MainFrame->DoCheckPostGisGeometry(viewName, columnInfo) == true) + { + icon = 6; + item2 = AppendItem(item, columnInfo, icon); + SetItemData(item2, + (wxTreeItemData *) (new + MyObject(MY_POSTGIS_GEOMETRY, empty, + empty, -1, empty, empty, + empty, empty, columnInfo, + viewName))); + } else + { + if (table != NULL) + { + // checking for a PK column + if (table->IsPkColumn(columnInfo) == true) + icon = 2; + } + item2 = AppendItem(item, columnInfo, icon); + SetItemData(item2, + (wxTreeItemData *) (new + MyObject(MY_POSTGRES_COLUMN, empty, + empty, -1, empty, empty, + empty, empty, columnInfo, + viewName))); + } + col = col->GetNext(); + } + trgr = list.GetFirstTrigger(); + while (trgr) + { + // setting up Triggers + wxString triggerInfo = trgr->GetName(); + item2 = AppendItem(item, triggerInfo, 5); + SetItemData(item2, + (wxTreeItemData *) (new + MyObject(MY_TRIGGER, empty, + trgr->GetName()))); + trgr = trgr->GetNext(); + } +} void MyTableTree::AddTable(wxString & dbAlias, wxString & tableName, bool virtualTable, bool geometry, RootNodes * nodes) { @@ -1638,13 +1951,11 @@ // appends a table to the TREE list [ATTACHED DB] // wxTreeItemId item; wxTreeItemId item2; wxTreeItemData *data; - bool isCoverage = false; bool isTileData = false; - bool isTopology = false; int icon = 1; if (virtualTable == true) icon = 8; if (geometry == true) { @@ -1963,11 +2274,12 @@ // wxTreeItemId item = event.GetItem(); if (item == Root || item == RootUserData || item == RootTopologies || item == RootNetworks || item == RootRasterCoverages || item == RootVectorCoverages || item == RootStyling || item == RootWMS - || item == RootIsoMetadata || item == RootMetadata || item == RootInternal + || item == RootPostgreSQL || item == RootIsoMetadata + || item == RootMetadata || item == RootInternal || item == RootSpatialIndex) return; MyObject *obj = (MyObject *) GetItemData(item); if (obj == NULL) return; @@ -2222,10 +2534,37 @@ new wxMenuItem(&menu, Tree_UpdateLayerStatisticsAll, wxT("Update Layer &Statistics")); menu.Append(menuItem); PopupMenu(&menu, pt); } + +void MyTableTree::DoRootPostgreSqlContextMenu(wxPoint & pt) +{ +// MAIN: ROOT POTGRESQL context menu + wxMenuItem *menuItem; + CurrentItem = wxTreeItemId(); + wxMenu menu(wxT("PostgreSQL")); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = + new wxMenuItem(&menu, Tree_CreatePostgreSqlConn, + wxT("Connect to a PostgreSQL &DBMS")); + menu.Append(menuItem); + if (MainFrame->HasPostgreSqlConnections() == true) + { + menuItem = + new wxMenuItem(&menu, Tree_CloseAllPostgreSqlConns, + wxT("Close all connections to &PostgreSQL")); + menu.Append(menuItem); + } + menuItem = + new wxMenuItem(&menu, Tree_PostgreSqlDropOrphans, + wxT("Drop all PostgreSQL &Orphans")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} void MyTableTree::DoRootOthersContextMenu(wxPoint & pt, MyObject * obj) { // MAIN: OTHER ROOT NODES context menu wxMenuItem *menuItem; @@ -3388,17 +3727,201 @@ wxMenu menu(title); menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); menu.Append(menuItem); PopupMenu(&menu, pt); } + +void MyTableTree::DoPostgreSqlContextMenu(wxPoint & pt, MyObject * obj) +{ +// PostgreSQL objects: context menu dispatcher + switch (obj->GetType()) + { + case MY_POSTGRES_CONN: + DoPostgresConnContextMenu(pt, obj); + break; + case MY_POSTGRES_SCHEMA: + DoPostgresSchemaContextMenu(pt, obj); + break; + case MY_POSTGRES_TABLE: + DoPostgresTableContextMenu(pt, obj); + break; + case MY_POSTGRES_VIEW: + DoPostgresViewContextMenu(pt, obj); + break; + case MY_POSTGIS_VIEW: + DoPostGisViewContextMenu(pt, obj); + break; + case MY_POSTGRES_COLUMN: + DoPostgresColumnContextMenu(pt, obj); + break; + case MY_POSTGIS_GEOMETRY: + DoPostGisGeometryContextMenu(pt, obj); + break; + }; +} + +void MyTableTree::DoPostgresConnContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGRES CONNECTION NODES context menu + wxMenuItem *menuItem; + wxString title = wxT("PostgreSQL Connection"); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = + new wxMenuItem(&menu, Tree_ClosePostgreSqlConn, + wxT("Close this connection to PostgreSQL")); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("&Infos")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostgresSchemaContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGRES SCHEMA NODES context menu + wxMenuItem *menuItem; + wxString title = wxT("PostgreSQL Schema"); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("&Infos")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostgresTableContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGRES TABLE NODES context menu + wxMenuItem *menuItem; + wxString title = wxT("PostgreSQL Table: ") + obj->GetVirtName(); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + if (obj->IsReadOnly() == false && obj->HasPK() == true + && obj->CanInsertUpdateDelete() == true) + { + menuItem = new wxMenuItem(&menu, Tree_Edit, wxT("&Edit table rows")); + menu.Append(menuItem); + } else if (obj->CanSelect() == true) + { + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query table")); + menu.Append(menuItem); + } + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); + menu.Append(menuItem); + menuItem = + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostgresViewContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGRES VIEW NODES context menu + wxMenuItem *menuItem; + wxString title = wxT("PostgreSQL View: ") + obj->GetVirtName(); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + if (obj->CanSelect() == true) + { + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query View")); + menu.Append(menuItem); + } + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); + menu.Append(menuItem); + menuItem = + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostGisViewContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGIS VIEW NODES context menu + wxMenuItem *menuItem; + wxString title = wxT("PostGIS-to-SpatiaLite wrapper: ") + obj->GetVirtName(); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + if (obj->IsReadOnly() == false && obj->HasPK() == true + && obj->CanInsertUpdateDelete() == true) + { + menuItem = new wxMenuItem(&menu, Tree_Edit, wxT("&Edit table rows")); + menu.Append(menuItem); + } else if (obj->CanSelect() == true) + { + menuItem = new wxMenuItem(&menu, Tree_Select, wxT("&Query table")); + menu.Append(menuItem); + } + menuItem = new wxMenuItem(&menu, Tree_Show, wxT("&Show columns")); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_ShowSql, wxT("&Show CREATE statement")); + menu.Append(menuItem); + menuItem = + new wxMenuItem(&menu, Tree_PostgreSqlInfos, wxT("PostgreSQL &Infos")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostgresColumnContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGRESQL COLUMN NODES context menu + wxMenuItem *menuItem; + wxString title = + wxT("PostgreSQL Column: ") + obj->GetVirtName() + wxT(".") + + obj->GetColumn(); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} + +void MyTableTree::DoPostGisGeometryContextMenu(wxPoint & pt, MyObject * obj) +{ +// POSTGIS GEOMETRY COLUMN NODES context menu + wxMenuItem *menuItem; + wxString title = + wxT("PostGIS Geometry: ") + obj->GetVirtName() + wxT(".") + + obj->GetColumn(); + wxMenu menu(title); + menuItem = new wxMenuItem(&menu, Tree_Refresh, wxT("&Refresh")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = + new wxMenuItem(&menu, Tree_CheckGeometry, wxT("&Check geometries")); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_Extent, wxT("&Extent")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = new wxMenuItem(&menu, Tree_DumpShp, wxT("Export as &Shapefile")); + menuItem->SetBitmap(wxBitmap(dumpshp_xpm)); + menu.Append(menuItem); + menuItem = new wxMenuItem(&menu, Tree_DumpKml, wxT("Export as &KML")); + menu.Append(menuItem); + menu.AppendSeparator(); + menuItem = new wxMenuItem(&menu, Tree_MapPreview, wxT("&Map Preview")); + menuItem->SetBitmap(wxBitmap(map_preview_xpm)); + menu.Append(menuItem); + PopupMenu(&menu, pt); +} void MyTableTree::OnRightClick(wxTreeEvent & event) { // // right click on some node [mouse action] Context Menu // - wxMenuItem *menuItem; if (MainFrame->IsConnected() == false) return; bool metadata = MainFrame->CheckMetadata(); wxTreeItemId item = event.GetItem(); @@ -3440,10 +3963,16 @@ { // ROOT STYLING DoRootStylingContextMenu(pt); return; } + if (item == RootPostgreSQL) + { + // ROOT POSTGRESQL + DoRootPostgreSqlContextMenu(pt); + return; + } MyObject *obj = (MyObject *) GetItemData(item); if (obj == NULL) return; if (item == Root || item == RootUserData || item == RootIsoMetadata @@ -3465,10 +3994,16 @@ if (obj->IsRootAttached()) { // ATTACHED ROOT items DoRootAttachedContextMenu(pt, obj); return; + } +// special cases: PostgreSQL objects + if (obj->IsPostgreSQL() == true) + { + DoPostgreSqlContextMenu(pt, obj); + return; } // special cases: TOPO-GEO and TOPO-NET objects if (obj->GetType() == MY_TOPO_GEO || obj->GetType() == MY_TOPO_NET) { if (obj->IsAttached() == true) @@ -3868,10 +4403,52 @@ char *xname; char *xname2; MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW + || obj->GetType() == MY_POSTGIS_VIEW) + { + // special case: PostgreSQL objects + bool hasGeom = false; + wxString viewName; + if (obj->GetType() == MY_POSTGRES_TABLE) + { + MyPostgresTable *table = + MainFrame->FindPostgresTable(obj->GetVirtName()); + if (table->GetFirst() != NULL) + hasGeom = true; + viewName = table->GetPostGisName(); + } + if (hasGeom == true) + { + int ret = wxMessageBox(wxT + ("Directly querying a PostgreSQL table containing PostGIS geometries " + "is a strongly discouraged operation.\n\n" + "You should instead query the corresponding Spatial View: ") + + viewName + wxT("\n\n") + + wxT("Do you really intend to continue ?"), + wxT("spatialite_gui"), + wxYES_NO | wxICON_QUESTION, this); + if (ret != wxYES) + return; + } + sql = wxT("SELECT * FROM \""); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaDoubleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + sql += wxT("\""); + wxString prefix = wxT("MAIN"); + wxString noGeom; + MainFrame->InitializeSqlFilters(prefix, obj->GetVirtName(), true, noGeom); + MainFrame->SetSql(sql, true, false, dummy, dummy, true); + MainFrame->GetQueryView()->EnableFilterButton(); + return; + } sql = wxT("SELECT * FROM \""); if (obj->IsAttached() == true) { wxString dbAlias2 = obj->GetDbAlias(); MyFrame::DoubleQuoted(dbAlias2); @@ -4047,10 +4624,22 @@ xname2 = gaiaSingleQuotedSql(xname); free(xname); sql += wxString::FromUTF8(xname2); free(xname2); sql += wxT("'"); + } + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW + || obj->GetType() == MY_POSTGIS_VIEW) + { + sql = wxT("PRAGMA table_info(\""); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaDoubleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + sql += wxT("\")"); } if (sql.Len() < 1) return; MainFrame->GetRsView()->ResetEmpty(); MainFrame->SetSql(sql, true); @@ -4520,10 +5109,40 @@ sql += wxT("\nWHERE type = 'view' AND name = '"); xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); strcpy(xname, obj->GetMainName().ToUTF8()); xname2 = gaiaSingleQuotedSql(xname); free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + sql += wxT("'"); + MainFrame->GetRsView()->ResetEmpty(); + MainFrame->SetSql(sql, true); + } + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGRES_VIEW) + { + sql = wxT("SELECT sql FROM "); + sql += wxT("sqlite_master"); + sql += wxT("\nWHERE type = 'table' AND name = '"); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaSingleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + sql += wxT("'"); + MainFrame->GetRsView()->ResetEmpty(); + MainFrame->SetSql(sql, true); + } + if (obj->GetType() == MY_POSTGIS_VIEW) + { + sql = wxT("SELECT sql FROM "); + sql += wxT("sqlite_master"); + sql += wxT("\nWHERE type = 'view' AND name = '"); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaSingleQuotedSql(xname); + free(xname); sql += wxString::FromUTF8(xname2); free(xname2); sql += wxT("'"); MainFrame->GetRsView()->ResetEmpty(); MainFrame->SetSql(sql, true); @@ -5177,36 +5796,41 @@ MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; if (obj->GetType() == MY_COLUMN || obj->GetType() == MY_GEOMETRY || obj->GetType() == MY_GEOMETRY_INDEX - || obj->GetType() == MY_GEOMETRY_CACHED) + || obj->GetType() == MY_GEOMETRY_CACHED + || obj->GetType() == MY_POSTGIS_GEOMETRY) { sql = wxT("SELECT Count(*), GeometryType(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + { + xname = (char *) malloc((obj->GetColumn().Len() * 4) + 1); + strcpy(xname, obj->GetColumn().ToUTF8()); + } else + { + xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); + strcpy(xname, obj->GetColName().ToUTF8()); + } xname2 = gaiaDoubleQuotedSql(xname); free(xname); sql += wxString::FromUTF8(xname2); - free(xname2); sql += wxT("\"), Srid(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); sql += wxString::FromUTF8(xname2); - free(xname2); sql += wxT("\"), CoordDimension(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); sql += wxString::FromUTF8(xname2); free(xname2); sql += wxT("\")\nFROM \""); - xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); - strcpy(xname, obj->GetMainName().ToUTF8()); + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + { + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + } else + { + xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); + strcpy(xname, obj->GetMainName().ToUTF8()); + } xname2 = gaiaDoubleQuotedSql(xname); free(xname); sql += wxString::FromUTF8(xname2); free(xname2); sql += wxT("\"\nGROUP BY 2, 3, 4"); @@ -5231,43 +5855,43 @@ || obj->GetType() == MY_GEOMETRY_CACHED || obj->GetType() == MY_VIEW_GEOMETRY || obj->GetType() == MY_VIEW_GEOMETRY_INDEX || obj->GetType() == MY_VIEW_GEOMETRY_CACHED || obj->GetType() == MY_VIRTUAL_COLUMN - || obj->GetType() == MY_VIRTUAL_GEOMETRY) + || obj->GetType() == MY_VIRTUAL_GEOMETRY + || obj->GetType() == MY_POSTGIS_GEOMETRY) { sql = wxT("SELECT Min(MbrMinX(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + { + xname = (char *) malloc((obj->GetColumn().Len() * 4) + 1); + strcpy(xname, obj->GetColumn().ToUTF8()); + } else + { + xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); + strcpy(xname, obj->GetColName().ToUTF8()); + } xname2 = gaiaDoubleQuotedSql(xname); free(xname); sql += wxString::FromUTF8(xname2); - free(xname2); sql += wxT("\")), Min(MbrMinY(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); sql += wxString::FromUTF8(xname2); - free(xname2); sql += wxT("\")), Max(MbrMaxX(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); sql += wxString::FromUTF8(xname2); - free(xname2); sql += wxT("\")), Max(MbrMaxY(\""); - xname = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(xname, obj->GetColName().ToUTF8()); - xname2 = gaiaDoubleQuotedSql(xname); - free(xname); sql += wxString::FromUTF8(xname2); free(xname2); sql += wxT("\"))\nFROM \""); - xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); - strcpy(xname, obj->GetMainName().ToUTF8()); + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + { + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + } else + { + xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); + strcpy(xname, obj->GetMainName().ToUTF8()); + } xname2 = gaiaDoubleQuotedSql(xname); free(xname); sql += wxString::FromUTF8(xname2) + wxT("\""); free(xname2); MainFrame->GetRsView()->ResetEmpty(); @@ -5612,20 +6236,23 @@ // int ret; wxString path; wxString lastDir; bool isView = false; + bool isPostGIS = false; int metadata_type = MainFrame->GetMetaDataType(); MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + isPostGIS = true; if (obj->GetType() == MY_VIEW_GEOMETRY || obj->GetType() == MY_VIEW_GEOMETRY_INDEX || obj->GetType() == MY_VIEW_GEOMETRY_CACHED) isView = true; if (obj->GetType() == MY_GEOMETRY || obj->GetType() == MY_GEOMETRY_INDEX - || obj->GetType() == MY_GEOMETRY_CACHED || isView == true) + || obj->GetType() == MY_GEOMETRY_CACHED || isView == true || isPostGIS) { wxFileDialog fileDialog(this, wxT("Dump Shapefile"), wxT(""), wxT("shapefile.shp"), wxT ("Shapefile (*.shp)|*.shp|All files (*.*)|*.*"), @@ -5654,13 +6281,60 @@ path = file.GetPath(); path += file.GetPathSeparator(); path += file.GetName(); lastDir = file.GetPath(); strcpy(x_path, path.ToUTF8()); - strcpy(x_table, obj->GetMainName().ToUTF8()); - strcpy(x_column, obj->GetColName().ToUTF8()); - if (isView == true) + if (isPostGIS == true) + { + strcpy(x_table, obj->GetVirtName().ToUTF8()); + strcpy(x_column, obj->GetColumn().ToUTF8()); + } else + { + strcpy(x_table, obj->GetMainName().ToUTF8()); + strcpy(x_column, obj->GetColName().ToUTF8()); + } + if (isPostGIS == true) + { + char *geom = (char *) malloc(obj->GetColumn().Len() * 4 + 1); + strcpy(geom, obj->GetColumn().ToUTF8()); + char *xgeom = gaiaDoubleQuotedSql(geom); + free(geom); + char *view = (char *) malloc(obj->GetVirtName().Len() * 4 + 1); + strcpy(view, obj->GetVirtName().ToUTF8()); + char *xview = gaiaDoubleQuotedSql(view); + free(view); + char *sql = sqlite3_mprintf("SELECT GeometryType(\"%s\") " + "FROM \"%s\" GROUP BY 1", xgeom, + xview); + free(xgeom); + free(xview); + ret = + sqlite3_get_table(MainFrame->GetSqlite(), sql, + &results, &rows, &columns, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("dump shapefile error:") + + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, + this); + sqlite3_free(errMsg); + return; + } + if (rows < 1) + ; + else + { + for (i = 1; i <= rows; i++) + strcpy(x_type, results[(i * columns) + 0]); + } + sqlite3_free_table(results); + if (strcmp(x_type, "MULTILINESTRING") == 0) + strcpy(x_type, "LINESTRING"); + if (strcmp(x_type, "MULTIPOLYGON") == 0) + strcpy(x_type, "POLYGON"); + } else if (isView == true) { wxString sql; char *xsql; if (metadata_type == METADATA_CURRENT) sql = @@ -5874,12 +6548,16 @@ wxOK | wxICON_ERROR, this); } else { // asking the charset to be used DumpShpDialog dlg; - dlg.Create(MainFrame, path, obj->GetMainName(), obj->GetColName(), - MainFrame->GetDefaultCharset()); + if (isPostGIS == true) + dlg.Create(MainFrame, path, obj->GetVirtName(), + obj->GetColumn(), MainFrame->GetDefaultCharset()); + else + dlg.Create(MainFrame, path, obj->GetMainName(), + obj->GetColName(), MainFrame->GetDefaultCharset()); ret = dlg.ShowModal(); if (ret == wxID_OK) { MainFrame->SetLastDirectory(lastDir); ::wxBeginBusyCursor(); @@ -5913,30 +6591,36 @@ int ret; wxString path; wxString lastDir; bool isView = false; bool isVirtual = false; + bool isPostGIS = false; bool isNameConst = false; bool isDescConst = false; wxString Name; wxString Desc; int precision = -1; MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + isPostGIS = true; if (obj->GetType() == MY_VIEW_GEOMETRY || obj->GetType() == MY_VIEW_GEOMETRY_INDEX || obj->GetType() == MY_VIEW_GEOMETRY_CACHED) isView = true; if (obj->GetType() == MY_VIRTUAL_GEOMETRY) isVirtual = true; if (obj->GetType() == MY_GEOMETRY || obj->GetType() == MY_GEOMETRY_INDEX || obj->GetType() == MY_GEOMETRY_CACHED || isView == true - || isVirtual == true) + || isVirtual == true || isPostGIS == true) { DumpKmlDialog dlg; - dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName()); + if (isPostGIS == true) + dlg.Create(MainFrame, obj->GetVirtName(), obj->GetColumn()); + else + dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName()); ret = dlg.ShowModal(); if (ret == wxID_OK) { isNameConst = dlg.IsNameConst(); Name = dlg.GetName(); @@ -5964,12 +6648,16 @@ path += file.GetName(); path += wxT(".kml"); lastDir = file.GetPath(); MainFrame->SetLastDirectory(lastDir); ::wxBeginBusyCursor(); - MainFrame->DumpKml(path, obj->GetMainName(), obj->GetColName(), - precision, Name, isNameConst, Desc, isDescConst); + if (isPostGIS == true) + MainFrame->DumpKml(path, obj->GetVirtName(), obj->GetColumn(), + precision, Name, isNameConst, Desc, isDescConst); + else + MainFrame->DumpKml(path, obj->GetMainName(), obj->GetColName(), + precision, Name, isNameConst, Desc, isDescConst); ::wxEndBusyCursor(); } } } @@ -6938,20 +7626,32 @@ sqlite3_stmt *stmt; double minx = DBL_MAX; double miny = DBL_MAX; double maxx = DBL_MAX; double maxy = DBL_MAX; + bool isPostGIS = false; MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; + if (obj->GetType() == MY_POSTGIS_GEOMETRY) + isPostGIS = true; ::wxBeginBusyCursor(); - table_name = (char *) malloc((obj->GetMainName().Len() * 4) + 1); - strcpy(table_name, obj->GetMainName().ToUTF8()); - column_name = (char *) malloc((obj->GetColName().Len() * 4) + 1); - strcpy(column_name, obj->GetColName().ToUTF8()); + if (isPostGIS == true) + { + table_name = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(table_name, obj->GetVirtName().ToUTF8()); + column_name = (char *) malloc((obj->GetColumn().Len() * 4) + 1); + strcpy(column_name, obj->GetColumn().ToUTF8()); + } else + { + table_name = (char *) malloc((obj->GetMainName().Len() * 4) + 1); + strcpy(table_name, obj->GetMainName().ToUTF8()); + column_name = (char *) malloc((obj->GetColName().Len() * 4) + 1); + strcpy(column_name, obj->GetColName().ToUTF8()); + } table_name2 = gaiaDoubleQuotedSql(table_name); column_name2 = gaiaDoubleQuotedSql(column_name); free(table_name); free(column_name); sprintf(sql, "SELECT Min(MbrMinX(\"%s\")), Min(MbrMinY(\"%s\")), ", @@ -7015,12 +7715,16 @@ wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); return; } MapPreviewDialog dlg; - dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName(), minx, miny, maxx, - maxy); + if (isPostGIS == true) + dlg.Create(MainFrame, obj->GetVirtName(), obj->GetColumn(), minx, miny, + maxx, maxy); + else + dlg.Create(MainFrame, obj->GetMainName(), obj->GetColName(), minx, miny, + maxx, maxy); dlg.ShowModal(); } void MyTableTree::OnCmdColumnStats(wxCommandEvent & WXUNUSED(event)) { @@ -8573,20 +9277,108 @@ int pb = 0; int primaryKeys[1024]; int blobCols[1024]; char *xname; char *xname2; - bool isView; + bool isView = false; for (i = 0; i < 1024; i++) { primaryKeys[i] = -1; blobCols[i] = -1; } primaryKeys[pk++] = 0; MyObject *obj = (MyObject *) GetItemData(CurrentItem); if (obj == NULL) return; + if (obj->GetType() == MY_POSTGRES_TABLE || obj->GetType() == MY_POSTGIS_VIEW) + { + // special case: PostgreSQL table + bool hasGeom = false; + wxString viewName; + if (obj->GetType() == MY_POSTGRES_TABLE) + { + MyPostgresTable *table = + MainFrame->FindPostgresTable(obj->GetVirtName()); + if (table->GetFirst() != NULL) + hasGeom = true; + viewName = table->GetPostGisName(); + } + if (hasGeom == true) + { + int ret = wxMessageBox(wxT + ("Directly editing a PostgreSQL table containing PostGIS geometries " + "is a strongly discouraged operation.\n\n" + "You should instead edit the corresponding Spatial View: ") + + viewName + wxT("\n\n") + + wxT("Do you really intend to continue ?"), + wxT("spatialite_gui"), + wxYES_NO | wxICON_QUESTION, this); + if (ret != wxYES) + return; + } + sql = wxT("PRAGMA table_info(\""); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaDoubleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + sql += wxT("\")"); + xsql = (char *) malloc((sql.Len() * 4) + 1); + strcpy(xsql, sql.ToUTF8()); + int ret = sqlite3_get_table(MainFrame->GetSqlite(), xsql, &results, + &rows, &columns, &errMsg); + free(xsql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("SQLite SQL error: ") + wxString::FromUTF8(errMsg), + wxT("spatialite_gui"), wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + return; + } + if (rows < 1) + ; + else + { + sql = wxT("SELECT ROWID, "); + for (i = 1; i <= rows; i++) + { + column = results[(i * columns) + 1]; + sql += wxT("\""); + xname = (char *) malloc(strlen(column) + 1); + strcpy(xname, column); + xname2 = gaiaDoubleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + sql += wxT("\""); + free(xname2); + type = results[(i * columns) + 2]; + if (i < rows) + sql += wxT(", "); + } + } + sqlite3_free_table(results); + if (sql.Len() < 1) + return; + sql += wxT("\nFROM \""); + xname = (char *) malloc((obj->GetVirtName().Len() * 4) + 1); + strcpy(xname, obj->GetVirtName().ToUTF8()); + xname2 = gaiaDoubleQuotedSql(xname); + free(xname); + sql += wxString::FromUTF8(xname2); + free(xname2); + if (isView != true) + sql += wxT("\"\nORDER BY ROWID"); + else + sql += wxT("\""); + wxString prefix = wxT("MAIN"); + wxString noGeom; + MainFrame->InitializeSqlFilters(prefix, obj->GetVirtName(), false, + noGeom); + MainFrame->EditTable(sql, primaryKeys, blobCols, obj->GetVirtName()); + return; + } isView = MainFrame->IsView(obj->GetMainName()); sql = wxT("PRAGMA table_info(\""); xname = (char *) malloc((obj->GetMainName().Len() * 4) + 1); strcpy(xname, obj->GetMainName().ToUTF8()); xname2 = gaiaDoubleQuotedSql(xname); @@ -10120,10 +10912,222 @@ ::wxEndBusyCursor(); wxMessageBox(wxT("Error: unable to remove Topology-Network '") + obj->GetMainName() + wxT("'"), wxT("spatialite_gui"), wxOK | wxICON_WARNING, this); } + +void MyTableTree::OnCmdCreatePostgreSqlConn(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - creating a new connection to a PostgreSQL DBMS +// + MainFrame->DoPostgreSqlConnection(); +} + +void MyTableTree::OnCmdCloseAllPostgreSqlConns(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - closing all connections to PostgreSQL +// + ::wxBeginBusyCursor(); + MainFrame->AutoPostgresStop(); + ::wxEndBusyCursor(); + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); + AddPendingEvent(evt); +} + +void MyTableTree::OnCmdClosePostgreSqlConn(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - closing a connection to PostgreSQL +// + MyObject *obj = (MyObject *) GetItemData(CurrentItem); + ::wxBeginBusyCursor(); + bool ret = + MainFrame->DoClosePostgreSqlConn(obj->GetHost(), obj->GetHostAddr(), + obj->GetPort(), obj->GetDbName(), + obj->GetUser()); + ::wxEndBusyCursor(); + if (ret == true) + { + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); + AddPendingEvent(evt); + } +} + +void MyTableTree::OnCmdPostgreSqlDropOrphans(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - Dropping all PostgreSQL orphans +// + bool refresh = false; + int ret; + char *errMsg = NULL; + ::wxBeginBusyCursor(); + char *sql = MainFrame->DropPostgreSqlOrphans(); + if (sql != NULL) + { + // exec + ret = sqlite3_exec(MainFrame->GetSqlite(), sql, NULL, 0, &errMsg); + sqlite3_free(sql); + if (ret != SQLITE_OK) + { + wxMessageBox(wxT("DropPostgresOrphans: ") + + wxString::FromUTF8(errMsg), wxT("spatialite_gui"), + wxOK | wxICON_ERROR, this); + sqlite3_free(errMsg); + return; + } + refresh = true; + } + ::wxEndBusyCursor(); + if (refresh == true) + { + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, Tree_RefreshDeferred); + AddPendingEvent(evt); + } +} + +void MyTableTree::OnCmdPostgreSqlInfos(wxCommandEvent & WXUNUSED(event)) +{ +// +// menu event - Infos about some PostgreSQL object +// + char dummy[128]; + wxString msg; + MyPostgresTable *table; + MyObject *obj = (MyObject *) GetItemData(CurrentItem); + switch (obj->GetType()) + { + case MY_POSTGRES_CONN: + msg = wxT("Connection to PostgreSQL\n\n"); + msg += wxT("Host: ") + obj->GetHost() + wxT("\n"); + msg += wxT("HostAddr: ") + obj->GetHostAddr() + wxT("\n"); + sprintf(dummy, "%d", obj->GetPort()); + msg += wxT("Port: ") + wxString::FromUTF8(dummy) + wxT("\n"); + msg += wxT("DbName: ") + obj->GetDbName() + wxT("\n"); + msg += wxT("User: ") + obj->GetUser() + wxT("\n\n"); + if (obj->IsReadOnly() == true) + msg += wxT("READ-ONLY Connection"); + else + msg += wxT("READ-WRITE Connection"); + break; + case MY_POSTGRES_SCHEMA: + msg += wxT("Role: PostgreSQL Schema\n"); + msg += wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT("\n"); + break; + case MY_POSTGRES_TABLE: + msg += wxT("Role: PostgreSQL Table\n"); + msg += + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + + obj->GetName() + wxT("\n\n"); + table = MainFrame->FindPostgresTable(obj->GetVirtName()); + if (table != NULL) + { + MyPostGisGeometry *geom = table->GetFirst(); + while (geom != NULL) + { + msg += wxT("PostGIS Geometry: ") + geom->GetName(); + msg += wxT(" ") + geom->GetGeomType(); + char dummy[64]; + sprintf(dummy, "%d", geom->GetSrid()); + wxString xSrid = wxString::FromUTF8(dummy); + msg += wxT(" srid=") + xSrid; + sprintf(dummy, "%d", geom->GetDims()); + wxString xDims = wxString::FromUTF8(dummy); + msg += wxT(" dims=") + xDims + wxT("\n"); + geom = geom->GetNext(); + } + if (table->GetFirst() != NULL) + msg += wxT("\n"); + } + if (obj->HasPK() == true) + msg += wxT("Primary Key: YES\n"); + else + msg += wxT("Primary Key: NO\n"); + if (obj->CanSelect() == true) + msg += wxT("Select permission: YES\n"); + else + msg += wxT("Select permission: NO\n"); + if (obj->CanInsertUpdateDelete() == true) + msg += wxT("Insert/Update/Delete permission: YES\n"); + else + msg += wxT("Insert/Update/Delete permission: NO\n"); + wxT("\n"); + if (obj->IsReadOnly() == true) + msg += wxT("\nREAD-ONLY Connection"); + else + msg += wxT("\nREAD-WRITE Connection"); + break; + case MY_POSTGRES_VIEW: + msg += wxT("Role: PostgreSQL View\n"); + msg += + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + + obj->GetName() + wxT("\n\n"); + if (obj->HasPK() == true) + msg += wxT("Primary Key: YES\n"); + else + msg += wxT("Primary Key: NO\n"); + if (obj->CanSelect() == true) + msg += wxT("Select permission: YES\n"); + else + msg += wxT("Select permission: NO\n"); + if (obj->CanInsertUpdateDelete() == true) + msg += wxT("Insert/Update/Delete permission: YES\n"); + else + msg += wxT("Insert/Update/Delete permission: NO\n"); + if (obj->IsReadOnly() == true) + msg += wxT("\nREAD-ONLY Connection"); + else + msg += wxT("\nREAD-WRITE Connection"); + break; + case MY_POSTGIS_VIEW: + msg += wxT("Role: PostGIS Table wrapper (Spatial View)\n"); + msg += + wxT("PostgreSQL Name: ") + obj->GetSchema() + wxT(".") + + obj->GetName() + wxT("\n\n"); + table = MainFrame->FindPostGisView(obj->GetVirtName()); + if (table != NULL) + { + MyPostGisGeometry *geom = table->GetFirst(); + while (geom != NULL) + { + msg += wxT("PostGIS Geometry: ") + geom->GetName(); + msg += wxT(" ") + geom->GetGeomType(); + char dummy[64]; + sprintf(dummy, "%d", geom->GetSrid()); + wxString xSrid = wxString::FromUTF8(dummy); + msg += wxT(" srid=") + xSrid; + sprintf(dummy, "%d", geom->GetDims()); + wxString xDims = wxString::FromUTF8(dummy); + msg += wxT(" dims=") + xDims + wxT("\n"); + geom = geom->GetNext(); + } + if (table->GetFirst() != NULL) + msg += wxT("\n"); + } + if (obj->HasPK() == true) + msg += wxT("Primary Key: YES\n"); + else + msg += wxT("Primary Key: NO\n"); + if (obj->CanSelect() == true) + msg += wxT("Select permission: YES\n"); + else + msg += wxT("Select permission: NO\n"); + if (obj->CanInsertUpdateDelete() == true) + msg += wxT("Insert/Update/Delete permission: YES\n"); + else + msg += wxT("Insert/Update/Delete permission: NO\n"); + if (obj->IsReadOnly() == true) + msg += wxT("\nREAD-ONLY Connection"); + else + msg += wxT("\nREAD-WRITE Connection"); + break; + }; + if (msg.Len() > 0) + wxMessageBox(msg, wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); +} sqlite3 *MyTableTree::GetSQLiteHandle() { return MainFrame->GetSqlite(); } Index: TextCsv.cpp ================================================================== --- TextCsv.cpp +++ TextCsv.cpp @@ -2,11 +2,11 @@ / TextCsv.cpp / methods related to CSV/TXT loading / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by Index: VectorSymbolizers1.cpp ================================================================== --- VectorSymbolizers1.cpp +++ VectorSymbolizers1.cpp @@ -2,11 +2,11 @@ / VectorSymbolizers1.cpp / various dialog classes / / version 1.8, 2015 March 28 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2015 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -10050,11 +10050,10 @@ sqlite3_free(xml); if (ret == true) wxMessageBox(wxT ("SLD/SE VectorSymbolizer successfully registered into the DBMS"), wxT("spatialite_gui"), wxOK | wxICON_INFORMATION, this); - wxDialog::EndModal(wxID_OK); wxDialog::EndModal(wxID_OK); } void SimplePolygonSymbolizerDialog::OnExport(wxCommandEvent & WXUNUSED(event)) { Index: VectorSymbolizers2.cpp ================================================================== --- VectorSymbolizers2.cpp +++ VectorSymbolizers2.cpp @@ -2,11 +2,11 @@ / VectorSymbolizers2.cpp / various dialog classes / / version 1.8, 2015 April 21 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2015 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -5498,14 +5498,23 @@ xml = sqlite3_mprintf("%s\t\t\t\r\n", prev); sqlite3_free(prev); prev = xml; str = new char[strlen(FontFamily.ToUTF8()) + 1]; strcpy(str, FontFamily.ToUTF8()); + const char *font; + if (strcmp(str, "ToyFont: serif") == 0) + font = "serif"; + else if (strcmp(str, "ToyFont: sans-serif") == 0) + font = "sans serif"; + else if (strcmp(str, "ToyFont: monospace") == 0) + font = "monospace"; + else + font = str; xml = sqlite3_mprintf ("%s\t\t\t\t%s\r\n", prev, - str); + font); delete[]str; sqlite3_free(prev); prev = xml; if (FontStyle == RL2_FONTSTYLE_ITALIC) xml = @@ -5816,14 +5825,23 @@ xml = sqlite3_mprintf("%s\t\r\n", prev); sqlite3_free(prev); prev = xml; str = new char[strlen(FontFamily.ToUTF8()) + 1]; strcpy(str, FontFamily.ToUTF8()); + const char *font; + if (strcmp(str, "ToyFont: serif") == 0) + font = "serif"; + else if (strcmp(str, "ToyFont: sans-serif") == 0) + font = "sans serif"; + else if (strcmp(str, "ToyFont: monospace") == 0) + font = "monospace"; + else + font = str; xml = sqlite3_mprintf ("%s\t\t%s\r\n", prev, - str); + font); delete[]str; sqlite3_free(prev); prev = xml; if (FontStyle == RL2_FONTSTYLE_ITALIC) xml = Index: Wfs.cpp ================================================================== --- Wfs.cpp +++ Wfs.cpp @@ -2,11 +2,11 @@ / Wfs.cpp / WFS load data / / version 1.7, 2013 May 8 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2008-2013 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by Index: WmsDialog.cpp ================================================================== --- WmsDialog.cpp +++ WmsDialog.cpp @@ -2,11 +2,11 @@ / WmsDialog.cpp / various dialog classes supporting WMS datasources / / version 2.0, 2016 December 13 / -/ Author: Sandro Furieri a-furieri@lqt.it +/ Author: Sandro Furieri a.furieri@lqt.it / / Copyright (C) 2016 Alessandro Furieri / / This program is free software: you can redistribute it and/or modify / it under the terms of the GNU General Public License as published by @@ -699,11 +699,11 @@ { // // searching a registered WMS server // WmsServersDialog dlg; - dlg.Create(this, MainFrame); + dlg.Create(MainFrame); int ret = dlg.ShowModal(); if (ret == wxID_OK) { wxTextCtrl *urlCtrl = (wxTextCtrl *) FindWindow(ID_WMS_URL); urlCtrl->SetValue(dlg.GetURL()); @@ -1158,11 +1158,11 @@ wxTextCtrl *urlCtrl = (wxTextCtrl *) FindWindow(ID_WMS_URL); URL = urlCtrl->GetValue(); wxDialog::EndModal(wxID_OK); } -bool WmsServersDialog::Create(WmsDialog * parent, MyFrame * grandparent) +bool WmsServersDialog::Create(MyFrame * grandparent) { // // creating the dialog // MainFrame = grandparent; @@ -1806,11 +1806,10 @@ // sets dialog sizer GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); // centers the dialog window Centre(); - int count = 0; return true; } void WmsLayerInfosDialog::CreateControls() { @@ -2172,10 +2171,26 @@ } } DoUpdateWmsLayer(); wxDialog::EndModal(wxID_OK); } + +WmsLayerConfigDialog::~WmsLayerConfigDialog() +{ + if (Version != NULL) + free(Version); + if (MaxVersion != NULL) + free(MaxVersion); + if (RefSys != NULL) + free(RefSys); + if (Style != NULL) + free(Style); + if (ImageFormat != NULL) + free(ImageFormat); + if (BgColor != NULL) + free(BgColor); +} bool WmsLayerConfigDialog::Create(MyFrame * parent, wxString url, wxString layer) { // @@ -2740,11 +2755,10 @@ "FROM \"%s\".wms_getmap WHERE url = %Q AND layer_name = %Q", xdb_prefix, url, layer); free(url); free(layer); free(xdb_prefix); - fprintf(stderr, "%s\n", sql); ret = sqlite3_get_table(MainFrame->GetSqlite(), sql, &results, &rows, &columns, NULL); sqlite3_free(sql); if (ret != SQLITE_OK) @@ -2826,12 +2840,12 @@ BgColor = NULL; else { if (strlen(bgcolor) == 6) { - BgColor = (char *) malloc(6); - memcpy(BgColor, bgcolor, 6); + BgColor = (char *) malloc(7); + strcpy(BgColor, bgcolor); } else BgColor = NULL; } } sqlite3_free_table(results); @@ -3091,12 +3105,12 @@ wxBitmapButton *btn = (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); if (BgColorEnabled == false) { if (BgColor != NULL) free(BgColor); - BgColor = (char *) malloc(6); - memcpy(BgColor, "ffffff", 6); + BgColor = (char *) malloc(7); + strcpy(BgColor, "ffffff"); wxBitmap bmp; GetButtonBitmap(BgColor, bmp); btn->SetBitmapLabel(bmp); BgColorEnabled = true; btn->Enable(true); @@ -3135,10 +3149,11 @@ memcpy(BgColor, byte, 2); sprintf(byte, "%02x", color.Green()); memcpy(BgColor + 2, byte, 2); sprintf(byte, "%02x", color.Blue()); memcpy(BgColor + 4, byte, 2); + *(BgColor + 6) = '\0'; wxBitmap bmp; GetButtonBitmap(BgColor, bmp); wxBitmapButton *bgColorCtrl = (wxBitmapButton *) FindWindow(ID_WMS_BGCOLOR); bgColorCtrl->SetBitmapLabel(bmp); Index: aclocal.m4 ================================================================== --- aclocal.m4 +++ aclocal.m4 @@ -1,8 +1,8 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,13 +18,13 @@ [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -294,11 +294,79 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -309,11 +377,11 @@ # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- @@ -325,18 +393,18 @@ # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -384,11 +452,11 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -415,11 +483,11 @@ [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -606,11 +674,11 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -682,11 +750,11 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -879,11 +947,11 @@ _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -900,11 +968,11 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -922,11 +990,11 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -957,11 +1025,11 @@ ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1007,11 +1075,11 @@ rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1048,11 +1116,11 @@ # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1075,11 +1143,11 @@ [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1104,11 +1172,11 @@ # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1151,11 +1219,11 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1170,11 +1238,11 @@ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1251,11 +1319,11 @@ fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1311,11 +1379,11 @@ AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1339,11 +1407,11 @@ AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -1358,11 +1426,11 @@ # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. Index: config.h ================================================================== --- config.h +++ config.h @@ -67,10 +67,13 @@ /* Define to 1 if you have the `CharLS' library (-lCharLS). */ #define HAVE_LIBCHARLS 1 /* Define to 1 if you have the `openjp2' library (-lopenjp2). */ #define HAVE_LIBOPENJP2 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBPQ_FE_H 1 /* Define to 1 if you have the `proj' library (-lproj). */ #define HAVE_LIBPROJ 1 /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ @@ -97,11 +100,17 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_OPENJPEG_2_0_OPENJPEG_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENJPEG_2_1_OPENJPEG_H 1 +/* #undef HAVE_OPENJPEG_2_1_OPENJPEG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENJPEG_2_2_OPENJPEG_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENJPEG_2_3_OPENJPEG_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SQLITE3EXT_H 1 /* Define to 1 if you have the header file. */ @@ -156,10 +165,13 @@ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 + +/* Should be defined in order to enable LibPQ late binding. */ +/* #undef LIBPQ_DEFERRED */ /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 @@ -177,13 +189,10 @@ /* #undef OMIT_OPENJPEG */ /* Should be defined in order to disable WebP support. */ /* #undef OMIT_WEBP */ -/* testing for OpenJpeg 2.1 */ -#define OPENJPEG_2_1 1 - /* Name of package */ #define PACKAGE "spatialite_gui" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "a.furieri@lqt.it" Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -66,10 +66,13 @@ /* Define to 1 if you have the `CharLS' library (-lCharLS). */ #undef HAVE_LIBCHARLS /* Define to 1 if you have the `openjp2' library (-lopenjp2). */ #undef HAVE_LIBOPENJP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBPQ_FE_H /* Define to 1 if you have the `proj' library (-lproj). */ #undef HAVE_LIBPROJ /* Define to 1 if you have the `sqlite3' library (-lsqlite3). */ @@ -97,10 +100,16 @@ /* Define to 1 if you have the header file. */ #undef HAVE_OPENJPEG_2_0_OPENJPEG_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENJPEG_2_1_OPENJPEG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENJPEG_2_2_OPENJPEG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENJPEG_2_3_OPENJPEG_H /* Define to 1 if you have the header file. */ #undef HAVE_SQLITE3EXT_H /* Define to 1 if you have the header file. */ @@ -155,10 +164,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H + +/* Should be defined in order to enable LibPQ late binding. */ +#undef LIBPQ_DEFERRED /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK @@ -176,13 +188,10 @@ #undef OMIT_OPENJPEG /* Should be defined in order to disable WebP support. */ #undef OMIT_WEBP -/* testing for OpenJpeg 2.1 */ -#undef OPENJPEG_2_1 - /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT Index: configure ================================================================== --- configure +++ configure @@ -633,10 +633,16 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS OMIT_SQLITE_STMTSTATUS_AUTOINDEX_FLAGS +PG_LIB +PG_LDFLAGS +PG_CFLAGS +PGCONFIG +LIBVIRTUALPG_LIBS +LIBVIRTUALPG_CFLAGS LIBRASTERLITE2_LIBS LIBRASTERLITE2_CFLAGS LIBSPATIALITE_LIBS LIBSPATIALITE_CFLAGS LIBLZMA_LIBS @@ -797,10 +803,12 @@ enable_freexl enable_libxml2 enable_openjpeg enable_webp enable_charls +with_pgconfig +with_libpq_deferred enable_sqlite_stmtstatus_autoindex ' ac_precious_vars='build_alias host_alias target_alias @@ -826,11 +834,13 @@ LIBLZMA_CFLAGS LIBLZMA_LIBS LIBSPATIALITE_CFLAGS LIBSPATIALITE_LIBS LIBRASTERLITE2_CFLAGS -LIBRASTERLITE2_LIBS' +LIBRASTERLITE2_LIBS +LIBVIRTUALPG_CFLAGS +LIBVIRTUALPG_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false @@ -1477,10 +1487,12 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-wxconfig=FILE specify an alternative wx-config file --with-geosconfig=FILE specify an alternative geos-config file + --with-pgconfig=FILE specify an alternative pg_config file + --with-libpq_deferred enables libpq late binding [default=no] Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a @@ -1519,10 +1531,14 @@ linker flags for LIBSPATIALITE, overriding pkg-config LIBRASTERLITE2_CFLAGS C compiler flags for LIBRASTERLITE2, overriding pkg-config LIBRASTERLITE2_LIBS linker flags for LIBRASTERLITE2, overriding pkg-config + LIBVIRTUALPG_CFLAGS + C compiler flags for LIBVIRTUALPG, overriding pkg-config + LIBVIRTUALPG_LIBS + linker flags for LIBVIRTUALPG, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -17066,10 +17082,12 @@ if test x"$enable_openjpeg" != "xno"; then # # testing OpenJpeg-2 headers # they could be either on -/include/openjpeg-2.0 # or on -/include/openjpeg-2.1 + # or on -/include/openjpeg-2.2 + # or on -/include/openjpeg-2.3 # for ac_header in openjpeg-2.0/openjpeg.h do : ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.0/openjpeg.h" "ac_cv_header_openjpeg_2_0_openjpeg_h" "$ac_includes_default" if test "x$ac_cv_header_openjpeg_2_0_openjpeg_h" = xyes; then : @@ -17090,13 +17108,39 @@ _ACEOF fi done + + for ac_header in openjpeg-2.2/openjpeg.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.2/openjpeg.h" "ac_cv_header_openjpeg_2_2_openjpeg_h" "$ac_includes_default" +if test "x$ac_cv_header_openjpeg_2_2_openjpeg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENJPEG_2_2_OPENJPEG_H 1 +_ACEOF + +fi + +done + + for ac_header in openjpeg-2.3/openjpeg.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "openjpeg-2.3/openjpeg.h" "ac_cv_header_openjpeg_2_3_openjpeg_h" "$ac_includes_default" +if test "x$ac_cv_header_openjpeg_2_3_openjpeg_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_OPENJPEG_2_3_OPENJPEG_H 1 +_ACEOF + +fi + +done if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" && - test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes"; + test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" && + test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes" && + test x"$ac_cv_header_openjpeg_2_3_openjpeg_h" != x"yes"; then as_fn_error $? "'OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opj_create_decompress in -lopenjp2" >&5 $as_echo_n "checking for opj_create_decompress in -lopenjp2... " >&6; } @@ -17143,39 +17187,10 @@ else as_fn_error $? "'libopenjp2' is required but it doesn't seems to be installed on this system." "$LINENO" 5 fi - # testing for OpenJpeg 2.0 or 2.1 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H - #include - #else - #include - #endif -int -main () -{ -void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - $as_echo "#define OPENJPEG_2_1 1" >>confdefs.h - - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "#define OMIT_OPENJPEG 1" >>confdefs.h fi #----------------------------------------------------------------------- @@ -17572,11 +17587,248 @@ $as_echo "yes" >&6; } fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVIRTUALPG" >&5 +$as_echo_n "checking for LIBVIRTUALPG... " >&6; } + +if test -n "$LIBVIRTUALPG_CFLAGS"; then + pkg_cv_LIBVIRTUALPG_CFLAGS="$LIBVIRTUALPG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"virtualpg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "virtualpg") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBVIRTUALPG_CFLAGS=`$PKG_CONFIG --cflags "virtualpg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBVIRTUALPG_LIBS"; then + pkg_cv_LIBVIRTUALPG_LIBS="$LIBVIRTUALPG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"virtualpg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "virtualpg") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBVIRTUALPG_LIBS=`$PKG_CONFIG --libs "virtualpg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBVIRTUALPG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "virtualpg" 2>&1` + else + LIBVIRTUALPG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "virtualpg" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBVIRTUALPG_PKG_ERRORS" >&5 + + as_fn_error $? "'libvirtualpg' is required but it doesn't seem to be installed on this system." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "'libvirtualpg' is required but it doesn't seem to be installed on this system." "$LINENO" 5 +else + LIBVIRTUALPG_CFLAGS=$pkg_cv_LIBVIRTUALPG_CFLAGS + LIBVIRTUALPG_LIBS=$pkg_cv_LIBVIRTUALPG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --with-pgconfig +# + +# Check whether --with-pgconfig was given. +if test "${with_pgconfig+set}" = set; then : + withval=$with_pgconfig; PGCONFIG="$withval" +else + PGCONFIG="" +fi + +if test "x$PGCONFIG" = "x"; then + # PGCONFIG was not specified, so search within the current path + # Extract the first word of "pg_config", so it can be a program name with args. +set dummy pg_config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PGCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PGCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PGCONFIG="$PGCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PGCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PGCONFIG=$ac_cv_path_PGCONFIG +if test -n "$PGCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PGCONFIG" >&5 +$as_echo "$PGCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # If we couldn't find pg_config, display an error + if test "x$PGCONFIG" = "x"; then + 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 + fi +else + # PGCONFIG was specified; display a message to the user + if test "x$PGSCONFIG" = "xyes"; then + as_fn_error $? "you must specify a parameter to --with-pgconfig, e.g. --with-pgconfig=/path/to/pg_config" "$LINENO" 5 + else + if test -f $PGCONFIG; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using user-specified pg_config file: $PGCONFIG" >&5 +$as_echo "Using user-specified pg_config file: $PGCONFIG" >&6; } + else + as_fn_error $? "the user-specified pg_config file $PGCONFIG does not exist" "$LINENO" 5 + fi + fi +fi +PG_CFLAGS=-I`$PGCONFIG --includedir` +PG_LDFLAGS=-L`$PGCONFIG --libdir` + + +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --with-libpq_deferred +# + +# Check whether --with-libpq_deferred was given. +if test "${with_libpq_deferred+set}" = set; then : + withval=$with_libpq_deferred; +else + with_libpq_deferred=no +fi + +if test x"$with_libpq_deferred" != "xno"; then + $as_echo "#define LIBPQ_DEFERRED 1" >>confdefs.h + + libpq_deferred=1 +fi #----------------------------------------------------------------------- + +# Ensure that we can parse libpq-fe.h +CFLAGS_SAVE="$CFLAGS" +CFLAGS="$PG_CFLAGS" +for ac_header in libpq-fe.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libpq-fe.h" "ac_cv_header_libpq_fe_h" "$ac_includes_default" +if test "x$ac_cv_header_libpq_fe_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPQ_FE_H 1 +_ACEOF + +else + as_fn_error $? "cannot find libpq-fe.h, bailing out" "$LINENO" 5 +fi + +done + +CFLAGS="$CFLAGS_SAVE" + +if test x"$libpq_deferred" != "x1"; then + # Ensure we can link against libpq + LDFLAGS_SAVE="$LDFLAGS" + LDFLAGS="$PG_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQconnectdb in -lpq" >&5 +$as_echo_n "checking for PQconnectdb in -lpq... " >&6; } +if ${ac_cv_lib_pq_PQconnectdb+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpq $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char PQconnectdb (); +int +main () +{ +return PQconnectdb (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pq_PQconnectdb=yes +else + ac_cv_lib_pq_PQconnectdb=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQconnectdb" >&5 +$as_echo "$ac_cv_lib_pq_PQconnectdb" >&6; } +if test "x$ac_cv_lib_pq_PQconnectdb" = xyes; then : + PG_LIB=-lpq +else + as_fn_error $? "'libpq' is required but it doesn't seem to be installed on this system." "$LINENO" 5 +fi + + LDFLAGS="$LDFLAGS_SAVE" + +fi ac_config_files="$ac_config_files Makefile icons/Makefile win_resource/Makefile gnome_resource/Makefile mac_resource/Makefile" #----------------------------------------------------------------------- Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -17,16 +17,16 @@ [Should be defined in order to disable FREEXL support.]) AH_TEMPLATE([ENABLE_LIBXML2], [Should be defined in order to enable LIBXML2 support.]) AH_TEMPLATE([OMIT_WEBP], [Should be defined in order to disable WebP support.]) -AH_TEMPLATE([OPENJPEG_2_1], - [testing for OpenJpeg 2.1]) AH_TEMPLATE([OMIT_OPENJPEG], [Should be defined in order to disable OpenJpeg support.]) AH_TEMPLATE([OMIT_CHARLS], [Should be defined in order to disable CharLS support.]) +AH_TEMPLATE([LIBPQ_DEFERRED], + [Should be defined in order to enable LibPQ late binding.]) AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_USED], [depending on SQLite library version.]) AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_HIT], [depending on SQLite library version.]) AH_TEMPLATE([HAVE_DECL_SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE], @@ -197,32 +197,25 @@ if test x"$enable_openjpeg" != "xno"; then # # testing OpenJpeg-2 headers # they could be either on -/include/openjpeg-2.0 # or on -/include/openjpeg-2.1 + # or on -/include/openjpeg-2.2 + # or on -/include/openjpeg-2.3 # AC_CHECK_HEADERS(openjpeg-2.0/openjpeg.h) AC_CHECK_HEADERS(openjpeg-2.1/openjpeg.h) + AC_CHECK_HEADERS(openjpeg-2.2/openjpeg.h) + AC_CHECK_HEADERS(openjpeg-2.3/openjpeg.h) if test x"$ac_cv_header_openjpeg_2_0_openjpeg_h" != x"yes" && - test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes"; + test x"$ac_cv_header_openjpeg_2_1_openjpeg_h" != x"yes" && + test x"$ac_cv_header_openjpeg_2_2_openjpeg_h" != x"yes" && + test x"$ac_cv_header_openjpeg_2_3_openjpeg_h" != x"yes"; then AC_MSG_ERROR(['OpenJpeg-2' is required but the header (openjpeg.h) doesn't seem to be installed on this system]) fi 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) - # testing for OpenJpeg 2.0 or 2.1 - AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#ifdef HAVE_OPENJPEG_2_1_OPENJPEG_H - #include - #else - #include - #endif]], - [[void *d; opj_stream_t *s; opj_stream_set_user_data (s, &d, NULL);]])], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE(OPENJPEG_2_1) - ], - [AC_MSG_RESULT([no])] - ) else AC_DEFINE(OMIT_OPENJPEG) fi #----------------------------------------------------------------------- @@ -268,11 +261,73 @@ AC_SUBST(LIBSPATIALITE_LIBS) PKG_CHECK_MODULES([LIBRASTERLITE2], [rasterlite2], , AC_MSG_ERROR(['librasterlite2' is required but it doesn't seem to be installed on this system.])) AC_SUBST(LIBRASTERLITE2_CFLAGS) AC_SUBST(LIBRASTERLITE2_LIBS) + +PKG_CHECK_MODULES([LIBVIRTUALPG], [virtualpg], , AC_MSG_ERROR(['libvirtualpg' is required but it doesn't seem to be installed on this system.])) +AC_SUBST(LIBVIRTUALPG_CFLAGS) +AC_SUBST(LIBVIRTUALPG_LIBS) +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --with-pgconfig +# +AC_ARG_WITH([pgconfig], + [AS_HELP_STRING([--with-pgconfig=FILE], [specify an alternative pg_config file])], + [PGCONFIG="$withval"], [PGCONFIG=""]) +if test "x$PGCONFIG" = "x"; then + # PGCONFIG was not specified, so search within the current path + AC_PATH_PROG([PGCONFIG], [pg_config]) + # If we couldn't find pg_config, display an error + if test "x$PGCONFIG" = "x"; then + 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.]) + fi +else + # PGCONFIG was specified; display a message to the user + if test "x$PGSCONFIG" = "xyes"; then + AC_MSG_ERROR([you must specify a parameter to --with-pgconfig, e.g. --with-pgconfig=/path/to/pg_config]) + else + if test -f $PGCONFIG; then + AC_MSG_RESULT([Using user-specified pg_config file: $PGCONFIG]) + else + AC_MSG_ERROR([the user-specified pg_config file $PGCONFIG does not exist]) + fi + fi +fi +PG_CFLAGS=-I`$PGCONFIG --includedir` +PG_LDFLAGS=-L`$PGCONFIG --libdir` +AC_SUBST(PG_CFLAGS) +AC_SUBST(PG_LDFLAGS) +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --with-libpq_deferred +# +AC_ARG_WITH(libpq_deferred, [AS_HELP_STRING( + [--with-libpq_deferred], [enables libpq late binding [default=no]])], + [], [with_libpq_deferred=no]) +if test x"$with_libpq_deferred" != "xno"; then + AC_DEFINE(LIBPQ_DEFERRED) + libpq_deferred=1 +fi #----------------------------------------------------------------------- + +# Ensure that we can parse libpq-fe.h +CFLAGS_SAVE="$CFLAGS" +CFLAGS="$PG_CFLAGS" +AC_CHECK_HEADERS(libpq-fe.h,, [AC_MSG_ERROR([cannot find libpq-fe.h, bailing out])]) +CFLAGS="$CFLAGS_SAVE" + +if test x"$libpq_deferred" != "x1"; then + # Ensure we can link against libpq + LDFLAGS_SAVE="$LDFLAGS" + LDFLAGS="$PG_LDFLAGS" + 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.])) + LDFLAGS="$LDFLAGS_SAVE" + AC_SUBST(PG_LIB) +fi AC_CONFIG_FILES([Makefile \ icons/Makefile \ win_resource/Makefile \ gnome_resource/Makefile \ Index: gnome_resource/Makefile.in ================================================================== --- gnome_resource/Makefile.in +++ gnome_resource/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -202,10 +202,12 @@ LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ LIBS = @LIBS@ LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ LIBTOOL = @LIBTOOL@ +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ LIBWEBP_LIBS = @LIBWEBP_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ @@ -228,10 +230,14 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PGCONFIG = @PGCONFIG@ +PG_CFLAGS = @PG_CFLAGS@ +PG_LDFLAGS = @PG_LDFLAGS@ +PG_LIB = @PG_LIB@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ ADDED helpgen/READ_ME.txt Index: helpgen/READ_ME.txt ================================================================== --- helpgen/READ_ME.txt +++ helpgen/READ_ME.txt @@ -0,0 +1,53 @@ +About "helpgen" +=============== +this is a small C tool intended to simplify and make easy the process to +tempestively update the HTML doc internally supplied by "spatialite_gui" +about SpatiaLite and Rasterlite2 SQL functions. + + +How it works +============ +1. "helpgen" will parse and rearrange the two HTML pages supporting + each library, merging both into a single HTML page. +2. this merged HTML page will then be compressed using the well known + ZIP/DEFLATE algorithm (zlib). +3. then the ZIP binary payload will be transformed into many short text + strings encoded as hexadecimal bytes. +4. and finally a C++ source will be autogenerated; this C++ source is + intended to be compiled and linked within "spatialite_gui", and its + specific scope is the one to "inject" into the executable all the + above mentioned hexadecimal strings representing the zipped HTML doc. +5. each time that the user will request "spatialite_gui" to show the + internal HTML doc the "MyMain::GetHelp()" function defined into the + autogenerated C++ source, the zipped payload will be decompressed + and the HTML page will be shown on the screen. + + +Using "helpgen" +=============== +a. build the "helpgen" executable (see below). +b. prepare the SpatiaLite's own HTML page; this usually means copying + "spatialite-sql-latest.html" from libspatialite's sources to + ./spatialite-sql-latest.html +c. prepare the RasterLite2's own HTML page; this usually means + downloading from the Fossil Wiki: + https://www.gaia-gis.it/fossil/librasterlite2/wiki?name=sql_reference_list + the downloaded HTML page must be saved as ./rl2-sql-latest.html +d. now you are ready to execute "helpgen" (no args): + ./helpgen +e. the "HtmlHelp.cpp" C++ source will be autogenerated. +f. copy "HtmlHelp.cpp" into the spatialite_gui's sources and rebuild; + the spatialite_gui executable will now contain the latest version + of the HTML doc. + + +Building "helpgen" +================== +You just have to directly invoke "gcc". + +on Linux and other *nix systems: +gcc helpgen.c -o helpgen -lz + + +on Windows using MSYS and MinGW: +gcc helpgen.c -o helpgen.exe -lz ADDED helpgen/helpgen.c Index: helpgen/helpgen.c ================================================================== --- helpgen/helpgen.c +++ helpgen/helpgen.c @@ -0,0 +1,613 @@ +/* +/ helpgen +/ +/ a tool autogenerating C++ code for SpatiaLite_GUI +/ [HTML doc] +/ +/ version 1.0, 2017 August 4 +/ +/ Author: Sandro Furieri a.furieri@lqt.it +/ +/ Copyright (C) 2017 Alessandro Furieri +/ +/ This program is free software: you can redistribute it and/or modify +/ it under the terms of the GNU General Public License as published by +/ the Free Software Foundation, either version 3 of the License, or +/ (at your option) any later version. +/ +/ This program is distributed in the hope that it will be useful, +/ but WITHOUT ANY WARRANTY; without even the implied warranty of +/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +/ GNU General Public License for more details. +/ +/ You should have received a copy of the GNU General Public License +/ along with this program. If not, see . +/ +*/ + +#include +#include +#include + +#include + +/* +static void +do_debug (const char *html, int len) +{ + fwrite (html, 1, len, stdout); +} +*/ + +static int +load_splite (FILE * in, char **buf, int *buf_len) +{ +/* loading in memory "./spatialite-sql-latest.html" */ + char *mem = NULL; + int size; + if (fseek (in, 0, SEEK_END) < 0) + { + fprintf (stderr, + "ERROR: fseek failure on \"./spatialite-sql-latest.html/\"\n"); + goto stop; + } + size = ftell (in); + rewind (in); + mem = malloc (size); + if (mem == NULL) + { + fprintf (stderr, "ERROR: insufficient memory\n"); + goto stop; + } + if (fread (mem, 1, size, in) != (unsigned int) size) + { + fprintf (stderr, + "ERROR: fread failure on \"./spatialite-sql-latest.html/\"\n"); + goto stop; + } + *buf = mem; + *buf_len = size; + return 1; + + stop: + *buf = NULL; + *buf_len = 0; + return 0; +} + +static int +load_rl2 (FILE * in, char **buf, int *buf_len) +{ +/* loading in memory "./rl2-sql-latest.html" */ + char *mem = NULL; + int size; + if (fseek (in, 0, SEEK_END) < 0) + { + fprintf (stderr, + "ERROR: fseek failure on \"./rl2-sql-latest.html/\"\n"); + goto stop; + } + size = ftell (in); + rewind (in); + mem = malloc (size); + if (mem == NULL) + { + fprintf (stderr, "ERROR: insufficient memory\n"); + goto stop; + } + if (fread (mem, 1, size, in) != (unsigned int) size) + { + fprintf (stderr, + "ERROR: fread failure on \"./rl2-sql-latest.html/\"\n"); + goto stop; + } + *buf = mem; + *buf_len = size; + return 1; + + stop: + *buf = NULL; + *buf_len = 0; + return 0; +} + +static int +check_back (const char *buf) +{ + const char *p = buf; + while (1) + { + if (*p == ' ' || *p == '\t') + { + /* skipping leading blanks */ + p++; + continue; + } + break; + } + if (strcmp + (p, + "back") == + 0) + return 1; + return 0; +} + +static int +check_end (const char *buf) +{ + const char *p = buf; + while (1) + { + if (*p == ' ' || *p == '\t') + { + /* skipping leading blanks */ + p++; + continue; + } + break; + } + if (strncmp (p, "", 7) == 0) + return 1; + return 0; +} + +static void +check_toc (char *buf) +{ + int i; + char title[256]; + const char *str; + char *p = buf; + while (1) + { + if (*p == ' ' || *p == '\t') + { + /* skipping leading blanks */ + p++; + continue; + } + break; + } + if (strncmp (p, "

SpatiaLite ", 15) != 0) + return; + + strcpy (title, p + 4); + *(title + strlen (title) - 5) = '\0'; + p = buf; + + str = "

Table of Contents

\n
    \n"; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = "
  • SpatiaLite SQL functions
  • \n"; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = + "
  • RasterLite2 SQL functions
  • \n"; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = "


\n

"; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = title; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = "

"; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + *p = '\0'; +} + +static void +clean_splite (char **buf, int *buf_len) +{ +/* cleaning "./spatialite-sql-latest.html" */ + const char *p_in = *buf; + int in_len = *buf_len; + char *out = malloc (in_len + 1024); + char *p_out = out; + char line[2048]; + char *p_line = line; + int i; + + for (i = 0; i < in_len; i++) + { + if (*p_in == '\r') + { + /* skipping RETURN chars */ + p_in++; + continue; + } + if (*p_in == '\n') + { + /* found a NEWLINE char */ + int skip = 0; + *p_line = '\0'; + check_toc (line); + if (check_back (line)) + skip = 1; + if (check_end (line)) + skip = 1; + if (!skip) + { + /* copying the current line into the output buffer */ + unsigned int x; + for (x = 0; x < strlen (line); x++) + *p_out++ = line[x]; + *p_out++ = '\n'; + } + p_line = line; + p_in++; + continue; + } + *p_line++ = *p_in++; + } + free (*buf); + *buf = out; + *buf_len = p_out - out; +} + +static int +check_start_rl2 (char *buf) +{ + int i; + char title[256]; + const char *str; + char *p = buf; + while (1) + { + if (*p == ' ' || *p == '\t') + { + /* skipping leading blanks */ + p++; + continue; + } + break; + } + if (strcmp (p, "

RasterLite2 SQL functions - reference list

") != 0) + return 0; + + strcpy (title, p + 4); + *(title + strlen (title) - 5) = '\0'; + p = buf; + + str = title; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + str = ""; + for (i = 0; i < (int) strlen (str); i++) + *p++ = str[i]; + + *p = '\0'; + + return 1; +} + +static int +check_end_rl2 (const char *buf) +{ + const char *p = buf; + while (1) + { + if (*p == ' ' || *p == '\t') + { + /* skipping leading blanks */ + p++; + continue; + } + break; + } + if (strcmp + (p, + "Back to RasterLite2 doc index") + == 0) + return 1; + return 0; +} + +static void +sanitize_tags (char *line) +{ + char *p; + while (1) + { + p = strstr (line, "
"); + if (p != NULL) + memcpy (p, "
", 6); + else + break; + } + while (1) + { + p = strstr (line, "
"); + if (p != NULL) + memcpy (p, "
", 6); + else + break; + } +} + +static void +clean_rl2 (char **buf, int *buf_len) +{ +/* cleaning "./rl2-sql-latest.html" */ + const char *p_in = *buf; + int in_len = *buf_len; + char *out = malloc (in_len + 1024); + char *p_out = out; + char line[2048]; + char *p_line = line; + int i; + int start = 0; + int end = 0; + const char *header = + "





\n

"; + const char *footer = "\n"; + + for (i = 0; i < in_len; i++) + { + if (*p_in == '\r') + { + /* skipping RETURN chars */ + p_in++; + continue; + } + if (*p_in == '\n') + { + /* found a NEWLINE char */ + *p_line = '\0'; + if (check_start_rl2 (line)) + { + int x; + start = 1; + for (x = 0; x < (int) strlen (header); x++) + *p_out++ = header[x]; + } + if (check_end_rl2 (line)) + end = 1; + sanitize_tags (line); + if (start && !end) + { + /* copying the current line into the output buffer */ + unsigned int x; + for (x = 0; x < strlen (line); x++) + *p_out++ = line[x]; + *p_out++ = '\n'; + } + p_line = line; + p_in++; + continue; + } + *p_line++ = *p_in++; + } + free (*buf); + for (i = 0; i < (int) strlen (footer); i++) + *p_out++ = footer[i]; + *buf = out; + *buf_len = p_out - out; +} + +static int +zip_compress (const char *html, int len_html, unsigned char **zip, int *len_zip) +{ +/* compressing the HTML page (DEFLATE - ZIP) */ + int ret; + uLong zLen = len_html - 1; + unsigned char *zip_buf = malloc (zLen); + if (zip_buf == NULL) + { + fprintf (stderr, "ERROR: insufficient memory\n"); + goto error; + } + ret = compress (zip_buf, &zLen, (const Bytef *) html, (uLong) len_html); + if (ret == Z_OK) + { + *zip = zip_buf; + *len_zip = zLen; + return 1; + } + else if (ret == Z_BUF_ERROR) + fprintf (stderr, "ERROR: ZIP compression causes inflation\n"); + else + fprintf (stderr, "ERROR: internal ZIP codec failure (compression)\n"); + + error: + *zip = NULL; + *len_zip = 0; + return 0; +} + +static void +print_source (FILE * out, int len_html, unsigned char *zip, int len_zip) +{ +/* printing the C++ source file */ + int i; + int j; + int lim; + + fprintf (out, "/*\n/ HtmlHelp.cpp\n"); + fprintf (out, "/ spatialite_gui HTML Help generator\n/\n"); + fprintf (out, "/ This code was autogenerated by \"helpgen\" on xxxxx\n/\n"); + fprintf (out, "/ Author: Sandro Furieri a.furieri@lqt.it\n/\n"); + fprintf (out, "/ Copyright (C) 2017 Alessandro Furieri\n/\n"); + fprintf (out, + "/ This program is free software: you can redistribute it and/or modify\n"); + fprintf (out, + "/ it under the terms of the GNU General Public License as published by\n"); + fprintf (out, + "/ the Free Software Foundation, either version 3 of the License, or\n"); + fprintf (out, "/ (at your option) any later version.\n/\n"); + fprintf (out, + "/ This program is distributed in the hope that it will be useful,\n"); + fprintf (out, + "/ but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); + fprintf (out, + "/ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); + fprintf (out, "/ GNU General Public License for more details.\n/\n"); + fprintf (out, + "/ You should have received a copy of the GNU General Public License\n"); + fprintf (out, + "/ along with this program. If not, see .\n/\n*/\n\n"); + fprintf (out, "#include \"Classdef.h\"\n\n"); + fprintf (out, "#include \n\n"); + fprintf (out, "void MyFrame::GetHelp(wxString & html_text)\n{\n"); + fprintf (out, + "//\n// return the HTML Help Page from the ZIP compressed data\n//\n"); + fprintf (out, "\tunsigned char *zip_buf = NULL;\n"); + fprintf (out, "\tint uncompressed_len = %d;\n", len_html); + fprintf (out, "\tint compressed_len = %d;\n", len_zip); + fprintf (out, "\tuLong inLen = compressed_len;\n"); + fprintf (out, "\tuLong outLen = uncompressed_len;\n"); + fprintf (out, "\tconst Bytef *in;\n"); + fprintf (out, "\tBytef *out;\n"); + fprintf (out, "\tchar *html = NULL;\n\n"); + + fprintf (out, "// allocating the ZIP compressed buffer\n"); + fprintf (out, "\tzip_buf = (unsigned char *)malloc(uncompressed_len);\n"); + fprintf (out, "\tif (zip_buf == NULL)\n\t\tgoto error;\n\n"); + + fprintf (out, "// feeding the ZIP compressed buffer\n"); + for (i = 0; i < len_zip; i += 25) + { + fprintf (out, "\tFeedZipHtml (zip_buf, %d, \"", i); + lim = 25; + if (i + lim > len_zip) + lim = len_zip - i; + for (j = 0; j < lim; j++) + fprintf (out, "%02x", *(zip + i + j)); + fprintf (out, "\");\n"); + } + fprintf (out, "\n// uncompressing the ZIP payload\n"); + fprintf (out, "\tin = zip_buf;\n"); + fprintf (out, "\thtml = (char *)malloc (uncompressed_len + 1);\n"); + fprintf (out, "\tif (html == NULL)\n\t\tgoto error;\n"); + fprintf (out, "\tout = (Bytef *)html;\n"); + fprintf (out, "\tif (uncompress (out, &outLen, in, inLen) != Z_OK)\n"); + fprintf (out, "\t\tgoto error;\n"); + fprintf (out, "\t*(html + uncompressed_len) = '\\0';\n"); + fprintf (out, "\tfree(zip_buf);\n"); + fprintf (out, "\thtml_text = wxString::FromUTF8(html);\n"); + fprintf (out, "\tfree(html);\n"); + fprintf (out, "\treturn;\n\nerror:\n"); + fprintf (out, "\tif (zip_buf != NULL)\n\t\tfree(zip_buf);\n"); + fprintf (out, "\tif (html != NULL)\n\t\tfree(html);\n"); + fprintf (out, "\thtml_text = wxT(\"

Sorry, HTML Help " + "is currently unavailable.

\");\n"); + fprintf (out, "}\n"); +} + +int +main (void) +{ +/* +/ +/ Please note: no args are supported !!! +/ +/ we'll expect to find two input files respectively named: +/ ./spatialite-sql-latest.html +/ ./rl2-sql-latest.html +/ +/ the C++ code will be generated into: ./HtmlHelp.cpp +/ +*/ + FILE *fl_splite = NULL; + FILE *fl_rl2 = NULL; + FILE *fl_out = NULL; + char *p_splite = NULL; + int len_splite = 0; + char *p_rl2 = NULL; + int len_rl2 = 0; + char *html = NULL; + int len_html = 0; + unsigned char *zip = NULL; + int len_zip = 0; + +/* opening input and output files */ + fl_splite = fopen ("./spatialite-sql-latest.html", "rb"); + if (fl_splite == NULL) + { + fprintf (stderr, + "ERROR: unable to open the \"./spatialite-sql-latest.html\" input file\n"); + goto stop; + } + fl_rl2 = fopen ("./rl2-sql-latest.html", "rb"); + if (fl_rl2 == NULL) + { + fprintf (stderr, + "ERROR: unable to open the \"./rl2-sql-latest.html\" input file\n"); + goto stop; + } + fl_out = fopen ("./HtmlHelp.cpp", "wb"); + if (fl_out == NULL) + { + fprintf (stderr, + "ERROR: unable to open/create the \"./HtmlHelp.cpp\" output file\n"); + goto stop; + } + +/* loading and arranging input files */ + if (!load_splite (fl_splite, &p_splite, &len_splite)) + { + fprintf (stderr, + "ERROR: unable to load the \"./spatialite-sql-latest.html\" input file\n"); + goto stop; + } + if (!load_rl2 (fl_rl2, &p_rl2, &len_rl2)) + { + fprintf (stderr, + "ERROR: unable to load the \"./rl2-sql-latest.html\" input file\n"); + goto stop; + } + clean_splite (&p_splite, &len_splite); + clean_rl2 (&p_rl2, &len_rl2); + +/* creating in memory the uncompressed HTML page */ + len_html = len_splite + len_rl2; + html = malloc (len_html); + if (html == NULL) + { + fprintf (stderr, "ERROR: insufficient memory\n"); + goto stop; + } + memcpy (html, p_splite, len_splite); + memcpy (html + len_splite, p_rl2, len_rl2); + free (p_splite); + p_splite = NULL; + free (p_rl2); + p_rl2 = NULL; + +/* compressing the HTML page */ + if (!zip_compress (html, len_html, &zip, &len_zip)) + { + fprintf (stderr, "ERROR: unable to DEFLATE\n"); + goto stop; + } + +/* autogenerating the C++ source */ + print_source (fl_out, len_html, zip, len_zip); + +/* end - cleanup */ + stop: + if (zip != NULL) + free (zip); + if (html != NULL) + free (html); + if (p_splite != NULL) + free (p_splite); + if (p_rl2 != NULL) + free (p_rl2); + if (fl_splite) + fclose (fl_splite); + if (fl_rl2) + fclose (fl_rl2); + if (fl_out) + fclose (fl_out); + return 0; +} Index: icons/Makefile.am ================================================================== --- icons/Makefile.am +++ icons/Makefile.am @@ -22,6 +22,8 @@ map_table.xpm pan.xpm printer.xpm map_root.xpm map_go.xpm \ map_edit.xpm map_add.xpm linestrings_on.xpm linestrings_off.xpm \ points_on.xpm points_off.xpm polygons_on.xpm polygons_off.xpm \ topo_geo_off.xpm topo_net_off.xpm dustbin.xpm gpkgtable.xpm \ gpkgvtable.xpm gpkggeom.xpm virtgpkg.xpm gpkg_spatialidx.xpm \ - red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm + red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm \ + postgres.xpm postgres_schema.xpm postgres_table.xpm \ + postgres_view.xpm Index: icons/Makefile.in ================================================================== --- icons/Makefile.in +++ icons/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -172,10 +172,12 @@ LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ LIBS = @LIBS@ LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ LIBTOOL = @LIBTOOL@ +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ LIBWEBP_LIBS = @LIBWEBP_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ @@ -198,10 +200,14 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PGCONFIG = @PGCONFIG@ +PG_CFLAGS = @PG_CFLAGS@ +PG_LDFLAGS = @PG_LDFLAGS@ +PG_LIB = @PG_LIB@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ @@ -287,11 +293,13 @@ map_table.xpm pan.xpm printer.xpm map_root.xpm map_go.xpm \ map_edit.xpm map_add.xpm linestrings_on.xpm linestrings_off.xpm \ points_on.xpm points_off.xpm polygons_on.xpm polygons_off.xpm \ topo_geo_off.xpm topo_net_off.xpm dustbin.xpm gpkgtable.xpm \ gpkgvtable.xpm gpkggeom.xpm virtgpkg.xpm gpkg_spatialidx.xpm \ - red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm + red_light.xpm green_light.xpm yellow_light.xpm map_magnify.xpm \ + postgres.xpm postgres_schema.xpm postgres_table.xpm \ + postgres_view.xpm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) ADDED icons/postgres.xpm Index: icons/postgres.xpm ================================================================== --- icons/postgres.xpm +++ icons/postgres.xpm @@ -0,0 +1,79 @@ +/* XPM */ +static const char * postgres_xpm[] = { +"16 16 60 1", +" c None", +". c #EEF2F4", +"+ c #E6EBEE", +"@ c #B6C5C9", +"# c #AFBFC8", +"$ c #91ABB7", +"% c #39638A", +"& c #346483", +"* c #93A5B4", +"= c #8FAAB4", +"- c #396485", +"; c #6B8EA1", +"> c #93B5C4", +", c #9AADBD", +"' c #D5DFE5", +") c #346391", +"! c #35638C", +"~ c #45697F", +"{ c #4B708A", +"] c #BCC9CF", +"^ c #7596AD", +"/ c #5D7D9E", +"( c #2F628E", +"_ c #7794A5", +": c #6184A2", +"< c #9BB8C4", +"[ c #8CACC0", +"} c #7D9DB2", +"| c #8CA9BD", +"1 c #A9BEC7", +"2 c #C3D4DC", +"3 c #C2CFD3", +"4 c #95B2BC", +"5 c #608592", +"6 c #85A9BD", +"7 c #416589", +"8 c #7CA1B4", +"9 c #5D809C", +"0 c #6E96AA", +"a c #577688", +"b c #8DA6B8", +"c c #466D89", +"d c #3F6890", +"e c #BAC5CB", +"f c #D4DCDF", +"g c #8BA4B6", +"h c #ECEEEE", +"i c #D9E1E3", +"j c #8BA5AD", +"k c #567698", +"l c #8495A3", +"m c #C1C6CA", +"n c #2E688B", +"o c #E7EDF1", +"p c #5E81A3", +"q c #4A7299", +"r c #61839C", +"s c #486B8A", +"t c #597C96", +"u c #D7E1E6", +" .. .+ @#. ", +" $%&&*=-&-;>&-, ", +"'-)!~>&!!!!{$!-]", +"$)!!^/(!%!)!_:)<", +",!))[><}!)!|1~^4!!%456! ", +".!!)[%!^7)->{8; ", +" 9)!>&!}%))0a$' ", +" b)!|c&>!!)d1e ", +" f-!c]g4!!)!=h ", +" g!] ijk)(!1lm ", +" 2 'j@/)n%o ", +" p)(d ", +" :!(q ", +" _!)r ", +" 3stu "}; ADDED icons/postgres_schema.xpm Index: icons/postgres_schema.xpm ================================================================== --- icons/postgres_schema.xpm +++ icons/postgres_schema.xpm @@ -0,0 +1,101 @@ +/* XPM */ +static const char * postgres_schema_xpm[] = { +"16 16 82 1", +" g None", +". g #80BABA", +"+ g #80B8B8", +"@ g #80B7B7", +"# g #80B6B6", +"$ g #80B4B4", +"% g #80B3B3", +"& g #80BBBB", +"* g #80D0D0", +"= g #80E8E8", +"- g #80F3F3", +"; g #80FDFD", +"> g #80FCFC", +", g #80EDED", +"' g #80E0E0", +") g #80C2C2", +"! g #80ADAD", +"~ g #80E1E1", +"{ g #80FEFE", +"] g #80FFFF", +"^ g #80FBFB", +"/ g #80CFCF", +"( g #80A9A9", +"_ g #80B9B9", +": g #80F8F8", +"< g #80EAEA", +"[ g #80A7A7", +"} g #80F7F7", +"| g #80E7E7", +"1 g #80EFEF", +"2 g #80F6F6", +"3 g #80FAFA", +"4 g #80F0F0", +"5 g #80DEDE", +"6 g #80C3C3", +"7 g #80E6E6", +"8 g #80A5A5", +"9 g #80B5B5", +"0 g #80EBEB", +"a g #80D6D6", +"b g #80D5D5", +"c g #80D1D1", +"d g #80BCBC", +"e g #80C0C0", +"f g #80E5E5", +"g g #80A3A3", +"h g #80F5F5", +"i g #80EEEE", +"j g #80E2E2", +"k g #80CDCD", +"l g #80E3E3", +"m g #80A0A0", +"n g #80B2B2", +"o g #80F4F4", +"p g #80DDDD", +"q g #80C9C9", +"r g #80BDBD", +"s g #80BFBF", +"t g #809E9E", +"u g #80B0B0", +"v g #80D9D9", +"w g #80DBDB", +"x g #80C4C4", +"y g #809B9B", +"z g #80AEAE", +"A g #80F2F2", +"B g #80D8D8", +"C g #80DCDC", +"D g #809696", +"E g #80ACAC", +"F g #80D4D4", +"G g #80D2D2", +"H g #809090", +"I g #808B8B", +"J g #80CECE", +"K g #808A8A", +"L g #80A1A1", +"M g #809F9F", +"N g #80ABAB", +"O g #809595", +"P g #808D8D", +"Q g #808989", +" ", +" .+@#$% ", +" &*=-;>,')! ", +" .~{]]]]]]^/( ", +" _:{]]]]]]^<[ ", +" @}|12^345678 ", +" 9205abc6defg ", +" $hi7j7~k))lm ", +" no<~pl5qrsjt ", +" u-|pv'wx+&~y ", +" zAjBbCBe%@'D ", +" E45FGwasu%5H ", +" (5-wGwaeq7xI ", +" 8J,oho1j.K ", +" LMLN[OPQ ", +" "}; ADDED icons/postgres_table.xpm Index: icons/postgres_table.xpm ================================================================== --- icons/postgres_table.xpm +++ icons/postgres_table.xpm @@ -0,0 +1,119 @@ +/* XPM */ +static const char * postgres_table_xpm[] = { +"16 16 100 2", +" c None", +". c #80C1EF", +"+ c #80C0ED", +"@ c #80BEEB", +"# c #80BCEB", +"$ c #80BAE9", +"% c #80B7E7", +"& c #80B5E6", +"* c #80B2E4", +"= c #80AFE2", +"- c #80ACE0", +"; c #80A9DD", +"> c #80A5DC", +", c #80A3DA", +"' c #80C1EE", +") c #80F7FB", +"! c #80A0D7", +"~ c #80BFEC", +"{ c #80D59C", +"] c #80D398", +"^ c #80D094", +"/ c #80CE90", +"( c #80CB8B", +"_ c #80C987", +": c #80C682", +"< c #80C37E", +"[ c #80C17A", +"} c #80BE76", +"| c #809BD4", +"1 c #80BDEB", +"2 c #80FFFF", +"3 c #8097D1", +"4 c #80BAE9", +"5 c #80C3E9", +"6 c #8093CE", +"7 c #80B7E7", +"8 c #80C4E8", +"9 c #80C7E8", +"0 c #80F1F7", +"a c #808FCB", +"b c #80B4E5", +"c c #80F6FA", +"d c #80C6E9", +"e c #80C6E9", +"f c #80C7EA", +"g c #80C7E9", +"h c #80C9E9", +"i c #80C9E9", +"j c #80C8E8", +"k c #80CCE8", +"l c #80E7F2", +"m c #808AC8", +"n c #80B1E3", +"o c #80F6FA", +"p c #80C9EA", +"q c #80C9EA", +"r c #80E5F1", +"s c #8086C6", +"t c #80AEE1", +"u c #80F4FA", +"v c #80CBEA", +"w c #80CCEA", +"x c #80CEEA", +"y c #80C8E8", +"z c #80E2F0", +"A c #8086C4", +"B c #80AADF", +"C c #80F3F9", +"D c #80D0EB", +"E c #80CFEA", +"F c #80F6FB", +"G c #808DC8", +"H c #80A8DD", +"I c #80D0EB", +"J c #80D1EB", +"K c #80CDEA", +"L c #808AC6", +"M c #80A4D9", +"N c #80F3F9", +"O c #80D2EB", +"P c #80D3EB", +"Q c #80C7EA", +"R c #808CC6", +"S c #80A1D7", +"T c #80F2F8", +"U c #80F0F7", +"V c #80EDF6", +"W c #80EAF4", +"X c #80E7F3", +"Y c #80E4F1", +"Z c #808AC5", +"` c #809ED6", +" . c #8099D3", +".. c #8096D1", +"+. c #8092CE", +"@. c #808ECB", +"#. c #808AC9", +"$. c #8087C7", +"%. c #8084C3", +"&. c #8077BB", +" ", +" . + @ # $ % & * = - ; > , ", +" ' ) ) ) ) ) ) ) ) ) ) ) ) ! ", +" ~ ) { ] ^ / ( _ : < [ } ) | ", +" 1 ) 2 2 2 2 2 2 2 2 2 2 ) 3 ", +" 4 ) 5 5 5 5 5 5 5 5 5 5 ) 6 ", +" 7 ) 5 2 8 2 2 2 9 2 2 2 0 a ", +" b c d e f g h i 9 i j k l m ", +" n o p 2 q 2 2 2 9 2 2 2 r s ", +" t u v w w w w x 9 9 j y z A ", +" B C x 2 D 2 2 2 E F 2 2 z G ", +" H C I D D D D J K K K K z L ", +" M N O 2 P 2 2 2 Q 2 2 2 z R ", +" S T U V W X Y z z z z z z Z ", +" ` ...+.@.#.$.%.%.%.%.%.%.&. ", +" "}; ADDED icons/postgres_view.xpm Index: icons/postgres_view.xpm ================================================================== --- icons/postgres_view.xpm +++ icons/postgres_view.xpm @@ -0,0 +1,151 @@ +/* XPM */ +static const char * postgres_view_xpm[] = { +"16 16 132 2", +" c None", +". c #80B9B9", +"+ c #80B7B7", +"@ c #80B5B5", +"# c #80B2B2", +"$ c #80B0B0", +"% c #80BABA", +"& c #80D6D6", +"* c #80EDED", +"= c #80F9F9", +"- c #80FBFB", +"; c #80F0F0", +"> c #80D9D9", +", c #80ABAB", +"' c #80B8B8", +") c #80F6F6", +"! c #80F4F4", +"~ c #80A8A8", +"{ c #80B7E7", +"] c #80B5E6", +"^ c #80B2E4", +"/ c #80AFE2", +"( c #80ACE0", +"_ c #80A9DD", +": c #80A5DC", +"< c #80A3DA", +"[ c #80B6B6", +"} c #80F2F2", +"| c #80E4E4", +"1 c #80E2E2", +"2 c #80C8C8", +"3 c #80F1F1", +"4 c #80A5A5", +"5 c #80F7FB", +"6 c #80A0D7", +"7 c #80B4B4", +"8 c #80F8F8", +"9 c #80DBDB", +"0 c #80EFEF", +"a c #80D0D0", +"b c #80FFFF", +"c c #80A2A2", +"d c #80CB8B", +"e c #80C987", +"f c #80C682", +"g c #80C37E", +"h c #80C17A", +"i c #80BE76", +"j c #809BD4", +"k c #80B1B1", +"l c #80D5D5", +"m c #80CBCB", +"n c #809E9E", +"o c #8097D1", +"p c #80AEAE", +"q c #80D1D1", +"r c #80ECEC", +"s c #80C5C5", +"t c #80C6C6", +"u c #809A9A", +"v c #80C3E9", +"w c #8093CE", +"x c #80ACAC", +"y c #80FAFA", +"z c #80D7D7", +"A c #80CACA", +"B c #80CFCF", +"C c #809393", +"D c #80C7E8", +"E c #80F1F7", +"F c #808FCB", +"G c #80A9A9", +"H c #80EAEA", +"I c #80959A", +"J c #80C9E9", +"K c #80C9E9", +"L c #80C8E8", +"M c #80CCE8", +"N c #80E7F2", +"O c #808AC8", +"P c #80A4AF", +"Q c #80ABAB", +"R c #80A0A4", +"S c #80A7A7", +"T c #80A7B6", +"U c #80F3F3", +"V c #80E5F1", +"W c #8086C6", +"X c #80ACD8", +"Y c #80DEE3", +"Z c #80BBD2", +"` c #80C2DB", +" . c #80C7E3", +".. c #80CCEA", +"+. c #80CEEA", +"@. c #80C8E8", +"#. c #80E2F0", +"$. c #8086C4", +"%. c #80AADF", +"&. c #80F3F9", +"*. c #80D0EB", +"=. c #80CFEA", +"-. c #80F6FB", +";. c #808DC8", +">. c #80A8DD", +",. c #80D0EB", +"'. c #80D1EB", +"). c #80CDEA", +"!. c #808AC6", +"~. c #80A4D9", +"{. c #80F3F9", +"]. c #80D2EB", +"^. c #80D3EB", +"/. c #80C7EA", +"(. c #808CC6", +"_. c #80A1D7", +":. c #80F2F8", +"<. c #80F0F7", +"[. c #80EDF6", +"}. c #80EAF4", +"|. c #80E7F3", +"1. c #80E4F1", +"2. c #808AC5", +"3. c #809ED6", +"4. c #8099D3", +"5. c #8096D1", +"6. c #8092CE", +"7. c #808ECB", +"8. c #808AC9", +"9. c #8087C7", +"0. c #8084C3", +"a. c #8077BB", +" . + @ # $ ", +"% & * = - ; > , ", +"' ) ! = - ) ) ~ { ] ^ / ( _ : < ", +"[ } > | 1 2 3 4 5 5 5 5 5 5 5 6 ", +"7 8 9 0 a a b c d e f g h i 5 j ", +"k 8 l 0 m m b n b b b b b b 5 o ", +"p 8 q r s t b u v v v v v v 5 w ", +"x y z 1 A B b C b b D b b b E F ", +"G m H ; } r A I J K D K L M N O ", +" P Q R S T U b b D b b b V W ", +" X Y Z ` .....+.D D L @.#.$.", +" %.&.+.b *.b b b =.-.b b #.;.", +" >.&.,.*.*.*.*.'.).).).).#.!.", +" ~.{.].b ^.b b b /.b b b #.(.", +" _.:.<.[.}.|.1.#.#.#.#.#.#.2.", +" 3.4.5.6.7.8.9.0.0.0.0.0.0.a."}; Index: mac_resource/Makefile.in ================================================================== --- mac_resource/Makefile.in +++ mac_resource/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -172,10 +172,12 @@ LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ LIBS = @LIBS@ LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ LIBTOOL = @LIBTOOL@ +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ LIBWEBP_LIBS = @LIBWEBP_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ @@ -198,10 +200,14 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PGCONFIG = @PGCONFIG@ +PG_CFLAGS = @PG_CFLAGS@ +PG_LDFLAGS = @PG_LDFLAGS@ +PG_LIB = @PG_LIB@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ Index: win_resource/Makefile.in ================================================================== --- win_resource/Makefile.in +++ win_resource/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -172,10 +172,12 @@ LIBRASTERLITE2_LIBS = @LIBRASTERLITE2_LIBS@ LIBS = @LIBS@ LIBSPATIALITE_CFLAGS = @LIBSPATIALITE_CFLAGS@ LIBSPATIALITE_LIBS = @LIBSPATIALITE_LIBS@ LIBTOOL = @LIBTOOL@ +LIBVIRTUALPG_CFLAGS = @LIBVIRTUALPG_CFLAGS@ +LIBVIRTUALPG_LIBS = @LIBVIRTUALPG_LIBS@ LIBWEBP_CFLAGS = @LIBWEBP_CFLAGS@ LIBWEBP_LIBS = @LIBWEBP_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ @@ -198,10 +200,14 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PGCONFIG = @PGCONFIG@ +PG_CFLAGS = @PG_CFLAGS@ +PG_LDFLAGS = @PG_LDFLAGS@ +PG_LIB = @PG_LIB@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@