Skip to content

Commit

Permalink
Merge pull request #261 from PauloCarvalhoRJ/Misc_Improvements
Browse files Browse the repository at this point in the history
Version 6.9.
  • Loading branch information
PauloCarvalhoRJ authored Apr 12, 2021
2 parents f5c6d64 + 4464754 commit d155519
Show file tree
Hide file tree
Showing 60 changed files with 2,126 additions and 91 deletions.
121 changes: 121 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
###############################################################################################################
# This script is used to build GammaRay in Travis CI continuous integration service (https://travis-ci.com) #
# under Ubuntu Linux v18.04 (identified as "bionic" in Travis). Travis instantiates a virtual machine with #
# the OS from scratch for each build, thus it is necessary to install or build all of GammaRay's dependencies #
# everytime. #
###############################################################################################################

language: cpp
compiler: gcc
dist: bionic

install:
# make sure all package listings are up-to-date
- sudo apt-get update -y
# the tree command
- sudo apt-get install tree
# Qt5
- sudo apt-get install -qq libqt5webkit5-dev qtdeclarative5-dev libqt5x11extras5-dev qttools5-dev
- export QMAKE=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
# this installs the CMake files that are helpful to build software with CMake and depending on Qt.
- sudo apt-get install qtbase5-dev
# this installs Qt Charts, which is required by GammaRay
- sudo apt-get install libqt5charts5 libqt5charts5-dev
# latest Boost library (devel package, that is: with the headers and linktime libraries in addition to the runtime libraries)
- sudo apt-get install libboost-all-dev
# the Fastest Fourier Transform in the West (v3) library (devel package)
#- sudo apt-get install -y fftw3-dev
- sudo apt-get install -y libfftw3-dev
# the GNU Scientific Libray
- sudo apt-get install libgsl-dev
# the Insight Toolkit libraries with advanced algorithms for image processing.
#- sudo apt-get install cmake insighttoolkit3-examples libfftw3-dev libinsighttoolkit3-dev libinsighttoolkit3.6 python-insighttoolkit3 tcl8.4 tcl8.4-insighttoolkit3 tk8.4
- sudo apt-get install libinsighttoolkit4-dev
# The Qt Widgets for Technical apllications libraries.
# Qwt depends on Qt
- sudo apt-get install -qq libqwt-dev
# The Visualization Toolkit: must build from sources (currently not installable with apt-get).
# VTK depends on Qt
- sudo apt-get install cmake
- git clone --depth 1 --branch v8.1.0 https://gitlab.kitware.com/vtk/vtk.git VTK-src
- mkdir VTK-build
- mkdir VTK-install
- cd VTK-build
- cmake -DVTK_QT_VERSION:STRING=5
-DQT_QMAKE_EXECUTABLE:PATH=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
-DVTK_Group_Qt:BOOL=ON
-DCMAKE_PREFIX_PATH:PATH=/usr/lib/x86_64-linux-gnu/cmake
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DCMAKE_INSTALL_PREFIX=../VTK-install
../VTK-src
#- make -j$(($(nproc) - 1)) --> this doesn't work on Travis CI. It was supposed to get the number of cores
- make -j16
- make install
- cd ..
# Installs the locate command and the mlocate file location database (this is not needed in the .travis.yml final version)
- sudo apt-get install mlocate
# Indexes all the files in the mlocate database (this is not needed in the .travis.yml final version)
- sudo updatedb

# Start virtual X server, from https://docs.travis-ci.com/user/gui-and-headless-browsers/
#before_script:
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 3 # give xvfb some time to start

env:
- BOOST_INCLUDE=/usr/include
FFTW3_INCLUDE=/usr/include
FFTW3_LIB=/usr/lib/x86_64-linux-gnu
GSL_INCLUDE=/usr/include
GSL_LIB=/usr/lib/x86_64-linux-gnu
ITK_INCLUDE=/usr/include/ITK-4.12
ITK_LIB=/usr/lib
ITK_VERSION_SUFFIX=-4.12
QWT_INCLUDE=/usr/include/qwt
QWT_LIB=/usr/lib
VTK_INCLUDE=./VTK-install/include/vtk-8.1
VTK_LIB=./VTK-install/lib
VTK_VERSION_SUFFIX=-8.1

