Skip to content

Commit e787f15

Browse files
committed
Merge branch 'master' of https://github.com/SpaceGroupUCL/depthmapX into table_scroll_to_selection
2 parents 1aa75ce + a5dd45a commit e787f15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+881
-239
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ depthmapX-build
44
build
55
RegressionTest/rundir
66
__pycache__
7-
depthmapX.pro.user
7+
CMakeLists.txt.user
88
*_BACKUP_*
99
*_BASE_*
1010
*_LOCAL_*

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Petros Koutsolampros <2184600+pklampros@users.noreply.github.com> <2184600+orange-vertex@users.noreply.github.com>
2+
Petros Koutsolampros <2184600+pklampros@users.noreply.github.com> Petros Koutsolampros <orange-vertex@users.noreply.github.com>
3+
Petros Koutsolampros <2184600+pklampros@users.noreply.github.com> Petros <orange-vertex@users.noreply.github.com>

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum macOS deployment version")
12
project(depthmapX)
23
cmake_minimum_required(VERSION 3.13.0)
3-
set(CMAKE_CXX_STANDARD 11)
4+
set(CMAKE_CXX_STANDARD 17)
45

56
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
67
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

cliTest/testlinkparser.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ TEST_CASE("LINK args invalid", "")
5454
LinkParser p;
5555
REQUIRE_THROWS_WITH(p.parse(ah.argc(), ah.argv()), Catch::Contains("Invalid link provided"));
5656
}
57-
{
58-
ArgumentHolder ah{"prog", "-f", "infile", "-o", "outfile", "-m", "LINK", "-lnk", "1.2,3.4,5.6,7.8", "-lm", "unlink", "-lmt", "pointmaps"};
59-
LinkParser p;
60-
REQUIRE_THROWS_WITH(p.parse(int(ah.argc()), ah.argv()), Catch::Contains("unlinking is not supported for pointmaps"));
61-
}
6257
}
6358

6459
TEST_CASE("LINK args valid", "valid")
@@ -73,6 +68,7 @@ TEST_CASE("LINK args valid", "valid")
7368
cmdP.parse(int(ah.argc()), ah.argv());
7469
REQUIRE(cmdP.getManualLinks().size() == 1);
7570
REQUIRE(cmdP.getManualLinks()[0] == "1.2,3.4,5.6,7.8");
71+
REQUIRE(cmdP.getLinkMode() == cmdP.LinkMode::LINK);
7672
}
7773

7874
{
@@ -82,6 +78,17 @@ TEST_CASE("LINK args valid", "valid")
8278
REQUIRE(cmdP.getManualLinks().size() == 2);
8379
REQUIRE(cmdP.getManualLinks()[0] == "1.2,3.4,5.6,7.8");
8480
REQUIRE(cmdP.getManualLinks()[1] == "0.1,0.2,0.3,0.4");
81+
REQUIRE(cmdP.getLinkMode() == cmdP.LinkMode::LINK);
8582
}
8683

84+
{
85+
ArgumentHolder ah{"prog", "-f", "infile", "-o", "outfile", "-m", "LINK", "-lnk", "1.2,3.4,5.6,7.8", "-lnk", "0.1,0.2,0.3,0.4",
86+
"-lm", "unlink", "-lmt", "pointmaps"};
87+
LinkParser cmdP;
88+
cmdP.parse(ah.argc(), ah.argv());
89+
REQUIRE(cmdP.getManualLinks().size() == 2);
90+
REQUIRE(cmdP.getManualLinks()[0] == "1.2,3.4,5.6,7.8");
91+
REQUIRE(cmdP.getManualLinks()[1] == "0.1,0.2,0.3,0.4");
92+
REQUIRE(cmdP.getLinkMode() == cmdP.LinkMode::UNLINK);
93+
}
8794
}

