Skip to content

Commit

Permalink
Merge pull request #259 from PauloCarvalhoRJ/next_release
Browse files Browse the repository at this point in the history
Version 6.7
  • Loading branch information
PauloCarvalhoRJ authored Nov 29, 2020
2 parents beb65dc + 78728b3 commit 36f8801
Show file tree
Hide file tree
Showing 37 changed files with 1,544 additions and 64 deletions.
12 changes: 9 additions & 3 deletions GammaRay.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ win32 {
SOURCES += main.cpp\
dialogs/choosevariabledialog.cpp \
dialogs/faciestransitionmatrixoptionsdialog.cpp \
dialogs/sectiondialog.cpp \
domain/auxiliary/verticalproportioncurvemaker.cpp \
domain/section.cpp \
domain/verticalproportioncurve.cpp \
geometry/intersectionfinder.cpp \
geostats/mcmcdataimputation.cpp \
Expand Down Expand Up @@ -93,6 +95,7 @@ SOURCES += main.cpp\
vertpropcurves/verticalproportioncurvescanvaspicker.cpp \
vertpropcurves/verticalproportioncurvesplot.cpp \
viewer3d/v3dmouseinteractor.cpp \
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.cpp \
viewer3d/view3dtextconfigwidget.cpp \
widgets/linechartwidget.cpp \
widgets/qlistwidgetdnd.cpp \
Expand Down Expand Up @@ -150,7 +153,6 @@ SOURCES += main.cpp\
viewer3d/view3dwidget.cpp \
widgets/projecttreeview.cpp \
viewer3d/viewer3dlistwidget.cpp \
viewer3d/view3dstyle.cpp \
viewer3d/view3dbuilders.cpp \
viewer3d/view3dcolortables.cpp \
viewer3d/view3dconfigwidget.cpp \
Expand Down Expand Up @@ -291,12 +293,14 @@ SOURCES += main.cpp\
HEADERS += mainwindow.h \
dialogs/choosevariabledialog.h \
dialogs/faciestransitionmatrixoptionsdialog.h \
dialogs/sectiondialog.h \
domain/auxiliary/verticalproportioncurvemaker.h \
domain/project.h \
domain/application.h \
domain/projectcomponent.h \
domain/objectgroup.h \
domain/projectroot.h \
domain/section.h \
domain/verticalproportioncurve.h \
geometry/intersectionfinder.h \
geostats/mcmcdataimputation.h \
Expand Down Expand Up @@ -354,6 +358,7 @@ HEADERS += mainwindow.h \
vertpropcurves/verticalproportioncurvescanvaspicker.h \
vertpropcurves/verticalproportioncurvesplot.h \
viewer3d/v3dmouseinteractor.h \
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.h \
viewer3d/view3dtextconfigwidget.h \
widgets/linechartwidget.h \
widgets/qlistwidgetdnd.h \
Expand Down Expand Up @@ -411,7 +416,6 @@ HEADERS += mainwindow.h \
viewer3d/view3dwidget.h \
widgets/projecttreeview.h \
viewer3d/viewer3dlistwidget.h \
viewer3d/view3dstyle.h \
viewer3d/view3dbuilders.h \
viewer3d/view3dcolortables.h \
viewer3d/view3dconfigwidget.h \
Expand Down Expand Up @@ -556,6 +560,7 @@ HEADERS += mainwindow.h \
FORMS += mainwindow.ui \
dialogs/choosevariabledialog.ui \
dialogs/faciestransitionmatrixoptionsdialog.ui \
dialogs/sectiondialog.ui \
gslib/gslibparams/widgets/widgetgslibpardouble.ui \
gslib/gslibparams/widgets/widgetgslibparfile.ui \
gslib/gslibparams/widgets/widgetgslibparinputdata.ui \
Expand All @@ -571,6 +576,7 @@ FORMS += mainwindow.ui \
gslib/gslibparams/widgets/widgetgslibpargrid.ui \
gslib/gslibparams/widgets/widgetgslibparrepeat.ui \
gslib/gslibparams/widgets/widgetgslibparcolor.ui \
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.ui \
viewer3d/view3dtextconfigwidget.ui \
widgets/linechartwidget.ui \
vertpropcurves/verticalproportioncurvedialog.ui \
Expand Down Expand Up @@ -807,7 +813,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.6
VERSION = 6.7

# 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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ If you enjoyed this project, you might also enjoy GeostatsPy: https://github.com
Python script to convert Eclipse grids to Paraview-compatible VTU format: https://github.com/BinWang0213/PyGRDECL

VERSION HISTORY:<br>
&nbsp;&nbsp;&nbsp;Version 6.7 - New data type: Geologic section.<br>
&nbsp;&nbsp;&nbsp;Version 6.6 - Mean, median and Gaussian filters, improvements and bug fixes.<br>
&nbsp;&nbsp;&nbsp;Version 6.5 - vertical proportion curves, improvements Automatic Variogram Fitting, enhancements and several fixes.<br>
&nbsp;&nbsp;&nbsp;Version 6.3 - improvements to data imputation with MCMC and parameter experiments for Automatic Variogram Fitting.<br>
Expand Down
Binary file added art/iconsHD/section32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 125 additions & 0 deletions dialogs/sectiondialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#include "sectiondialog.h"
#include "ui_sectiondialog.h"

#include <QFileDialog>
#include <QMessageBox>

#include "util.h"
#include "domain/section.h"
#include "domain/application.h"
#include "domain/project.h"
#include "domain/pointset.h"
#include "domain/cartesiangrid.h"

SectionDialog::SectionDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SectionDialog)
{
ui->setupUi(this);

//deletes dialog from memory upon user closing it
this->setAttribute(Qt::WA_DeleteOnClose);

this->setWindowTitle( "Define a geologic section." );
}

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

