Skip to content

Commit 728fc3e

Browse files
Merge pull request #301 from PauloCarvalhoRJ/mcrf_unattended
Mcrf unattended and other improvements and fixes.
2 parents f9b63f1 + 7b15799 commit 728fc3e

29 files changed

+1157
-95
lines changed

GammaRay.pro

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#
55
#-------------------------------------------------
66

7+
CONFIG += c++14 #required by Boost > 1.72
8+
79
QT += core gui charts
810

911
greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
@@ -34,6 +36,7 @@ win32 {
3436
SOURCES += main.cpp\
3537
dialogs/choosevariabledialog.cpp \
3638
dialogs/faciestransitionmatrixoptionsdialog.cpp \
39+
dialogs/gridrepositiondialog.cpp \
3740
dialogs/listbuilderdialog.cpp \
3841
dialogs/mcrfbayesiansimdialog.cpp \
3942
dialogs/populatewithproportionsfromvpcdialog.cpp \
@@ -306,6 +309,7 @@ SOURCES += main.cpp\
306309
HEADERS += mainwindow.h \
307310
dialogs/choosevariabledialog.h \
308311
dialogs/faciestransitionmatrixoptionsdialog.h \
312+
dialogs/gridrepositiondialog.h \
309313
dialogs/listbuilderdialog.h \
310314
dialogs/mcrfbayesiansimdialog.h \
311315
dialogs/populatewithproportionsfromvpcdialog.h \
@@ -586,6 +590,7 @@ HEADERS += mainwindow.h \
586590
FORMS += mainwindow.ui \
587591
dialogs/choosevariabledialog.ui \
588592
dialogs/faciestransitionmatrixoptionsdialog.ui \
593+
dialogs/gridrepositiondialog.ui \
589594
dialogs/listbuilderdialog.ui \
590595
dialogs/mcrfbayesiansimdialog.ui \
591596
dialogs/populatewithproportionsfromvpcdialog.ui \
@@ -801,7 +806,8 @@ LIBS += -lITKCommon$$_ITK_VERSION_SUFFIX \
801806
-litkvnl_algo$$_ITK_VERSION_SUFFIX \
802807
-lITKIOPNG$$_ITK_VERSION_SUFFIX \
803808
-lITKTransform$$_ITK_VERSION_SUFFIX \
804-
-lITKSmoothing$$_ITK_VERSION_SUFFIX
809+
-lITKSmoothing$$_ITK_VERSION_SUFFIX \
810+
-lITKConvolution$$_ITK_VERSION_SUFFIX
805811

806812
#=============================================================================
807813

@@ -847,7 +853,7 @@ win32 {
847853
# The application version
848854
# Don't forget to update the Util::importSettingsFromPreviousVersion() method to
849855
# enable the import of registry/user settings of previous versions.
850-
VERSION = 6.17
856+
VERSION = 6.18
851857

852858
# Define a preprocessor macro so we can get the application version in application code.
853859
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

algorithms/ialgorithmdatasource.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "ialgorithmdatasource.h"
22
#include <cassert>
3+
#include <cstdint>
34

45
bool almostEqual2sComplement(double A, double B, int maxUlps) {
56
// Make sure maxUlps is non-negative and small enough that the

dialogs/gridrepositiondialog.cpp

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include "gridrepositiondialog.h"
2+
#include "ui_gridrepositiondialog.h"
3+
4+
#include "domain/cartesiangrid.h"
5+
6+
GridRepositionDialog::GridRepositionDialog(CartesianGrid *cg, QWidget *parent) :
7+
QDialog(parent),
8+
m_cg(cg),
9+
ui(new Ui::GridRepositionDialog)
10+
{
11+
ui->setupUi(this);
12+
13+
this->setWindowTitle("Align/reposition grid");
14+
15+
if( cg ){
16+
double x,y,z;
17+
18+
ui->spinLLB_I->setRange(0, cg->getNI()-1 );
19+
ui->spinLLB_J->setRange(0, cg->getNJ()-1 );
20+
ui->spinLLB_K->setRange(0, cg->getNK()-1 );
21+
ui->spinLLB_I->setValue( 0 );
22+
ui->spinLLB_J->setValue( 0 );
23+
ui->spinLLB_K->setValue( 0 );
24+
25+
ui->dblSpinLLB_X->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
26+
ui->dblSpinLLB_Y->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
27+
ui->dblSpinLLB_Z->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
28+
cg->getCellLocation( 0, 0, 0, x, y, z );
29+
ui->dblSpinLLB_X->setValue( x );
30+
ui->dblSpinLLB_Y->setValue( y );
31+
ui->dblSpinLLB_Z->setValue( z );
32+
33+
ui->spinURT_I->setRange(0, cg->getNI()-1 );
34+
ui->spinURT_J->setRange(0, cg->getNJ()-1 );
35+
ui->spinURT_K->setRange(0, cg->getNK()-1 );
36+
ui->spinURT_I->setValue( cg->getNI()-1 );
37+
ui->spinURT_J->setValue( cg->getNJ()-1 );
38+
ui->spinURT_K->setValue( cg->getNK()-1 );
39+
40+
ui->dblSpinURT_X->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
41+
ui->dblSpinURT_Y->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
42+
ui->dblSpinURT_Z->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
43+
cg->getCellLocation( cg->getNI()-1 , cg->getNJ()-1 , cg->getNK()-1 , x, y, z );
44+
ui->dblSpinURT_X->setValue( x );
45+
ui->dblSpinURT_Y->setValue( y );
46+
ui->dblSpinURT_Z->setValue( z );
47+
}
48+
}
49+
50+
GridRepositionDialog::~GridRepositionDialog()
51+
{
52+
delete ui;
53+
}
54+
55+
void GridRepositionDialog::accept()
56+
{
57+
m_cg->reposition( ui->spinLLB_I->value(), ui->spinLLB_J->value(), ui->spinLLB_K->value(),
58+
ui->dblSpinLLB_X->value(), ui->dblSpinLLB_Y->value(), ui->dblSpinLLB_Z->value(),
59+
ui->spinURT_I->value(), ui->spinURT_J->value(), ui->spinURT_K->value(),
60+
ui->dblSpinURT_X->value(), ui->dblSpinURT_Y->value(), ui->dblSpinURT_Z->value());
61+
62+
QDialog::accept();
63+
}

dialogs/gridrepositiondialog.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#ifndef GRIDREPOSITIONDIALOG_H
2+
#define GRIDREPOSITIONDIALOG_H
3+
4+
#include <QDialog>
5+
6+
class CartesianGrid;
7+
8+
namespace Ui {
9+
class GridRepositionDialog;
10+
}
11+
12+
class GridRepositionDialog : public QDialog
13+
{
14+
Q_OBJECT
15+
16+
public:
17+
explicit GridRepositionDialog(CartesianGrid* cg, QWidget *parent = nullptr);
18+
~GridRepositionDialog();
19+
20+
public Q_SLOTS:
21+
void accept() override;
22+
23+
private:
24+
Ui::GridRepositionDialog *ui;
25+
26+
CartesianGrid* m_cg;
27+
};
28+
29+
#endif // GRIDREPOSITIONDIALOG_H

0 commit comments

Comments
 (0)