depthmapX/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ if(UNIX AND NOT APPLE)
7575
add_executable(${depthmapX} ${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC})
7676
endif()
7777
if(APPLE)
78+
set(MACOSX_BUNDLE_ICON_FILE depthmapX.icns)
79+
set(depthmapX_ICON ${CMAKE_CURRENT_SOURCE_DIR}/icons/depthmapX.icns)
80+
set_source_files_properties(${depthmapX_ICON} PROPERTIES
81+
MACOSX_PACKAGE_LOCATION "Resources")
82+
set(graph_ICON ${CMAKE_CURRENT_SOURCE_DIR}/icons/graph.icns)
83+
set_source_files_properties(${graph_ICON} PROPERTIES
84+
MACOSX_PACKAGE_LOCATION "Resources")
7885
add_definitions(-DGL_SILENCE_DEPRECATION)
79-
add_executable(${depthmapX} MACOSX_BUNDLE ${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC})
86+
add_executable(${depthmapX} MACOSX_BUNDLE ${depthmapX_ICON} ${graph_ICON}
87+
${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC})
8088
set_target_properties(${depthmapX} PROPERTIES
8189
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist)
8290
endif(APPLE)

depthmapX/dialogs/settings/interfacepage.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ InterfacePage::InterfacePage(Settings &settings, QWidget *parent)
2626
QCheckBox *legacyMapCheckBox = new QCheckBox(tr("Legacy map window as default"));
2727
legacyMapCheckBox->setChecked(m_defaultMapWindowIsLegacy);
2828
connect(legacyMapCheckBox, &QCheckBox::stateChanged, [=] () {m_defaultMapWindowIsLegacy = !m_defaultMapWindowIsLegacy;});
29+
QCheckBox *hoverCheckBox = new QCheckBox(tr("Allow highlighting shapes on hover"));
30+
hoverCheckBox->setChecked(m_highlightOnHover);
31+
connect(hoverCheckBox, &QCheckBox::stateChanged, [=] () {m_highlightOnHover = !m_highlightOnHover;});
2932

3033
QVBoxLayout *generalLayout = new QVBoxLayout;
3134
generalLayout->addWidget(legacyMapCheckBox);
35+
generalLayout->addWidget(hoverCheckBox);
3236
generalGroup->setLayout(generalLayout);
3337

3438
QGroupBox *interfaceColoursGroup = new QGroupBox(tr("Interface colours"));

depthmapX/dialogs/settings/interfacepage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ class InterfacePage : public SettingsPage
3131
std::map<QListWidgetItem *, QColor *> colourMap;
3232
int m_antialiasingSamples = 0;
3333
bool m_defaultMapWindowIsLegacy = false;
34+
bool m_highlightOnHover = true;
3435
void readSettings(Settings &settings) {
3536
m_foreground = QColor(settings.readSetting(SettingTag::foregroundColour, qRgb(128,255,128)).toInt());
3637
m_background = QColor(settings.readSetting(SettingTag::backgroundColour, qRgb(0,0,0)).toInt());
3738
m_antialiasingSamples = settings.readSetting(SettingTag::antialiasingSamples, 0).toInt();
3839
m_defaultMapWindowIsLegacy = settings.readSetting(SettingTag::legacyMapWindow, false).toBool();
40+
m_highlightOnHover = settings.readSetting(SettingTag::highlightOnHover, true).toBool();
3941
}
4042
private slots:
4143
void onInterfaceColourlItemClicked(QListWidgetItem *item);
@@ -46,5 +48,6 @@ private slots:
4648
settings.writeSetting(SettingTag::foregroundColour, m_foreground.rgb());
4749
settings.writeSetting(SettingTag::antialiasingSamples, m_antialiasingSamples);
4850
settings.writeSetting(SettingTag::legacyMapWindow, m_defaultMapWindowIsLegacy);
51+
settings.writeSetting(SettingTag::highlightOnHover, m_highlightOnHover);
4952
}
5053
};