script:
#Check directory listings
#- ls -al
#- ls /usr/include
#- tree /usr/lib
#- tree ../GammaRay_release
#- tree /usr/lib/x86_64-linux-gnu/qt5
#- tree /usr/lib/x86_64-linux-gnu/cmake
#- ls VTK-src
#Locate where the dependency headers are
- locate geometry.hpp
- locate fftw3.h
- locate gsl_sort.h
- locate itkGaborImageSource.h
- locate qwt_slider.h
- locate vtkLookupTable.h
#Locate where the dependency libraries are
- locate libfftw3
- locate libgsl
- locate libitk
- locate libqwt
- locate qwt.so
- locate libvtk
#Build the calculator script engine library.
- $QMAKE libCalcScripting.pro "CONFIG+=release" "CONFIG+=qtquickcompiler"
- make
#Build the program itself.
#NOTE: The "QMAKE_CFLAGS_ISYSTEM=-I" overwrites the default value (-isystem). The -isystem flag
# tells the compiler the headers inside the following directory are system headers, thus suppressing
# excessive compiler warnings that are often issued with them. However, the -isystem flag is known
# to cause certain system libraries (e.g. <stdlib.h>) to be not found with versions of Qt later than
# 5.10 and with newer compilers. It is safe to disable -isystem, but if you build this in QtCreator or
# other IDE, the excessive warnings coming from ITK and VTK headers may result in a crash or irresponsiveness.
# REFERENCES: https://github.com/OxfordSKA/OSKAR/issues/10
# https://github.com/machinekit/QtQuickVcp/issues/278
- $QMAKE GammaRay.pro "CONFIG+=release" "CONFIG+=qtquickcompiler" "QMAKE_CFLAGS_ISYSTEM=-I"
- make
#Show what was built.
- tree ../GammaRay_release

