Skip to content

Commit 161aaca

Browse files
Merge pull request #278 from PauloCarvalhoRJ/Upgrade_to_VTK9.1
Upgrade to vtk9.1
2 parents 26c1662 + 03e4f52 commit 161aaca

26 files changed

+201
-137
lines changed

GammaRay.pro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ isEmpty(_QWT_LIB){
689689
}
690690
INCLUDEPATH += $$_QWT_INCLUDE
691691
LIBPATH += $$_QWT_LIB
692-
LIBS += -lqwt
692+
LIBS += -lqwt-qt5
693693
#==============================================================
694694

695695
#========== The VTK include and lib paths and libraries==================
@@ -744,7 +744,6 @@ LIBS += -lvtkGUISupportQt$$_VTK_VERSION_SUFFIX \
744744
-lvtkImagingGeneral$$_VTK_VERSION_SUFFIX \
745745
-lvtkRenderingVolume$$_VTK_VERSION_SUFFIX \
746746
-lvtkFiltersStatistics$$_VTK_VERSION_SUFFIX \
747-
-lvtkalglib$$_VTK_VERSION_SUFFIX \
748747
-lvtkImagingStencil$$_VTK_VERSION_SUFFIX \
749748
-lvtkImagingHybrid$$_VTK_VERSION_SUFFIX \
750749
-lvtkRenderingContext2D$$_VTK_VERSION_SUFFIX \
@@ -778,7 +777,8 @@ LIBS += -lITKCommon$$_ITK_VERSION_SUFFIX \
778777
-litkvnl$$_ITK_VERSION_SUFFIX \
779778
-litkvnl_algo$$_ITK_VERSION_SUFFIX \
780779
-lITKIOPNG$$_ITK_VERSION_SUFFIX \
781-
-lITKTransform$$_ITK_VERSION_SUFFIX
780+
-lITKTransform$$_ITK_VERSION_SUFFIX \
781+
-lITKSmoothing$$_ITK_VERSION_SUFFIX
782782

783783
#=============================================================================
784784