depthmapX/mainwindow.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,68 +1069,84 @@ void MainWindow::updateActiveWindows()
10691069
{
10701070
case ID_MAPBAR_ITEM_SELECT:
10711071
SelectButton->setChecked(true);
1072+
activeMapView()->OnEditSelect();
10721073
break;
10731074
case ID_MAPBAR_ITEM_MOVE:
10741075
DragButton->setChecked(true);
1076+
activeMapView()->OnViewPan();
10751077
break;
10761078
case ID_MAPBAR_ITEM_ZOOM_IN:
10771079
zoomToolButton->setIcon(QIcon(":/images/win/b-5-3.png"));
10781080
zoomToolButton->setChecked(true);
10791081
zoomInAct->setChecked(true);
1082+
activeMapView()->OnViewZoomIn();
10801083
break;
10811084
case ID_MAPBAR_ITEM_ZOOM_OUT:
10821085
zoomToolButton->setIcon(QIcon(":/images/win/b-5-4.png"));
10831086
zoomToolButton->setChecked(true);
10841087
zoomOutAct->setChecked(true);
1088+
activeMapView()->OnViewZoomOut();
10851089
break;
10861090
case ID_MAPBAR_ITEM_FILL:
10871091
fillColorToolButton->setChecked(true);
1092+
activeMapView()->OnEditFill();
10881093
break;
10891094
case ID_MAPBAR_ITEM_SEMIFILL:
10901095
fillColorToolButton->setChecked(true);
1096+
activeMapView()->OnEditSemiFill();
10911097
break;
10921098
case ID_MAPBAR_ITEM_AUGMENT_FILL: // AV TV
10931099
fillColorToolButton->setChecked(true);
1100+
activeMapView()->OnEditAugmentFill();
10941101
break;
10951102
case ID_MAPBAR_ITEM_PENCIL:
10961103
SelectPenButton->setChecked(true);
1104+
activeMapView()->OnEditPencil();
10971105
break;
10981106
case ID_MAPBAR_ITEM_LINETOOL:
10991107
lineToolButton->setIcon(QIcon(":/images/win/b-5-10.png"));
11001108
lineToolButton->setChecked(true);
11011109
SelectLineAct->setChecked(true);
1110+
activeMapView()->OnEditLineTool();
11021111
break;
11031112
case ID_MAPBAR_ITEM_POLYGON:
11041113
lineToolButton->setIcon(QIcon(":/images/win/b-5-11.png"));
11051114
lineToolButton->setChecked(true);
11061115
SelectPolyLineAct->setChecked(true);
1116+
activeMapView()->OnEditPolygonTool();
11071117
break;
11081118
case ID_MAPBAR_ITEM_ISOVIST:
11091119
newisoToolButton->setIcon(QIcon(":/images/win/b-5-12.png"));
11101120
newisoToolButton->setChecked(true);
11111121
MakeIosAct->setChecked(true);
1122+
activeMapView()->OnModeIsovist();
11121123
break;
11131124
case ID_MAPBAR_ITEM_HALFISOVIST:
11141125
newisoToolButton->setIcon(QIcon(":/images/win/b-5-13.png"));
11151126
newisoToolButton->setChecked(true);
11161127
PartialMakeIosAct->setChecked(true);
1128+
activeMapView()->OnModeTargetedIsovist();
11171129
break;
11181130
case ID_MAPBAR_ITEM_AL2:
11191131
AxialMapButton->setChecked(true);
1132+
activeMapView()->OnModeSeedAxial();
11201133
break;
11211134
case ID_MAPBAR_ITEM_JOIN:
11221135
JoinToolButton->setIcon(QIcon(":/images/win/b-5-16.png"));
11231136
JoinToolButton->setChecked(true);
11241137
JoinAct->setChecked(true);
1138+
activeMapView()->OnModeJoin();
11251139
break;
11261140
case ID_MAPBAR_ITEM_UNJOIN:
11271141
JoinToolButton->setIcon(QIcon(":/images/win/b-5-17.png"));
11281142
JoinToolButton->setChecked(true);
11291143
JoinUnlinkAct->setChecked(true);
1144+
activeMapView()->OnModeUnjoin();
11301145
break;
11311146
default:
11321147
SelectButton->setChecked(true);
11331148
SelectButton->setChecked(false);
1149+
activeMapView()->OnEditSelect();
11341150
break;
11351151
}
11361152
QGraphDoc* m_p = activeMapDoc();