void SectionDialog::onChoosePointSet()
{
QString path = QFileDialog::getOpenFileName(this, "Choose point set file:",
Util::getLastBrowsedDirectory());
if( path.isEmpty() )
return;

ui->txtPathToPointSet->setText( path );

Util::saveLastBrowsedDirectoryOfFile( path );
}

void SectionDialog::onChooseCartesianGrid()
{
QString path = QFileDialog::getOpenFileName(this, "Choose Cartesian grid file:",
Util::getLastBrowsedDirectory());
if( path.isEmpty() )
return;

ui->txtPathToCartesainGrid->setText( path );

Util::saveLastBrowsedDirectoryOfFile( path );
}

void SectionDialog::onCreate()
{
QString name = ui->txtName->text();

//sanity checks
{
if( name.isEmpty() ){
QMessageBox::critical( this, "Error",
QString("Name cannot be empty."));
return;
}
QFile file( ui->txtPathToPointSet->text() );
if( ! file.exists() ){
QMessageBox::critical( this, "Error",
QString("Point set file with the section path not found or not set."));
return;
}
file.setFileName( ui->txtPathToCartesainGrid->text() );
if( ! file.exists() ){
QMessageBox::critical( this, "Error",
QString("Cartesian grid file with the section data not found or not set."));
return;
}
}

//Create the section object.
Section* section = new Section( Application::instance()->getProject()->getPath() + '/' +
name );

//work on the point set with the geologic section areal path.
{
//Copy the point set file to the project directory.
QString ps_path = Util::copyFileToDir( ui->txtPathToPointSet->text(),
Application::instance()->getProject()->getPath() );

//Create the point set object.
PointSet* ps = new PointSet( ps_path );
ps->setInfo( 1, 2, 0, "" ); // this assumes the file format presented in the
// dialog's UI and in Section class' documentation.

//Adds the point set as a child of the Section object.
section->setPointSet( ps );
}

//work on the Cartesian grid with the geologic section data.
{
//Copy the Cartesian grid file to the project directory.
QString cg_path = Util::copyFileToDir( ui->txtPathToCartesainGrid->text(),
Application::instance()->getProject()->getPath() );

//Create the Cartesian grid object.
CartesianGrid* cg = new CartesianGrid( cg_path );
cg->setInfo( 0.0, 0.0, 0.0, //these parameters are not relevant for use in a section
1.0, 1.0, 1.0, //these parameters are not relevant for use in a section
ui->spinNI->value(), 1, ui->spinNK->value(), //nJ is always 1
0.0, 1, //these parameters are not relevant for use in a section
"",
QMap<uint, QPair<uint, QString> >(),
QList<QPair<uint, QString> >() );

//Adds the Cartesian grid as a child of the Section object.
section->setCartesianGrid( cg );
}

//Adds the section to the project tree.
Application::instance()->getProject()->addSection( section );
Application::instance()->refreshProjectTree();

//Close the dialog.
reject();
}
27 changes: 27 additions & 0 deletions dialogs/sectiondialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef SECTIONDIALOG_H
#define SECTIONDIALOG_H

#include <QDialog>

namespace Ui {
class SectionDialog;
}

class SectionDialog : public QDialog
{
Q_OBJECT

public:
explicit SectionDialog(QWidget *parent = nullptr);
~SectionDialog();

public Q_SLOTS:
void onChoosePointSet();
void onChooseCartesianGrid();
void onCreate();

private:
Ui::SectionDialog *ui;
};

#endif // SECTIONDIALOG_H
Loading

0 comments on commit 36f8801

Please sign in to comment.