9 changes: 8 additions & 1 deletion GammaRay.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ win32 {
SOURCES += main.cpp\
dialogs/choosevariabledialog.cpp \
dialogs/faciestransitionmatrixoptionsdialog.cpp \
dialogs/populatewithproportionsfromvpcdialog.cpp \
dialogs/sectiondialog.cpp \
domain/auxiliary/verticalproportioncurvemaker.cpp \
domain/section.cpp \
domain/verticalproportioncurve.cpp \
geometry/intersectionfinder.cpp \
geometry/quadrilateral.cpp \
geometry/triangle.cpp \
geostats/mcmcdataimputation.cpp \
mainwindow.cpp \
domain/project.cpp \
Expand Down Expand Up @@ -293,6 +296,7 @@ SOURCES += main.cpp\
HEADERS += mainwindow.h \
dialogs/choosevariabledialog.h \
dialogs/faciestransitionmatrixoptionsdialog.h \
dialogs/populatewithproportionsfromvpcdialog.h \
dialogs/sectiondialog.h \
domain/auxiliary/verticalproportioncurvemaker.h \
domain/project.h \
Expand All @@ -303,6 +307,8 @@ HEADERS += mainwindow.h \
domain/section.h \
domain/verticalproportioncurve.h \
geometry/intersectionfinder.h \
geometry/quadrilateral.h \
geometry/triangle.h \
geostats/mcmcdataimputation.h \
util.h \
exceptions/invalidgslibdatafileexception.h \
Expand Down Expand Up @@ -560,6 +566,7 @@ HEADERS += mainwindow.h \
FORMS += mainwindow.ui \
dialogs/choosevariabledialog.ui \
dialogs/faciestransitionmatrixoptionsdialog.ui \
dialogs/populatewithproportionsfromvpcdialog.ui \
dialogs/sectiondialog.ui \
gslib/gslibparams/widgets/widgetgslibpardouble.ui \
gslib/gslibparams/widgets/widgetgslibparfile.ui \
Expand Down Expand Up @@ -813,7 +820,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.7
VERSION = 6.9

# Define a preprocessor macro so we can get the application version in application code.
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![Documentation Status](https://readthedocs.org/projects/gammaray/badge/?version=latest)](https://gammaray.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.com/PauloCarvalhoRJ/gammaray.svg?branch=master)](https://travis-ci.com/PauloCarvalhoRJ/gammaray)

<center><img src="https://github.com/PauloCarvalhoRJ/gammaray/blob/master/frontpage.png"/></center>

Repository of the GammaRay geostatistics software.

Expand All @@ -14,6 +15,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.9 - Export geologic grids as Eclipse grids, multiple other new features, enhancements and fixes.<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>
Expand Down
Binary file added art/iconsHD/v3DprojPar32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/iconsHD/v3DprojPer32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/iconsHD/v3Druler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions dialogs/choosevariabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@

#include "widgets/variableselector.h"

ChooseVariableDialog::ChooseVariableDialog(DataFile *df, const QString title, const QString caption, QWidget *parent) :
ChooseVariableDialog::ChooseVariableDialog(DataFile *df,
const QString title,
const QString caption,
bool showNotSet,
QWidget *parent) :
QDialog(parent),
ui(new Ui::ChooseVariableDialog),
m_df(df)
{
ui->setupUi(this);
m_variableSelector = new VariableSelector( true );
m_variableSelector = new VariableSelector( showNotSet );
m_variableSelector->onListVariables( df );
ui->layoutForCategorySelector->addWidget( m_variableSelector );
ui->lblCaption->setText( caption );
Expand Down
15 changes: 14 additions & 1 deletion dialogs/choosevariabledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,25 @@ class ChooseVariableDialog;
class DataFile;
class VariableSelector;

/** This is a dialog that allows the user to choose amongst the variables of a data set. */
class ChooseVariableDialog : public QDialog
{
Q_OBJECT

public:
explicit ChooseVariableDialog(DataFile* df, const QString title, const QString caption, QWidget *parent = nullptr);
/**
* @brief ChooseVariableDialog
* @param df
* @param title
* @param caption
* @param showNotSet If true (default), the user can opt to not set an attribute.
* @param parent
*/
explicit ChooseVariableDialog(DataFile* df,
const QString title,
const QString caption,
bool showNotSet = true,
QWidget *parent = nullptr);
~ChooseVariableDialog();

/** Returns -1 if the user opts to "NOT SET". */
Expand Down
8 changes: 6 additions & 2 deletions dialogs/indicatorkrigingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,14 @@ void IndicatorKrigingDialog::onSave()
for(int i = 0; i < pdf->getPairCount(); ++i){
//make a meaningful name
QString proposed_name( prefix );
if( cd )
if( cd ){
cd->readFromFS(); //making sure the categorical information is loaded from the file.
proposed_name.append( cd->getCategoryName( i ) );
else
} else {
Application::instance()->logWarn("IndicatorKrigingDialog::onSave(): null CategoryDefinition. Using "
"generic category names for the output variables.");
proposed_name.append( "Category_" ).append( pdf->get1stValue( i ) );
}

//the estimates normally follow the order of the categories in the resulting grid
Attribute* values = m_cg_estimation->getAttributeFromGEOEASIndex( i + 1 );
Expand Down
68 changes: 68 additions & 0 deletions dialogs/populatewithproportionsfromvpcdialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include "populatewithproportionsfromvpcdialog.h"
#include "ui_populatewithproportionsfromvpcdialog.h"

#include "domain/verticalproportioncurve.h"
#include "domain/cartesiangrid.h"

PopulateWithProportionsFromVPCDialog::PopulateWithProportionsFromVPCDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PopulateWithProportionsFromVPCDialog),
m_cg( nullptr ),
m_vpc( nullptr )
{
ui->setupUi(this);

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

this->setWindowTitle( "Populate object with proportions from a VPC" );
}

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

void PopulateWithProportionsFromVPCDialog::setCartesianGrid(CartesianGrid *cg)
{
m_cg = cg;
updateInterface();
}

void PopulateWithProportionsFromVPCDialog::setVPC(VerticalProportionCurve *vpc)
{
m_vpc = vpc;
updateInterface();
}

void PopulateWithProportionsFromVPCDialog::updateInterface()
{
ui->lblVPCname->setText( "" );
ui->lblTargetObjectName->setText( "" );
ui->spinTopK->setRange( 0, 99 );
ui->spinTopK->setValue( 0 );
ui->spinBaseK->setRange( 0, 99 );
ui->spinBaseK->setValue( 0 );

if( m_vpc ){
ui->lblVPCname->setText( m_vpc->getName() );
}

if( m_cg ){
ui->lblTargetObjectName->setText( m_cg->getName() );
ui->spinTopK->setRange( 0, m_cg->getNK()-1 );
ui->spinTopK->setValue( m_cg->getNK()-1 );
ui->spinBaseK->setRange( 0, m_cg->getNK()-1 );
ui->spinBaseK->setValue( 0 );
}
}

void PopulateWithProportionsFromVPCDialog::onProcess()
{
uint baseK = ui->spinBaseK->value();
uint topK = ui->spinTopK->value();

m_vpc->readFromFS();

m_cg->fillWithProportions( m_vpc, baseK, topK );
}
39 changes: 39 additions & 0 deletions dialogs/populatewithproportionsfromvpcdialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef POPULATEWITHPROPORTIONSFROMVPCDIALOG_H
#define POPULATEWITHPROPORTIONSFROMVPCDIALOG_H

#include <QDialog>

class CartesianGrid;
class VerticalProportionCurve;

namespace Ui {
class PopulateWithProportionsFromVPCDialog;
}

/** This dialog is used to populate objects with proportions read from
* a Vertical Proportion Curve object.
*/
class PopulateWithProportionsFromVPCDialog : public QDialog
{
Q_OBJECT

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

void setCartesianGrid( CartesianGrid* cg );

void setVPC( VerticalProportionCurve* vpc );

private:
Ui::PopulateWithProportionsFromVPCDialog *ui;
CartesianGrid* m_cg;
VerticalProportionCurve* m_vpc;

void updateInterface();

private Q_SLOTS:
void onProcess();
};

#endif // POPULATEWITHPROPORTIONSFROMVPCDIALOG_H
Loading

0 comments on commit d155519

Please sign in to comment.