depthmapX/resources/Info.plist

Lines changed: 72 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,81 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSPrincipalClass</key>
6-
<string>NSApplication</string>
7-
<key>CFBundleIconFile</key>
8-
<string>depthmapX.icns</string>
9-
<key>CFBundlePackageType</key>
10-
<string>APPL</string>
11-
<key>CFBundleSignature</key>
12-
<string>????</string>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>depthmapX</string>
9+
<key>CFBundleDocumentTypes</key>
10+
<array>
11+
<dict>
12+
<key>CFBundleTypeExtensions</key>
13+
<array>
14+
<string>graph</string>
15+
</array>
16+
<key>CFBundleTypeIconFile</key>
17+
<string>graph.icns</string>
18+
<key>CFBundleTypeName</key>
19+
<string>Graph File</string>
20+
<key>CFBundleTypeOSTypes</key>
21+
<array>
22+
<string>graph</string>
23+
</array>
24+
<key>CFBundleTypeRole</key>
25+
<string>Editor</string>
26+
<key>NSDocumentClass</key>
27+
<string>GraphDocument</string>
28+
</dict>
29+
</array>
1330
<key>CFBundleExecutable</key>
1431
<string>depthmapX</string>
32+
<key>CFBundleIconFile</key>
33+
<string>depthmapX.icns</string>
1534
<key>CFBundleIdentifier</key>
1635
<string>com.spacegroupucl.depthmapX</string>
17-
<key>CFBundleDocumentTypes</key>
18-
<array>
19-
<dict>
20-
<key>CFBundleTypeExtensions</key>
21-
<array>
22-
<string>graph</string>
23-
</array>
24-
<key>CFBundleTypeName</key>
25-
<string>Graph File</string>
26-
<key>CFBundleTypeRole</key>
27-
<string>Editor</string>
28-
<key>CFBundleTypeIconFile</key>
29-
<string>graph.icns</string>
30-
</dict>
31-
</array>
36+
<key>CFBundleInfoDictionaryVersion</key>
37+
<string>6.0</string>
38+
<key>CFBundleName</key>
39+
<string>depthmapX</string>
40+
<key>CFBundlePackageType</key>
41+
<string>APPL</string>
42+
<key>CFBundleSupportedPlatforms</key>
43+
<array>
44+
<string>MacOSX</string>
45+
</array>
46+
<key>LSApplicationCategoryType</key>
47+
<string>public.app-category.business</string>
48+
<key>LSHasLocalizedDisplayName</key>
49+
<true/>
50+
<key>NSAppTransportSecurity</key>
51+
<dict>
52+
<key>NSAllowsArbitraryLoads</key>
53+
<true/>
54+
</dict>
55+
<key>NSMainNibFile</key>
56+
<string>MainMenu</string>
57+
<key>NSPrincipalClass</key>
58+
<string>depthmapXApplication</string>
59+
<key>UTExportedTypeDeclarations</key>
60+
<array>
61+
<dict>
62+
<key>UTTypeConformsTo</key>
63+
<string>public.data</string>
64+
<key>UTTypeDescription</key>
65+
<string>Graph File</string>
66+
<key>UTTypeIdentifier</key>
67+
<string>com.spacegroupucl.graph</string>
68+
<key>UTTypeTagSpecification</key>
69+
<dict>
70+
<key>com.apple.ostype</key>
71+
<array>
72+
<string>GRAPH</string>
73+
</array>
74+
<key>public.filename-extension</key>
75+
<string>graph</string>
76+
<key>public.mime-type</key>
77+
<string>application/graph</string>
78+
</dict>
79+
</dict>
80+
</array>
3281
</dict>
3382
</plist>

depthmapX/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace SettingTag
3636
const QString licenseAccepted = "licenseAccepted";
3737
const QString depthmapViewSize = "depthmapViewSize";
3838
const QString legacyMapWindow = "legacyMapWindow";
39+
const QString highlightOnHover = "highlightOnHover";
3940
}
4041

4142
/**

0 commit comments

Comments
 (0)