@@ -824,7 +824,7 @@ win32 {
824824
# The application version
825825
# Don't forget to update the Util::importSettingsFromPreviousVersion() method to
826826
# enable the import of registry/user settings of previous versions.
827-
VERSION = 6.14
827+
VERSION = 6.16
828828

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

README.md

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

1717
VERSION HISTORY:<br>
18+
&nbsp;&nbsp;&nbsp;Version 6.16 - Upgrade of VTK to 9.1 and other years-old dependencies; some fixes.<br>
1819
&nbsp;&nbsp;&nbsp;Version 6.14 - Several improvements mainly involving the 3D Viewer and dataset processing.<br>
1920
&nbsp;&nbsp;&nbsp;Version 6.12 - Several new methods to work with grids. Several fixes and enhancements.<br>
2021
&nbsp;&nbsp;&nbsp;Version 6.9 - Export geologic grids as Eclipse grids, multiple other new features, enhancements and fixes.<br>

dialogs/dynamicfaciesrelationshipdiagramdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <QScrollBar>
1313
#include <QClipboard>
1414
#include <QInputDialog>
15+
#include <QFile>
1516

1617
DynamicFaciesRelationshipDiagramDialog::DynamicFaciesRelationshipDiagramDialog(
1718
std::vector<Attribute *> &categoricalAttributes,

dialogs/krigingdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <QInputDialog>
2020
#include <QMessageBox>
21+
#include <QFile>
2122
#include <cmath>
2223

2324
KrigingDialog::KrigingDialog(QWidget *parent) :

dialogs/mcrfsimdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void MCRFSimDialog::onRun()
174174
Application::instance()->logError( " Last error:" + markovSim.getLastError() );
175175
} else {
176176
int realNum = 1;
177-
for( const spectral::arrayPtr& simValues : markovSim.getRealizations() ){
177+
for( spectral::arrayPtr simValues : markovSim.getRealizations() ){
178178
markovSim.m_cgSim->append( m_commonSimulationParameters->getBaseNameForRealizationVariables() + QString::number(realNum),
179179
*simValues,
180180
markovSim.m_pdf->getCategoryDefinition() );

docs/GammaRayManual.docx

-334 KB
Binary file not shown.

docs/figures.pptx

-2.4 KB
Binary file not shown.

imagejockey/gabor/gaborfilterdialog.cpp

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ VTK_MODULE_INIT(vtkRenderingFreeType)
1919
#include "imagejockey/paraviewscalarbar/vtkParaViewScalarBar.h"
2020
#include "util.h"
2121
#include <QProgressDialog>
22-
#include <QVTKOpenGLWidget.h>
22+
#include <QVTKOpenGLNativeWidget.h>
2323
#include <QMessageBox>
2424
#include <vtkAxesActor.h>
2525
#include <vtkOrientationMarkerWidget.h>
@@ -64,23 +64,23 @@ GaborFilterDialog::GaborFilterDialog(IJAbstractCartesianGrid *inputGrid,
6464
}
6565

6666
///-------------------setup the 3D viewer-------------------
67-
_vtkwidget = new QVTKOpenGLWidget();
67+
_vtkwidget = new QVTKOpenGLNativeWidget();
6868

6969
_renderer = vtkSmartPointer<vtkRenderer>::New();
7070

7171
// enable antialiasing
7272
_renderer->SetUseFXAA( true );
7373

74-
_vtkwidget->SetRenderWindow(vtkGenericOpenGLRenderWindow::New());
75-
_vtkwidget->GetRenderWindow()->AddRenderer(_renderer);
74+
_vtkwidget->setRenderWindow(vtkGenericOpenGLRenderWindow::New());
75+
_vtkwidget->renderWindow()->AddRenderer(_renderer);
7676
_vtkwidget->setFocusPolicy(Qt::StrongFocus);
7777

7878
//----------------------adding the orientation axes-------------------------
7979
vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
8080
_vtkAxesWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
8181
_vtkAxesWidget->SetOutlineColor(0.9300, 0.5700, 0.1300);
8282
_vtkAxesWidget->SetOrientationMarker(axes);
83-
_vtkAxesWidget->SetInteractor(_vtkwidget->GetRenderWindow()->GetInteractor());
83+
_vtkAxesWidget->SetInteractor(_vtkwidget->renderWindow()->GetInteractor());
8484
_vtkAxesWidget->SetViewport(0.0, 0.0, 0.2, 0.2);
8585
_vtkAxesWidget->SetEnabled(1);
8686
_vtkAxesWidget->InteractiveOn();
@@ -155,7 +155,8 @@ void GaborFilterDialog::updateDisplay()
155155
double featureSizeFinal = ( featureSizeXFinal + featureSizeYFinal ) / 2;
156156
//get the feature size step size (intial size is greater because initial frequency is lower)
157157
double dFeatureSize = ( featureSizeInitial - featureSizeFinal ) / ( s1 - s0 ) ;
158-
158+
//get the z coordinate of the origin of the spectrogram
159+
double spectrogramOriginZ = featureSizeFinal - 0.5 * dFeatureSize;
159160

160161
/////--------------------code to render the spectrogram cube-----------------------
161162
vtkSmartPointer<vtkActor> spectrogramActor = vtkSmartPointer<vtkActor>::New();
@@ -182,7 +183,7 @@ void GaborFilterDialog::updateDisplay()
182183
dFeatureSize);
183184
spectrogramGridAsCellCentered->SetOrigin ( m_inputGrid->getOriginX() - m_inputGrid->getCellSizeI()/2,
184185
m_inputGrid->getOriginY() - m_inputGrid->getCellSizeJ()/2,
185-
featureSizeFinal - 0.5 * dFeatureSize );
186+
spectrogramOriginZ );
186187
spectrogramGridAsCellCentered->SetExtent( extent[0], extent[1]+1,
187188
extent[2], extent[3]+1,
188189
extent[4], extent[5]+1 );
@@ -218,7 +219,8 @@ void GaborFilterDialog::updateDisplay()
218219
vtkSmartPointer<vtkThreshold> threshold = vtkSmartPointer<vtkThreshold>::New();
219220
{
220221
threshold->SetInputData( spectrogramGridAsCellCentered );
221-
threshold->ThresholdByUpper(1); // Criterion is cells whose scalars are greater or equal to threshold.
222+
threshold->SetUpperThreshold(1); // Criterion is cells whose scalars are greater or equal to threshold.
223+
threshold->SetThresholdFunction( vtkThreshold::THRESHOLD_UPPER );
222224
threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "Visibility");
223225
threshold->Update();
224226
}
@@ -249,7 +251,7 @@ void GaborFilterDialog::updateDisplay()
249251
_scalarBar->SetTitle("amplitude");
250252
//scalarBar->SetNumberOfLabels( 4 );
251253
_scalarBar->SetRenderer( _renderer );
252-
_scalarBar->SetInteractor( _vtkwidget->GetRenderWindow()->GetInteractor() );
254+
_scalarBar->SetInteractor( _vtkwidget->renderWindow()->GetInteractor() );
253255

254256
// Create a text style for the cube axes
255257
vtkSmartPointer<vtkTextProperty> tprop = vtkSmartPointer<vtkTextProperty>::New();
@@ -282,11 +284,18 @@ void GaborFilterDialog::updateDisplay()
282284
spectral::arrayPtr gridData( m_inputGrid->createSpectralArray( m_inputVariableIndex ) );
283285
ImageJockeyUtils::makeVTKImageDataFromSpectralArray( out, *gridData );
284286

285-
//put the input grid a bit far from the spectrogram cube
287+
//put the input grid a bit below from the spectrogram cube
286288
double* origin = out->GetOrigin();
287-
origin[2] -= 10.0;
289+
origin[0] = m_inputGrid->getOriginX();
290+
origin[1] = m_inputGrid->getOriginY();
291+
origin[2] = spectrogramOriginZ - 10.0;
288292
out->SetOrigin( origin );
289293

294+
//render the input grid with the correct cell sizes
295+
out->SetSpacing ( m_inputGrid->getCellSizeI(),
296+
m_inputGrid->getCellSizeJ(),
297+
m_inputGrid->getCellSizeK());
298+
290299
//Create a color table
291300
vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();
292301
{
@@ -330,7 +339,7 @@ void GaborFilterDialog::updateDisplay()
330339
_renderer->AddActor( gridActor );
331340
_currentActors.push_back( gridActor );
332341
_renderer->ResetCamera();
333-
_vtkwidget->GetRenderWindow()->Render();
342+
_vtkwidget->renderWindow()->Render();
334343
}
335344

336345
void GaborFilterDialog::onScan()
@@ -408,7 +417,7 @@ void GaborFilterDialog::onFreqAzSelectionsUpdated(const GaborFrequencyAzimuthSel
408417

409418
void GaborFilterDialog::onUserEditedAFrequency(QString freqValue)
410419
{
411-
Q_UNUSED( freqValue );
420+
Q_UNUSED( freqValue )
412421
//get the user-entered topological frequencies
413422
// the frequencies are topological (that is, inverse of cell counts)
414423
// because the Gabor transform involves convolutions, which are cell-centered

imagejockey/gabor/gaborfilterdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GaborFilterDialog;
1212

1313
class IJAbstractCartesianGrid;
1414
class IJQuick3DViewer;
15-
class QVTKOpenGLWidget;
15+
class QVTKOpenGLNativeWidget;
1616
class vtkRenderer;
1717
class vtkOrientationMarkerWidget;
1818
class vtkPolyData;
@@ -50,7 +50,7 @@ class GaborFilterDialog : public QDialog
5050

5151
////////-----members used for 3D display-------------------
5252
// the Qt widget containing a VTK viewport
53-
QVTKOpenGLWidget *_vtkwidget;
53+
QVTKOpenGLNativeWidget *_vtkwidget;
5454
// the VTK renderer (add VTK actors to it to build the scene).
5555
vtkSmartPointer<vtkRenderer> _renderer;
5656
// this must be class variable, otherwise a crash ensues due to smart pointer going

imagejockey/imagejockeygridplot.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <qwt_plot_renderer.h>
1212
#include <qwt_plot_canvas.h>
1313
#include <qwt_plot_curve.h>
14+
#include <qwt_matrix_raster_data.h>
15+
#include <QPen>
1416
#include <cmath>
1517

1618
#include <qapplication.h>
@@ -41,8 +43,8 @@ class SpectrogramZoomer: public QwtPlotZoomer
4143
}
4244
};
4345

44-
///////////////////////////////////////////RASTER DATA ADAPTER: QwtRasterData <-> CartesianGrid ///////////////////////
45-
class SpectrogramData: public QwtRasterData{
46+
///////////////////////////////////////////RASTER DATA ADAPTER: QwtMatrixRasterData <-> CartesianGrid ///////////////////////
47+
class SpectrogramData: public QwtMatrixRasterData{
4648
public:
4749
SpectrogramData() : m_var( nullptr ), m_cg( nullptr ), m_decibelRefValue(100.0) {
4850
//set some default values before the user chooses a grid
@@ -105,8 +107,8 @@ class SpectrogramData: public QwtRasterData{
105107
double m_decibelRefValue;
106108
};
107109

108-
///////////////////////////////////////////RASTER DATA ADAPTER: QwtRasterData <-> SVDFactor ///////////////////////
109-
class FactorData: public QwtRasterData{
110+
///////////////////////////////////////////RASTER DATA ADAPTER: QwtMatrixRasterData <-> SVDFactor ///////////////////////
111+
class FactorData: public QwtMatrixRasterData{
110112
public:
111113
FactorData() : m_factor( nullptr ), m_colorScaleForSVDFactor( ColorScaleForSVDFactor::LINEAR ) {
112114
//set some default values before the user chooses a factor

0 commit comments

Comments
 (0)