Skip to content

Commit

Permalink
Merge pull request #301 from PauloCarvalhoRJ/mcrf_unattended
Browse files Browse the repository at this point in the history
Mcrf unattended and other improvements and fixes.
  • Loading branch information
PauloCarvalhoRJ authored Mar 20, 2024
2 parents f9b63f1 + 7b15799 commit 728fc3e
Show file tree
Hide file tree
Showing 29 changed files with 1,157 additions and 95 deletions.
10 changes: 8 additions & 2 deletions GammaRay.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
#-------------------------------------------------

CONFIG += c++14 #required by Boost > 1.72

QT += core gui charts

greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
Expand Down Expand Up @@ -34,6 +36,7 @@ win32 {
SOURCES += main.cpp\
dialogs/choosevariabledialog.cpp \
dialogs/faciestransitionmatrixoptionsdialog.cpp \
dialogs/gridrepositiondialog.cpp \
dialogs/listbuilderdialog.cpp \
dialogs/mcrfbayesiansimdialog.cpp \
dialogs/populatewithproportionsfromvpcdialog.cpp \
Expand Down Expand Up @@ -306,6 +309,7 @@ SOURCES += main.cpp\
HEADERS += mainwindow.h \
dialogs/choosevariabledialog.h \
dialogs/faciestransitionmatrixoptionsdialog.h \
dialogs/gridrepositiondialog.h \
dialogs/listbuilderdialog.h \
dialogs/mcrfbayesiansimdialog.h \
dialogs/populatewithproportionsfromvpcdialog.h \
Expand Down Expand Up @@ -586,6 +590,7 @@ HEADERS += mainwindow.h \
FORMS += mainwindow.ui \
dialogs/choosevariabledialog.ui \
dialogs/faciestransitionmatrixoptionsdialog.ui \
dialogs/gridrepositiondialog.ui \
dialogs/listbuilderdialog.ui \
dialogs/mcrfbayesiansimdialog.ui \
dialogs/populatewithproportionsfromvpcdialog.ui \
Expand Down Expand Up @@ -801,7 +806,8 @@ LIBS += -lITKCommon$$_ITK_VERSION_SUFFIX \
-litkvnl_algo$$_ITK_VERSION_SUFFIX \
-lITKIOPNG$$_ITK_VERSION_SUFFIX \
-lITKTransform$$_ITK_VERSION_SUFFIX \
-lITKSmoothing$$_ITK_VERSION_SUFFIX
-lITKSmoothing$$_ITK_VERSION_SUFFIX \
-lITKConvolution$$_ITK_VERSION_SUFFIX

#=============================================================================

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

# Define a preprocessor macro so we can get the application version in application code.
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
Expand Down
1 change: 1 addition & 0 deletions algorithms/ialgorithmdatasource.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ialgorithmdatasource.h"
#include <cassert>
#include <cstdint>

bool almostEqual2sComplement(double A, double B, int maxUlps) {
// Make sure maxUlps is non-negative and small enough that the
Expand Down
63 changes: 63 additions & 0 deletions dialogs/gridrepositiondialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "gridrepositiondialog.h"
#include "ui_gridrepositiondialog.h"

#include "domain/cartesiangrid.h"

GridRepositionDialog::GridRepositionDialog(CartesianGrid *cg, QWidget *parent) :
QDialog(parent),
m_cg(cg),
ui(new Ui::GridRepositionDialog)
{
ui->setupUi(this);

this->setWindowTitle("Align/reposition grid");

if( cg ){
double x,y,z;

ui->spinLLB_I->setRange(0, cg->getNI()-1 );
ui->spinLLB_J->setRange(0, cg->getNJ()-1 );
ui->spinLLB_K->setRange(0, cg->getNK()-1 );
ui->spinLLB_I->setValue( 0 );
ui->spinLLB_J->setValue( 0 );
ui->spinLLB_K->setValue( 0 );

ui->dblSpinLLB_X->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
ui->dblSpinLLB_Y->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
ui->dblSpinLLB_Z->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
cg->getCellLocation( 0, 0, 0, x, y, z );
ui->dblSpinLLB_X->setValue( x );
ui->dblSpinLLB_Y->setValue( y );
ui->dblSpinLLB_Z->setValue( z );

ui->spinURT_I->setRange(0, cg->getNI()-1 );
ui->spinURT_J->setRange(0, cg->getNJ()-1 );
ui->spinURT_K->setRange(0, cg->getNK()-1 );
ui->spinURT_I->setValue( cg->getNI()-1 );
ui->spinURT_J->setValue( cg->getNJ()-1 );
ui->spinURT_K->setValue( cg->getNK()-1 );

ui->dblSpinURT_X->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
ui->dblSpinURT_Y->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
ui->dblSpinURT_Z->setRange( std::numeric_limits<double>::min(), std::numeric_limits<double>::max() );
cg->getCellLocation( cg->getNI()-1 , cg->getNJ()-1 , cg->getNK()-1 , x, y, z );
ui->dblSpinURT_X->setValue( x );
ui->dblSpinURT_Y->setValue( y );
ui->dblSpinURT_Z->setValue( z );
}
}

GridRepositionDialog::~GridRepositionDialog()
{
delete ui;
}

void GridRepositionDialog::accept()
{
m_cg->reposition( ui->spinLLB_I->value(), ui->spinLLB_J->value(), ui->spinLLB_K->value(),
ui->dblSpinLLB_X->value(), ui->dblSpinLLB_Y->value(), ui->dblSpinLLB_Z->value(),
ui->spinURT_I->value(), ui->spinURT_J->value(), ui->spinURT_K->value(),
ui->dblSpinURT_X->value(), ui->dblSpinURT_Y->value(), ui->dblSpinURT_Z->value());

QDialog::accept();
}
29 changes: 29 additions & 0 deletions dialogs/gridrepositiondialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef GRIDREPOSITIONDIALOG_H
#define GRIDREPOSITIONDIALOG_H

#include <QDialog>

class CartesianGrid;

namespace Ui {
class GridRepositionDialog;
}

class GridRepositionDialog : public QDialog
{
Q_OBJECT

public:
explicit GridRepositionDialog(CartesianGrid* cg, QWidget *parent = nullptr);
~GridRepositionDialog();

public Q_SLOTS:
void accept() override;

private:
Ui::GridRepositionDialog *ui;

CartesianGrid* m_cg;
};

#endif // GRIDREPOSITIONDIALOG_H
Loading

0 comments on commit 728fc3e

Please sign in to comment.