Skip to content

Commit a0ef6c8

Browse files
committed
Merge branch 'master' of https://github.com/SpaceGroupUCL/depthmapX into table_scroll_to_selection
2 parents 3b5c3ef + e43e9c5 commit a0ef6c8

File tree

92 files changed

+693
-576
lines changed

Some content is hidden

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

92 files changed

+693
-576
lines changed

cliTest/testcommandlineparser.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TestParser: public IModeParser
4747
_parseCalled = true;
4848
}
4949

50-
virtual void run(const CommandLineParser &clp, IPerformanceSink &perfWriter) const
50+
virtual void run(const CommandLineParser &, IPerformanceSink &) const
5151
{
5252
_runCalled = true;
5353
}
@@ -70,8 +70,8 @@ class TestParser: public IModeParser
7070

7171
TEST_CASE("Invalid Parser","Constructor"){
7272
std::vector<std::unique_ptr<IModeParser> > parsers;
73-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST1"))));
74-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST2"))));
73+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST1")));
74+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST2")));
7575

7676
Mock<IModeParserFactory> factoryMock;
7777
When(Method(factoryMock,getModeParsers)).AlwaysReturn(parsers);
@@ -143,8 +143,8 @@ TEST_CASE("Invalid Parser","Constructor"){
143143

144144
TEST_CASE("Valid Parser","CheckValues"){
145145
std::vector<std::unique_ptr<IModeParser> > parsers;
146-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST1"))));
147-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST2"))));
146+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST1")));
147+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST2")));
148148

149149
Mock<IModeParserFactory> factoryMock;
150150
When(Method(factoryMock,getModeParsers)).AlwaysReturn(parsers);
@@ -187,8 +187,8 @@ TEST_CASE("Valid Parser","CheckValues"){
187187

188188
TEST_CASE("Run Tests","Check we only run if it's appropriate"){
189189
std::vector<std::unique_ptr<IModeParser> > parsers;
190-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST1"))));
191-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST2"))));
190+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST1")));
191+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST2")));
192192

193193
Mock<IModeParserFactory> factoryMock;
194194
When(Method(factoryMock,getModeParsers)).AlwaysReturn(parsers);
@@ -260,8 +260,8 @@ TEST_CASE("Run Tests","Check we only run if it's appropriate"){
260260
TEST_CASE("Invalid Parser Need Help", "CheckForHelp")
261261
{
262262
std::vector<std::unique_ptr<IModeParser> > parsers;
263-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST1"))));
264-
parsers.push_back(std::move(std::unique_ptr<IModeParser>(new TestParser("TEST2"))));
263+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST1")));
264+
parsers.push_back(std::unique_ptr<IModeParser>(new TestParser("TEST2")));
265265

266266
Mock<IModeParserFactory> factoryMock;
267267
When(Method(factoryMock,getModeParsers)).AlwaysReturn(parsers);

depthmapX/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,17 @@ qt5_wrap_ui(UI_HDRS
6666
UI/AboutDlg.ui
6767
UI/licenseagreement.ui)
6868

69-
qt5_wrap_cpp(UI_SRCS
70-
${UI_HDRS})
71-
7269
qt5_add_resources(DM_RSRC resource.qrc dialogs/settings/settingsdialog.qrc)
7370

7471
if (MSVC)
75-
add_executable(${depthmapX} WIN32 ${depthmapX_SRCS} ${UI_HDRS} ${UI_SRCS} ${DM_RSRC} icons.rc)
72+
add_executable(${depthmapX} WIN32 ${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC} icons.rc)
7673
endif(MSVC)
7774
if(UNIX AND NOT APPLE)
78-
add_executable(${depthmapX} ${depthmapX_SRCS} ${UI_HDRS} ${UI_SRCS} ${DM_RSRC})
75+
add_executable(${depthmapX} ${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC})
7976
endif()
8077
if(APPLE)
81-
add_executable(${depthmapX} MACOSX_BUNDLE ${depthmapX_SRCS} ${UI_HDRS} ${UI_SRCS} ${DM_RSRC})
78+
add_definitions(-DGL_SILENCE_DEPRECATION)
79+
add_executable(${depthmapX} MACOSX_BUNDLE ${depthmapX_SRCS} ${UI_HDRS} ${DM_RSRC})
8280
set_target_properties(${depthmapX} PROPERTIES
8381
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist)
8482
endif(APPLE)

depthmapX/GraphDoc.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ void QGraphDoc::exceptionThrownInRenderThread(int type, std::string message) {
104104
message << "This operation requires isovist analysis. To run it go to: ";
105105
message << "Tools -> Visibility -> Run Visibility Graph Analysis... ";
106106
message << "and select \"Calculate isovist properties\"";
107-
message << flush;
108107
QMessageBox::warning(this, tr("Warning"), tr(message.str().c_str()),
109108
QMessageBox::Ok, QMessageBox::Ok);
110109
}
@@ -406,7 +405,6 @@ void QGraphDoc::OnVGALinksFileImport()
406405
message << fileName;
407406
message << "\n\n Error: ";
408407
message << e.what();
409-
message << flush;
410408
QMessageBox::warning(this, tr("Warning"), tr(message.str().c_str()),
411409
QMessageBox::Ok, QMessageBox::Ok);
412410
}
@@ -417,7 +415,6 @@ void QGraphDoc::OnVGALinksFileImport()
417415
message << fileName;
418416
message << "\n\n Error: ";
419417
message << e.what();
420-
message << flush;
421418
QMessageBox::warning(this, tr("Warning"), tr(message.str().c_str()),
422419
QMessageBox::Ok, QMessageBox::Ok);
423420
}

depthmapX/dialogs/ColourScaleDlg.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,21 @@ CColourScaleDlg::CColourScaleDlg(QWidget *parent) : QDialog(parent) {
4141
c_red_slider_ctrl->setTickInterval(10);
4242

4343
// these are out of order...
44-
c_color_type->addItem(QString(tr("Equal Ranges (3-Colour)"))); // 0
45-
c_color_type->addItem(QString(tr("Equal Ranges (Blue-Red)"))); // 5
46-
c_color_type->addItem(QString(tr("Equal Ranges (Purple-Orange)"))); // 4
47-
c_color_type->addItem(QString(tr("depthmapX Classic"))); // 3
48-
c_color_type->addItem(QString(tr("Equal Ranges (Greyscale)"))); // 1
49-
c_color_type->addItem(QString(tr("Equal Ranges (Monochrome)"))); // 2
50-
51-
m_color_type_map.push_back(0);
52-
m_color_type_map.push_back(5);
53-
m_color_type_map.push_back(4);
54-
m_color_type_map.push_back(3);
55-
m_color_type_map.push_back(1);
56-
m_color_type_map.push_back(2);
44+
c_color_type->addItem(QString(tr("Equal Ranges (3-Colour)"))); // AXMANESQUE
45+
c_color_type->addItem(QString(tr("Equal Ranges (Blue-Red)"))); // BLUERED
46+
c_color_type->addItem(QString(tr("Equal Ranges (Purple-Orange)"))); // PURPLEORANGE
47+
c_color_type->addItem(QString(tr("depthmapX Classic"))); // DEPTHMAPCLASSIC
48+
c_color_type->addItem(QString(tr("Equal Ranges (Greyscale)"))); // GREYSCALE
49+
c_color_type->addItem(QString(tr("Equal Ranges (Monochrome)"))); // MONOCHROME
50+
c_color_type->addItem(QString(tr("Equal Ranges (3-Colour Hue Only)"))); // HUEONLYAXMANESQUE
51+
52+
m_color_type_map.push_back(DisplayParams::AXMANESQUE);
53+
m_color_type_map.push_back(DisplayParams::BLUERED);
54+
m_color_type_map.push_back(DisplayParams::PURPLEORANGE);
55+
m_color_type_map.push_back(DisplayParams::DEPTHMAPCLASSIC);
56+
m_color_type_map.push_back(DisplayParams::GREYSCALE);
57+
m_color_type_map.push_back(DisplayParams::MONOCHROME);
58+
m_color_type_map.push_back(DisplayParams::HUEONLYAXMANESQUE);
5759

5860
Clear();
5961

@@ -100,7 +102,7 @@ void CColourScaleDlg::OnSelchangeColor(int value) {
100102

101103
m_color = m_color_type_map[value];
102104

103-
if (m_color == 0 || m_color == 3 || m_color == 5) {
105+
if (m_color == 0 || m_color == 3 || m_color == 5 || m_color == 6) {
104106
m_red = "Red";
105107
m_blue = "Blue";
106108
} else if (m_color == 4) {

depthmapX/indexWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ QT_BEGIN_NAMESPACE
3232
AttribWindow::AttribWindow(QWidget *parent, bool custom)
3333
: QListWidget(parent)
3434
{
35-
custom = NULL;
35+
custom = false;
3636

3737
main_frm = parent;
3838
installEventFilter(this);

depthmapX/mainwindow.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ QmyEvent::QmyEvent(Type type, void* wp, int lp)
5454
void MainWindow::actionEvent ( QActionEvent * event )
5555
{
5656
int id;
57-
if(id = event->action()->data().toInt())
57+
if((id = event->action()->data().toInt()))
5858
{
59-
int k = id;
60-
6159
}
6260
}
6361

@@ -964,7 +962,7 @@ void MainWindow::updateActiveWindows()
964962
m_p->SetRedrawFlag(QGraphDoc::VIEW_ALL, QGraphDoc::REDRAW_GRAPH, QGraphDoc::NEW_FOCUS );
965963
return;
966964
}
967-
else if(p = qobject_cast<Q3DView *>(activeSubWindow->widget()))
965+
else if((p = qobject_cast<Q3DView *>(activeSubWindow->widget())))
968966
{
969967
editToolBar->hide();
970968
plotToolBar->hide();
@@ -2841,9 +2839,9 @@ void MainWindow::updateToolbar()
28412839

28422840
if (( ( (m_p->m_meta_graph->getViewClass() & MetaGraph::VIEWVGA) &&
28432841
(m_p->m_meta_graph->getDisplayedPointMap().getFilledPointCount() > 1)) ||
2844-
( (m_p->m_meta_graph->getViewClass() & MetaGraph::VIEWAXIAL) &&
2842+
(((m_p->m_meta_graph->getViewClass() & MetaGraph::VIEWAXIAL) &&
28452843
(m_p->m_meta_graph->getState() & MetaGraph::SHAPEGRAPHS)) &&
2846-
(!m_p->m_meta_graph->getDisplayedShapeGraph().isSegmentMap()) ) )
2844+
(!m_p->m_meta_graph->getDisplayedShapeGraph().isSegmentMap()) ) ))
28472845
JoinToolButton->setEnabled(true);
28482846
else
28492847
{

depthmapX/views/3dview/3dview.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include <GL/glu.h>
3434
#endif
3535

36+
#include "glureimpl.h"
37+
3638
#ifndef _WIN32 // Not working?
3739
#define LOBYTE(w) ((unsigned char)((w) & 0xff))
3840
#define GetRValue(rgb) (LOBYTE(rgb))
@@ -328,7 +330,9 @@ void Q3DView::Reshape(int x, int y)
328330
{
329331
glMatrixMode(GL_PROJECTION);
330332
glLoadIdentity();
331-
gluPerspective(45.0f, (GLfloat) x / (GLfloat) y, 0.1f, 3.0f);
333+
334+
gluReimpl::gluPerspective(45.0f, (GLfloat) x / (GLfloat) y, 0.1f, 3.0f);
335+
332336
// leave matrix mode in model view:
333337
glMatrixMode(GL_MODELVIEW);
334338
}
@@ -744,13 +748,14 @@ void Q3DView::CreateAgent(QPoint point)
744748
GLint realy = viewport[3] - point.y();
745749

746750
GLdouble wx1, wy1, wz1, wx2, wy2, wz2;
747-
gluUnProject((GLdouble) point.x(), (GLdouble) realy, 0.0,
751+
752+
gluReimpl::gluUnProject((GLdouble) point.x(), (GLdouble) realy, 0.0,
748753
mvmatrix, projmatrix, viewport, &wx1, &wy1, &wz1);
749-
gluUnProject((GLdouble) point.x(), (GLdouble) realy, 1.0,
754+
gluReimpl::gluUnProject((GLdouble) point.x(), (GLdouble) realy, 1.0,
750755
mvmatrix, projmatrix, viewport, &wx2, &wy2, &wz2);
751756

752757
// 0 plane has to lie between wz1 and wz2:
753-
if (finite(wz1) && finite(wz2) && wz1 > 0 && wz2 < 0) {
758+
if (std::isfinite(wz1) && std::isfinite(wz2) && wz1 > 0 && wz2 < 0) {
754759
double scaling = wz1/(wz2-wz1);
755760
Point2f p(wx1-scaling*(wx2-wx1),wy1-scaling*(wy2-wy1));
756761

@@ -1253,6 +1258,8 @@ void Q3DView::mousePressEvent(QMouseEvent *event)
12531258
case Qt::RightButton:
12541259
OnRButtonDown(0, event->pos());
12551260
break;
1261+
default:
1262+
break;
12561263
}
12571264
}
12581265

@@ -1267,6 +1274,8 @@ void Q3DView::mouseReleaseEvent(QMouseEvent *event)
12671274
case Qt::RightButton:
12681275
OnRButtonUp(0, event->pos());
12691276
break;
1277+
default:
1278+
break;
12701279
}
12711280
}
12721281

0 commit comments

Comments
 (0)