forked from GeoDaCenter/geoda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GroupingMapView.h
126 lines (106 loc) · 3.89 KB
/
GroupingMapView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/**
* GeoDa TM, Copyright (C) 2011-2015 by Luc Anselin - all rights reserved
*
* This file is part of GeoDa.
*
* GeoDa 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.
*
* GeoDa 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __GEODA_CENTER_GROUPING_MAP_VIEW_H__
#define __GEODA_CENTER_GROUPING_MAP_VIEW_H__
#include <map>
#include <vector>
#include "MapNewView.h"
#include "../GdaConst.h"
using namespace std;
class HierachicalMapSelectDlg : public wxDialog
{
std::vector<GdaVarTools::VarInfo> vars;
std::vector<int> col_ids;
boost::uuids::uuid uid;
wxString title;
Project* project;
TableInterface* table_int;
wxChoice* group_var_list;
wxChoice* root_var_list;
std::map<wxString, wxString> name_to_nm;
std::map<wxString, int> name_to_tm_id;
public:
HierachicalMapSelectDlg(wxFrame *parent, Project* project);
virtual ~HierachicalMapSelectDlg();
void OnOK( wxCommandEvent& event );
std::vector<GdaVarTools::VarInfo> GetVarInfo();
std::vector<int> GetColIds();
wxString GetTitle();
boost::uuids::uuid GetWUID();
};
class HierachicalMapCanvas : public MapCanvas
{
DECLARE_CLASS(GroupingMapCanvas)
wxString group_field_nm;
wxString root_field_nm;
int root_field_id;
std::map<int, bool> grp_root;
int root_radius;
wxColour root_color;
virtual void DrawConnectivityGraph(wxMemoryDC &dc);
virtual void CreateConnectivityGraph();
public:
HierachicalMapCanvas(wxWindow *parent,
TemplateFrame* t_frame,
Project* project,
std::vector<GdaVarTools::VarInfo> vars,
std::vector<int> col_ids,
boost::uuids::uuid w_uuid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize);
virtual ~HierachicalMapCanvas();
virtual void DisplayRightClickMenu(const wxPoint& pos);
virtual wxString GetCanvasTitle();
virtual wxString GetVariableNames();
virtual bool ChangeMapType(CatClassification::CatClassifType new_map_theme,
SmoothingType new_map_smoothing);
virtual void SetCheckMarks(wxMenu* menu);
virtual void TimeChange();
virtual void TimeSyncVariableToggle(int var_index);
virtual void UpdateStatusBar();
void ChangeRootSize(int root_size);
void ChangeRootColor(wxColour root_color);
int GetRootSize();
wxColour GetRootColor();
DECLARE_EVENT_TABLE()
};
class HierachicalMapFrame : public MapFrame
{
DECLARE_CLASS(GroupingMapFrame)
public:
HierachicalMapFrame(wxFrame *parent,
Project* project,
std::vector<GdaVarTools::VarInfo> vars,
std::vector<int> col_ids,
boost::uuids::uuid w_uuid,
const wxString title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = GdaConst::map_default_size,
const long style = wxDEFAULT_FRAME_STYLE);
virtual ~HierachicalMapFrame();
void OnActivate(wxActivateEvent& event);
virtual void MapMenus();
virtual void UpdateOptionMenuItems();
virtual void UpdateContextMenuItems(wxMenu* menu);
virtual void update(WeightsManState* o);
void OnChangeConnRootSize(wxCommandEvent& event);
void OnChangeConnRootColor(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
#endif