Skip to content

Commit 36f8801

Browse files
Merge pull request #259 from PauloCarvalhoRJ/next_release
Version 6.7
2 parents beb65dc + 78728b3 commit 36f8801

37 files changed

+1544
-64
lines changed

GammaRay.pro

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ win32 {
3434
SOURCES += main.cpp\
3535
dialogs/choosevariabledialog.cpp \
3636
dialogs/faciestransitionmatrixoptionsdialog.cpp \
37+
dialogs/sectiondialog.cpp \
3738
domain/auxiliary/verticalproportioncurvemaker.cpp \
39+
domain/section.cpp \
3840
domain/verticalproportioncurve.cpp \
3941
geometry/intersectionfinder.cpp \
4042
geostats/mcmcdataimputation.cpp \
@@ -93,6 +95,7 @@ SOURCES += main.cpp\
9395
vertpropcurves/verticalproportioncurvescanvaspicker.cpp \
9496
vertpropcurves/verticalproportioncurvesplot.cpp \
9597
viewer3d/v3dmouseinteractor.cpp \
98+
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.cpp \
9699
viewer3d/view3dtextconfigwidget.cpp \
97100
widgets/linechartwidget.cpp \
98101
widgets/qlistwidgetdnd.cpp \
@@ -150,7 +153,6 @@ SOURCES += main.cpp\
150153
viewer3d/view3dwidget.cpp \
151154
widgets/projecttreeview.cpp \
152155
viewer3d/viewer3dlistwidget.cpp \
153-
viewer3d/view3dstyle.cpp \
154156
viewer3d/view3dbuilders.cpp \
155157
viewer3d/view3dcolortables.cpp \
156158
viewer3d/view3dconfigwidget.cpp \
@@ -291,12 +293,14 @@ SOURCES += main.cpp\
291293
HEADERS += mainwindow.h \
292294
dialogs/choosevariabledialog.h \
293295
dialogs/faciestransitionmatrixoptionsdialog.h \
296+
dialogs/sectiondialog.h \
294297
domain/auxiliary/verticalproportioncurvemaker.h \
295298
domain/project.h \
296299
domain/application.h \
297300
domain/projectcomponent.h \
298301
domain/objectgroup.h \
299302
domain/projectroot.h \
303+
domain/section.h \
300304
domain/verticalproportioncurve.h \
301305
geometry/intersectionfinder.h \
302306
geostats/mcmcdataimputation.h \
@@ -354,6 +358,7 @@ HEADERS += mainwindow.h \
354358
vertpropcurves/verticalproportioncurvescanvaspicker.h \
355359
vertpropcurves/verticalproportioncurvesplot.h \
356360
viewer3d/v3dmouseinteractor.h \
361+
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.h \
357362
viewer3d/view3dtextconfigwidget.h \
358363
widgets/linechartwidget.h \
359364
widgets/qlistwidgetdnd.h \
@@ -411,7 +416,6 @@ HEADERS += mainwindow.h \
411416
viewer3d/view3dwidget.h \
412417
widgets/projecttreeview.h \
413418
viewer3d/viewer3dlistwidget.h \
414-
viewer3d/view3dstyle.h \
415419
viewer3d/view3dbuilders.h \
416420
viewer3d/view3dcolortables.h \
417421
viewer3d/view3dconfigwidget.h \
@@ -556,6 +560,7 @@ HEADERS += mainwindow.h \
556560
FORMS += mainwindow.ui \
557561
dialogs/choosevariabledialog.ui \
558562
dialogs/faciestransitionmatrixoptionsdialog.ui \
563+
dialogs/sectiondialog.ui \
559564
gslib/gslibparams/widgets/widgetgslibpardouble.ui \
560565
gslib/gslibparams/widgets/widgetgslibparfile.ui \
561566
gslib/gslibparams/widgets/widgetgslibparinputdata.ui \
@@ -571,6 +576,7 @@ FORMS += mainwindow.ui \
571576
gslib/gslibparams/widgets/widgetgslibpargrid.ui \
572577
gslib/gslibparams/widgets/widgetgslibparrepeat.ui \
573578
gslib/gslibparams/widgets/widgetgslibparcolor.ui \
579+
viewer3d/view3dconfigwidgets/v3dcfgwidforattributeinpointset.ui \
574580
viewer3d/view3dtextconfigwidget.ui \
575581
widgets/linechartwidget.ui \
576582
vertpropcurves/verticalproportioncurvedialog.ui \
@@ -807,7 +813,7 @@ win32 {
807813
# The application version
808814
# Don't forget to update the Util::importSettingsFromPreviousVersion() method to
809815
# enable the import of registry/user settings of previous versions.
810-
VERSION = 6.6
816+
VERSION = 6.7
811817

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ If you enjoyed this project, you might also enjoy GeostatsPy: https://github.com
1212
Python script to convert Eclipse grids to Paraview-compatible VTU format: https://github.com/BinWang0213/PyGRDECL
1313

1414
VERSION HISTORY:<br>
15+
&nbsp;&nbsp;&nbsp;Version 6.7 - New data type: Geologic section.<br>
1516
&nbsp;&nbsp;&nbsp;Version 6.6 - Mean, median and Gaussian filters, improvements and bug fixes.<br>
1617
&nbsp;&nbsp;&nbsp;Version 6.5 - vertical proportion curves, improvements Automatic Variogram Fitting, enhancements and several fixes.<br>
1718
&nbsp;&nbsp;&nbsp;Version 6.3 - improvements to data imputation with MCMC and parameter experiments for Automatic Variogram Fitting.<br>

art/iconsHD/section32.png

476 Bytes
Loading

dialogs/sectiondialog.cpp

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#include "sectiondialog.h"
2+
#include "ui_sectiondialog.h"
3+
4+
#include <QFileDialog>
5+
#include <QMessageBox>
6+
7+
#include "util.h"
8+
#include "domain/section.h"
9+
#include "domain/application.h"
10+
#include "domain/project.h"
11+
#include "domain/pointset.h"
12+
#include "domain/cartesiangrid.h"
13+
14+
SectionDialog::SectionDialog(QWidget *parent) :
15+
QDialog(parent),
16+
ui(new Ui::SectionDialog)
17+
{
18+
ui->setupUi(this);
19+
20+
//deletes dialog from memory upon user closing it
21+
this->setAttribute(Qt::WA_DeleteOnClose);
22+
23+
this->setWindowTitle( "Define a geologic section." );
24+
}
25+
26+
SectionDialog::~SectionDialog()
27+
{
28+
delete ui;
29+
}
30+
31+
void SectionDialog::onChoosePointSet()
32+
{
33+
QString path = QFileDialog::getOpenFileName(this, "Choose point set file:",
34+
Util::getLastBrowsedDirectory());
35+
if( path.isEmpty() )
36+
return;
37+
38+
ui->txtPathToPointSet->setText( path );
39+
40+
Util::saveLastBrowsedDirectoryOfFile( path );
41+
}
42+
43+
void SectionDialog::onChooseCartesianGrid()
44+
{
45+
QString path = QFileDialog::getOpenFileName(this, "Choose Cartesian grid file:",
46+
Util::getLastBrowsedDirectory());
47+
if( path.isEmpty() )
48+
return;
49+
50+
ui->txtPathToCartesainGrid->setText( path );
51+
52+
Util::saveLastBrowsedDirectoryOfFile( path );
53+
}
54+
55+
void SectionDialog::onCreate()
56+
{
57+
QString name = ui->txtName->text();
58+
59+
//sanity checks
60+
{
61+
if( name.isEmpty() ){
62+
QMessageBox::critical( this, "Error",
63+
QString("Name cannot be empty."));
64+
return;
65+
}
66+
QFile file( ui->txtPathToPointSet->text() );
67+
if( ! file.exists() ){
68+
QMessageBox::critical( this, "Error",
69+
QString("Point set file with the section path not found or not set."));
70+
return;
71+
}
72+
file.setFileName( ui->txtPathToCartesainGrid->text() );
73+
if( ! file.exists() ){
74+
QMessageBox::critical( this, "Error",
75+
QString("Cartesian grid file with the section data not found or not set."));
76+
return;
77+
}
78+
}
79+
80+
//Create the section object.
81+
Section* section = new Section( Application::instance()->getProject()->getPath() + '/' +
82+
name );
83+
84+
//work on the point set with the geologic section areal path.
85+
{
86+
//Copy the point set file to the project directory.
87+
QString ps_path = Util::copyFileToDir( ui->txtPathToPointSet->text(),
88+
Application::instance()->getProject()->getPath() );
89+
90+
//Create the point set object.
91+
PointSet* ps = new PointSet( ps_path );
92+
ps->setInfo( 1, 2, 0, "" ); // this assumes the file format presented in the
93+
// dialog's UI and in Section class' documentation.
94+
95+
//Adds the point set as a child of the Section object.
96+
section->setPointSet( ps );
97+
}
98+
99+
//work on the Cartesian grid with the geologic section data.
100+
{
101+
//Copy the Cartesian grid file to the project directory.
102+
QString cg_path = Util::copyFileToDir( ui->txtPathToCartesainGrid->text(),
103+
Application::instance()->getProject()->getPath() );
104+
105+
//Create the Cartesian grid object.
106+
CartesianGrid* cg = new CartesianGrid( cg_path );
107+
cg->setInfo( 0.0, 0.0, 0.0, //these parameters are not relevant for use in a section
108+
1.0, 1.0, 1.0, //these parameters are not relevant for use in a section
109+
ui->spinNI->value(), 1, ui->spinNK->value(), //nJ is always 1
110+
0.0, 1, //these parameters are not relevant for use in a section
111+
"",
112+
QMap<uint, QPair<uint, QString> >(),
113+
QList<QPair<uint, QString> >() );
114+
115+
//Adds the Cartesian grid as a child of the Section object.
116+
section->setCartesianGrid( cg );
117+
}
118+
119+
//Adds the section to the project tree.
120+
Application::instance()->getProject()->addSection( section );
121+
Application::instance()->refreshProjectTree();
122+
123+
//Close the dialog.
124+
reject();
125+
}

dialogs/sectiondialog.h

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

0 commit comments

Comments
 (0)