Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/palaeoware/SPIERS
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellGarwood committed Apr 26, 2020
2 parents 5093b43 + 91a410e commit 112083d
Show file tree
Hide file tree
Showing 190 changed files with 3,184 additions and 1,383 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.autosave
*.user
*.8-pre1
*.DS_Store
.DS_Store
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,37 @@ We recommend you install and use MSYS2 (64-bit) a Windows package manager, based

#### Ubuntu 18.04 64-bit - QT Creator + QT v5.x and VTK v7.1 using GCC (64-bit)

1. The simplest way to install Q5.X on your system is to download and run the installer from Qt: https://www.qt.io/download Further instructions are available here: https://wiki.qt.io/Install_Qt_5_on_Ubuntu
2. SPIERSview requires VTK: The Linux version of SPIERSview is currently employs VTK7.1, installed from the Ubuntu package (e.g. sudo apt-get install libvtk7-qt-dev)
3. Using the above package, you should be able to find the required VTK libraries under /usr/include/vtk-7.1/ they can also be included, if needed, in the working directory, and added to the executable at link time using the QMAKE_RPATHDIR variable - e.g. #QMAKE_RPATHDIR += $$PWD/vtk-7.X/
1. Install GCC and QT5.X on your system. You can do this two ways, by using system packages:

`sudo apt-get install build-essential libgl1-mesa-dev`

`sudo apt install qt5-default`

Or by downloading and running the installer from Qt: https://www.qt.io/download Further instructions are available here: https://wiki.qt.io/Install_Qt_5_on_Ubuntu

2. SPIERSview requires VTK: The Linux version of SPIERSview is currently employs VTK7.1. This can also be installed from the Ubuntu packages:

`sudo apt-get install libvtk7-qt-dev`

3. Using the above package, you should be able to find the required VTK libraries under /usr/include/vtk-7.1/ They can also be included, if needed, in the working directory, and added to the executable at link time using the QMAKE_RPATHDIR variable - e.g. #QMAKE_RPATHDIR += $$PWD/vtk-7.X/
4. You should then be able to compile SPIERS by opening the .pro file in QT creator and following standard debug/release procedure.

#### macOS Catalina 64-bit - QT Creator + QT v5.x and VTK v8.2 (via Homebrew) using Clang 64-bit/XCode 11 toolchain

