ToolMap
Loading...
Searching...
No Matches
tooldanglingnodes.h
1/***************************************************************************
2 tooldanglingnodes.h
3 Tool engine for searching dangling nodes
4 -------------------
5 copyright : (C) 2007 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17// comment doxygen
18
19#ifndef _TOOL_DANGLING_NODES_H_
20#define _TOOL_DANGLING_NODES_H_
21
22// For compilers that support precompilation, includes "wx/wx.h".
23#include <wx/wxprec.h>
24
25// Include wxWidgets' headers
26#ifndef WX_PRECOMP
27#include <wx/wx.h>
28#endif
29
30#include <wx/progdlg.h> // for progress dialog definition
31
32#include "../core/tmarraysize.h"
33#include "../database/database_tm.h"
34#include "../gis/tmgisdatavectormysql.h" // for mysql gis data manipulation
35
37 private:
38 void InitMemberValues();
39
40 public:
41 wxRealPoint m_Pt;
42 long m_LineOID;
43 int m_Flaged;
44
46 m_Pt = wxRealPoint(-1, -1);
47 m_LineOID = wxNOT_FOUND;
48 m_Flaged = 0;
49 }
50
51 DanglingPtsToCheck(const wxRealPoint& pt, long oid) {
52 m_Pt = pt;
53 m_LineOID = oid;
54 m_Flaged = 0;
55 }
56
58 ;
59 }
60};
61
62// Creating a list of MemoryFields
63WX_DECLARE_OBJARRAY(DanglingPtsToCheck, tmArrayDanglingPtsToCheck);
64
65class ToolDanglingNodes : public wxObject {
66 private:
67 tmArrayDanglingPtsToCheck m_PtsToCheck;
68 DataBaseTM* m_pDB;
69 bool m_bSearchInited;
70 bool m_bSearchRun;
71
72 long m_LayerID;
73
74 int m_LoopNum;
75 wxProgressDialog* m_pDlg;
76
77 tmGISDataVectorMYSQL m_GisData;
78 OGRPolygon* m_GeomFrame;
79
80 void DNInitValues();
81
82 // private check
83 bool DNIsLayerCorrect(long layerid);
84
85 bool DNIsSearchInitedOk();
86
87 // private search part
88 bool DNGetAllLines(long layerid);
89
90 bool DNSearchValidVertex();
91
92 bool DNFlagNodes();
93
94 bool DNIsPointInside(OGRPoint* pt);
95
96 void DNSearchCleanUp();
97
98 bool DNGetFrameGeometry();
99
100 void DNParseFlagedPts(wxArrayRealPoints& dpts);
101
102 // update
103 bool DNUpdateProgress(unsigned int ptstocheck, unsigned int iloop);
104
105 protected:
106 public:
108
109 ToolDanglingNodes(DataBaseTM* database);
110
112
113 void Create(DataBaseTM* database);
114
115 bool IsOk();
116
117 bool GetDanglingNodes(wxArrayRealPoints& pts);
118
119 bool SearchInit(long layerid, const wxString& layername);
120
121 bool SearchInfo(int& numberlines);
122
123 bool SearchRun(wxProgressDialog* myProgDlg = nullptr);
124};
125
126#endif
Definition tooldanglingnodes.h:36
Definition database_tm.h:80
Definition tooldanglingnodes.h:65
bool GetDanglingNodes(wxArrayRealPoints &pts)
Get array of dangling nodes.
Definition tooldanglingnodes.cpp:305
Definition tmgisdatavectormysql.h:41