1. Install XCode 11 from Apple App Store.
2. Install QT5.x/QT Creator from https://www.qt.io/download.
3. Install Homebrew (https://brew.sh/).
4. Get VTK 8.2 package via Homebrew - you may need to force Homebrew to install a specific VTK version see Homebrew instruction on how to do so:

`brew install vtk`

5. Check/Update the path to the VTK package in the ./SPIERSview/SPIERSview.pro file, where "8.2.0_10" is your installed version number:

'LIBS += -L$$PWD/../../../../../../usr/local/Cellar/vtk/8.2.0_10/lib/ \'

6. You should then be able to compile SPIERS by opening the .pro file in QT creator and following standard debug/release procedure.

Note: it may be possible to install QT5.x/QT Creator via Homebrew rather than via the Apple App Store.
_____

## 4. Minimum Requirements
Expand Down
3 changes: 3 additions & 0 deletions SPIERS.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ SUBDIRS = SPIERSalign \
SPIERSedit \
SPIERSview \
SPIERSutility/SPIERSversion \

CONFIG +=
sdk_no_version_check
6 changes: 6 additions & 0 deletions SPIERSalign/SPIERSalign.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ DESTDIR \
+= \
bin

#Needed to make binaries launchable from file in Ubuntu - GCC default link flag -pie on newer Ubuntu versions this so otherwise recognised as shared library
QMAKE_LFLAGS += -no-pie

RC_FILE += resources/icon.rc

DISTFILES += \
Expand All @@ -37,6 +40,9 @@ OBJECTS_DIR = build
FORMS += ui/mainwindow.ui \
ui/about.ui

#Mac icon
ICON = resources/SPIERSalignIcon.icns

HEADERS += src/mainwindowimpl.h \
src/globals.h \
src/scene.h \
Expand Down
2 changes: 1 addition & 1 deletion SPIERSalign/align.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/">
<file alias="alignicon.png">resources/alignicon.png</file>
<file>resources/SPIERSalignIcon.svg</file>
</qresource>
</RCC>
4 changes: 2 additions & 2 deletions SPIERSalign/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
# -- Project information -----------------------------------------------------

project = 'SPIERSalign'
copyright = '2018, Russell Garwood, Mark Sutton, Alan R.T. Spencer'
copyright = '2018-2019, Russell Garwood, Mark Sutton, Alan R.T. Spencer'
author = 'Russell Garwood, Mark Sutton, Alan R.T. Spencer'

# The short X.Y version
version = '3.0.0'
# The full version, including alpha/beta/rc tags
release = '3.0.0-rc.1'
release = '3.0.0'


# -- General configuration ---------------------------------------------------
Expand Down
Binary file added SPIERSalign/resources/SPIERSalignIcon.icns
Binary file not shown.
Binary file added SPIERSalign/resources/SPIERSalignIcon.ico
Binary file not shown.
28 changes: 28 additions & 0 deletions SPIERSalign/resources/SPIERSalignIcon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed SPIERSalign/resources/alignicon.png
Binary file not shown.
Binary file removed SPIERSalign/resources/icon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion SPIERSalign/resources/icon.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
IDI_ICON1 ICON DISCARDABLE "icon.ico"
IDI_ICON1 ICON DISCARDABLE "SPIERSalignIcon.ico"
6 changes: 3 additions & 3 deletions SPIERSalign/src/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* About Dialog
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -36,7 +36,7 @@ About::About(QWidget *parent) :

ui->header->setVisible(false);

ui->textLabel_1->setText(theMainWindow->windowTitle());
ui->textLabel_1->setText(QString(PRODUCTNAME) + " - Version " + QString(SOFTWARE_VERSION));
ui->textLabel_1->setObjectName("aboutTextLabel1");
ui->textLabel_1->setAlignment(Qt::AlignCenter);

Expand Down
4 changes: 2 additions & 2 deletions SPIERSalign/src/about.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Header: About
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions SPIERSalign/src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Globals
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down
7 changes: 4 additions & 3 deletions SPIERSalign/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Header: Globals
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -29,9 +29,10 @@
#include <QPushButton>
#include <QString>
#include <QTransform>
#include <QSettings>

//Legal Stuff
#define COPYRIGHT "Copyright © 2018 Mark D. Sutton, Russell J. Garwood, Alan R.T.Spencer"
#define COPYRIGHT "Copyright © 2018-2020 Mark D. Sutton, Russell J. Garwood, Alan R.T.Spencer"
#define LICENCE "This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions of the GPL v3 license"

//Programme Name
Expand Down
4 changes: 2 additions & 2 deletions SPIERSalign/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Main
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down
38 changes: 23 additions & 15 deletions SPIERSalign/src/mainwindowimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Main Window
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -43,6 +43,7 @@
#include <QUrl>
#include <QVBoxLayout>
#include <QFont>
#include <QStandardPaths>

#include <math.h>
#include <qbitmap.h>
Expand Down Expand Up @@ -72,9 +73,10 @@ MainWindowImpl::MainWindowImpl(QWidget *parent, Qt::WindowFlags f)
{
//Set up initial variables
setupUi(this);
setWindowIcon(QIcon (":/alignicon.png"));

setWindowTitle(QString(PRODUCTNAME) + " v" + QString(SOFTWARE_VERSION) );
qDebug() << QImageWriter::supportedImageFormats();

setWindowTitle(QString(PRODUCTNAME) + " - Version " + QString(SOFTWARE_VERSION));

showMaximized();

Expand Down Expand Up @@ -507,7 +509,7 @@ void readSuperGlobals()
//Clear recentfilelist just in case already exists
recentFileList.clear();
//New settings to be read from the registry
QSettings settings("Mark Sutton", "SPIERSalign 2.0");
QSettings settings("Palaeoware", "SPIERSalign");
int size = settings.beginReadArray("RecentFiles");
//Read files from registry
for (int i = 0; i < size; ++i)
Expand All @@ -527,7 +529,7 @@ void readSuperGlobals()
void writeSuperGlobals()
{
//New settings to be written
QSettings settings("Mark Sutton", "SPIERSalign 2.0");
QSettings settings("Palaeoware", "SPIERSalign");
settings.beginWriteArray("RecentFiles");
int loop;
if (recentFileList.size() > 20) loop = 20;
Expand Down Expand Up @@ -1927,14 +1929,14 @@ void MainWindowImpl::on_actionOpen_triggered()

notes->clear();

this->setWindowTitle(QString(PRODUCTNAME) + " v" + QString(SOFTWARE_VERSION));
this->setWindowTitle(QString(PRODUCTNAME) + " - Version " + QString(SOFTWARE_VERSION));
}
currentImage = 0;

if (fullSettingsFileName.isEmpty())
{
filesDirectoryString = QFileDialog::getExistingDirectory(this, tr("Select folder containing image files"),
"d:/", QFileDialog::ShowDirsOnly);
filesDirectoryString = QFileDialog::getExistingDirectory(this, tr("Select folder containing image files; note the files within a folder will not be listed if you are using Windows."),
QString(QStandardPaths::DesktopLocation), QFileDialog::ShowDirsOnly);
if (filesDirectoryString == "") return; //dialogue cancelled
filesDirectory = filesDirectoryString; //construct directory object
}
Expand All @@ -1949,7 +1951,7 @@ void MainWindowImpl::on_actionOpen_triggered()
recentFile(filesDirectoryString);

QStringList FilterList;
FilterList << "*.bmp" << "*.jpg" << "*.jpeg" << "*.png";
FilterList << "*.bmp" << "*.jpg" << "*.jpeg" << "*.png" << "*.tiff" << "*.tif";
drectoryFileList = filesDirectory.entryList(FilterList, QDir::Files, QDir::Name);

if (drectoryFileList.count() == 0)
Expand Down Expand Up @@ -2101,12 +2103,14 @@ void MainWindowImpl::on_actionOpen_triggered()
for (i = 0; i < imageList.count(); i++)
{
imageList[i]->format = -1;
if (imageList[i]->fileName.endsWith(".tif", Qt::CaseInsensitive) || imageList[i]->fileName.endsWith(".tiff", Qt::CaseInsensitive))imageList[i]->format = 3;
if (imageList[i]->fileName.endsWith(".png", Qt::CaseInsensitive))imageList[i]->format = 2;
if (imageList[i]->fileName.endsWith(".jpg", Qt::CaseInsensitive) || imageList[i]->fileName.endsWith(".jpeg", Qt::CaseInsensitive))imageList[i]->format = 1;
if (imageList[i]->fileName.endsWith(".bmp", Qt::CaseInsensitive))imageList[i]->format = 0;

if (imageList[i]->format == -1)
{
QMessageBox::warning(this, "Error", "Please check extensions - should be either .jpg, .jpeg, .bmp or .png", QMessageBox::Ok);
QMessageBox::warning(this, "Error", "Please check extensions - should be either .jpg, .jpeg, .bmp, .tif, .tiff or .png", QMessageBox::Ok);
return;
}
}
Expand Down Expand Up @@ -2206,10 +2210,10 @@ void MainWindowImpl::redrawImage()
LogText("*6\t");

//Title bar
QString output = QString(SOFTWARE_VERSION) + imageList[currentImage]->fileName;
QString output = " - " + imageList[currentImage]->fileName;
QString output2;
output2.sprintf(" - (%d/%d)", currentImage + 1, imageList.count());
this->setWindowTitle(QString(PRODUCTNAME) + " v" + output + output2);
this->setWindowTitle(QString(PRODUCTNAME) + " - Version " + QString(SOFTWARE_VERSION) + output + output2);

LogText("*7\t");
//Rescale view
Expand Down Expand Up @@ -3442,6 +3446,7 @@ void MainWindowImpl::on_actionApply_Propogation_triggered()
if (imageList[i]->format == 0)imageToDraw.save(savename, "BMP", 100);
if (imageList[i]->format == 1)imageToDraw.save(savename, "JPG", 100);
if (imageList[i]->format == 2)imageToDraw.save(savename, "PNG", 50);
if (imageList[i]->format == 3)imageToDraw.save(savename, "TIFF");
}
}
else if (actionLock_Back->isChecked())
Expand Down Expand Up @@ -3552,6 +3557,7 @@ void MainWindowImpl::on_actionApply_Propogation_triggered()
if (imageList[i]->format == 0)imageToDraw.save(savename, "BMP", 100);
if (imageList[i]->format == 1)imageToDraw.save(savename, "JPG", 100);
if (imageList[i]->format == 2)imageToDraw.save(savename, "PNG", 50);
if (imageList[i]->format == 3)imageToDraw.save(savename, "TIFF");
}
}
else QMessageBox::warning(this, "Error", "You should never see this - propagation failed, email me.", QMessageBox::Ok);
Expand Down Expand Up @@ -4267,8 +4273,8 @@ void MainWindowImpl::on_actionLoad_Settings_File_triggered()

int i, j = 0;
if ((QMessageBox::question(nullptr, "Confirm", "Are you sure you want to load a settings file? This will overwrite the current settings and apply the new ones to the currently open dataset.",
QMessageBox::Ok, QMessageBox::Cancel)) == QMessageBox::Cancel)return;
QString settingsFile = QFileDialog::getOpenFileName(this, tr("Select settings file"), "d:/");
QMessageBox::Ok, QMessageBox::Cancel)) == QMessageBox::Cancel) return;
QString settingsFile = QFileDialog::getOpenFileName(this, tr("Select settings file"), QString(QStandardPaths::DesktopLocation));
if (settingsFile == "") return;

QFile settings(settingsFile);
Expand Down Expand Up @@ -4356,6 +4362,7 @@ void MainWindowImpl::on_actionLoad_Settings_File_triggered()
for (i = 0; i < imageList.count(); i++)
{
imageList[i]->format = -1;
if (imageList[i]->fileName.endsWith(".tif", Qt::CaseInsensitive) || imageList[i]->fileName.endsWith(".tiff", Qt::CaseInsensitive))imageList[i]->format = 3;
if (imageList[i]->fileName.endsWith(".png", Qt::CaseInsensitive))imageList[i]->format = 2;
if (imageList[i]->fileName.endsWith(".jpg", Qt::CaseInsensitive) || imageList[i]->fileName.endsWith(".jpeg", Qt::CaseInsensitive))imageList[i]->format = 1;
if (imageList[i]->fileName.endsWith(".bmp", Qt::CaseInsensitive))imageList[i]->format = 0;
Expand Down Expand Up @@ -4430,6 +4437,7 @@ void MainWindowImpl::on_actionLoad_Settings_File_triggered()
if (imageList[i]->format == 0)imageToDraw.save(savename, "BMP", 100);
if (imageList[i]->format == 1)imageToDraw.save(savename, "JPG", 100);
if (imageList[i]->format == 2)imageToDraw.save(savename, "PNG", 50);
if (imageList[i]->format == 3)imageToDraw.save(savename, "TIFF");

redrawImage();
}
Expand Down
4 changes: 2 additions & 2 deletions SPIERSalign/src/mainwindowimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Header: Main Window
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions SPIERSalign/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file
* Scene
*
* All SPIERSview code is released under the GNU General Public License.
* All SPIERSalign code is released under the GNU General Public License.
* See LICENSE.md files in the programme directory.
*
* All SPIERSview code is Copyright 2008-2018 by Russell J. Garwood, Mark D. Sutton,
* All SPIERSalign code is Copyright 2008-2019 by Russell J. Garwood, Mark D. Sutton,
* and Alan R.T. Spencer.
*
* This program is free software; you can redistribute it and/or modify
Expand Down

0 comments on commit 112083d

Please sign in to comment.