Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to vtk9.1 #278

Merged
merged 22 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5796f08
MCRFSimDialog: replaced reference to smart pointer.
PauloCarvalhoRJ Feb 21, 2022
aae4480
SpatialIndex: replaced reference to smart pointer.
PauloCarvalhoRJ Feb 21, 2022
647b775
Manual updates.
PauloCarvalhoRJ Mar 2, 2022
e4e8d1d
Added missing header that was being overlooked by the compiler.
PauloCarvalhoRJ Mar 2, 2022
45b84d9
VTK9: View3DWidget: replaced outdated QVTKOpenGLWidget with QVTKOpenG…
PauloCarvalhoRJ Mar 2, 2022
b2cfafc
QwT 6.2.0: ImageJockeyGridPlot: replaced QwtRasterDate (now an interf…
PauloCarvalhoRJ Mar 2, 2022
73f256d
GRCompass: added missing header that was being ignored by previous co…
PauloCarvalhoRJ Mar 2, 2022
fa26e76
VTK9: GaborFilterDialog, WaveletTransformDialog and IJQuick3DViewer: …
PauloCarvalhoRJ Mar 2, 2022
9965c04
DynamicFaciesRelationshipDiagramDialog: added missing header that was…
PauloCarvalhoRJ Mar 2, 2022
dabf427
VTK 9: ParaViewScalarBar classes: replaced old VTK macros with the pr…
PauloCarvalhoRJ Mar 2, 2022
91fc692
VTK 9: ParaviewScalarBar classes: missing semicolon required after VT…
PauloCarvalhoRJ Mar 3, 2022
646f505
VTK 9: ParaviewScalarBar classes: working around a constness introduc…
PauloCarvalhoRJ Mar 3, 2022
38e2fe6
VTK 9: View3DWidget: added headers to get rid of pointer conversion e…
PauloCarvalhoRJ Mar 3, 2022
057b63a
QwT 6.2.0: GammaRay.pro: QwT library name changed from libqwt to libq…
PauloCarvalhoRJ Mar 4, 2022
23bf91a
VTK 9 and ITK 5.1: GammaRay.pro: added new required library dependenc…
PauloCarvalhoRJ Mar 4, 2022
ff2cb86
VTK 9: replaced deprecated VTK API.
PauloCarvalhoRJ Mar 4, 2022
30a8a15
Merge branch 'Issues_20220217' into Upgrade_to_VTK9.1
PauloCarvalhoRJ Mar 15, 2022
5d82fdf
ParaviewScalarBarWidget: Upgrade to VTK 9.1: better handling of retur…
PauloCarvalhoRJ Apr 2, 2022
769cd81
User's Manual: major review and cleanup.
PauloCarvalhoRJ Apr 3, 2022
59c1867
DEFECT: Gabor Analysis Dialog: misbehavior of the spectrogram display…
PauloCarvalhoRJ Apr 5, 2022
ed5c84a
DEFECT: Wavelet Transform Dialog: misbehavior of the scalegram displa…
PauloCarvalhoRJ Apr 5, 2022
03e4f52
Closing version 6.16.
Apr 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions GammaRay.pro
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ isEmpty(_QWT_LIB){
}
INCLUDEPATH += $$_QWT_INCLUDE
LIBPATH += $$_QWT_LIB
LIBS += -lqwt
LIBS += -lqwt-qt5
#==============================================================

#========== The VTK include and lib paths and libraries==================
Expand Down Expand Up @@ -744,7 +744,6 @@ LIBS += -lvtkGUISupportQt$$_VTK_VERSION_SUFFIX \
-lvtkImagingGeneral$$_VTK_VERSION_SUFFIX \
-lvtkRenderingVolume$$_VTK_VERSION_SUFFIX \
-lvtkFiltersStatistics$$_VTK_VERSION_SUFFIX \
-lvtkalglib$$_VTK_VERSION_SUFFIX \
-lvtkImagingStencil$$_VTK_VERSION_SUFFIX \
-lvtkImagingHybrid$$_VTK_VERSION_SUFFIX \
-lvtkRenderingContext2D$$_VTK_VERSION_SUFFIX \
Expand Down Expand Up @@ -778,7 +777,8 @@ LIBS += -lITKCommon$$_ITK_VERSION_SUFFIX \
-litkvnl$$_ITK_VERSION_SUFFIX \
-litkvnl_algo$$_ITK_VERSION_SUFFIX \
-lITKIOPNG$$_ITK_VERSION_SUFFIX \
-lITKTransform$$_ITK_VERSION_SUFFIX
-lITKTransform$$_ITK_VERSION_SUFFIX \
-lITKSmoothing$$_ITK_VERSION_SUFFIX

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

Expand Down Expand Up @@ -824,7 +824,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.14
VERSION = 6.16

# 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 @@ -15,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.16 - Upgrade of VTK to 9.1 and other years-old dependencies; some fixes.<br>
&nbsp;&nbsp;&nbsp;Version 6.14 - Several improvements mainly involving the 3D Viewer and dataset processing.<br>
&nbsp;&nbsp;&nbsp;Version 6.12 - Several new methods to work with grids. Several fixes and enhancements.<br>
&nbsp;&nbsp;&nbsp;Version 6.9 - Export geologic grids as Eclipse grids, multiple other new features, enhancements and fixes.<br>
Expand Down
1 change: 1 addition & 0 deletions dialogs/dynamicfaciesrelationshipdiagramdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <QScrollBar>
#include <QClipboard>
#include <QInputDialog>
#include <QFile>

DynamicFaciesRelationshipDiagramDialog::DynamicFaciesRelationshipDiagramDialog(
std::vector<Attribute *> &categoricalAttributes,
Expand Down
1 change: 1 addition & 0 deletions dialogs/krigingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <QInputDialog>
#include <QMessageBox>
#include <QFile>
#include <cmath>

KrigingDialog::KrigingDialog(QWidget *parent) :
Expand Down
2 changes: 1 addition & 1 deletion dialogs/mcrfsimdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void MCRFSimDialog::onRun()
Application::instance()->logError( " Last error:" + markovSim.getLastError() );
} else {
int realNum = 1;
for( const spectral::arrayPtr& simValues : markovSim.getRealizations() ){
for( spectral::arrayPtr simValues : markovSim.getRealizations() ){
markovSim.m_cgSim->append( m_commonSimulationParameters->getBaseNameForRealizationVariables() + QString::number(realNum),
*simValues,
markovSim.m_pdf->getCategoryDefinition() );
Expand Down
Binary file modified docs/GammaRayManual.docx
Binary file not shown.
Binary file modified docs/figures.pptx
Binary file not shown.
35 changes: 22 additions & 13 deletions imagejockey/gabor/gaborfilterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ VTK_MODULE_INIT(vtkRenderingFreeType)
#include "imagejockey/paraviewscalarbar/vtkParaViewScalarBar.h"
#include "util.h"
#include <QProgressDialog>
#include <QVTKOpenGLWidget.h>
#include <QVTKOpenGLNativeWidget.h>
#include <QMessageBox>
#include <vtkAxesActor.h>
#include <vtkOrientationMarkerWidget.h>
Expand Down Expand Up @@ -64,23 +64,23 @@ GaborFilterDialog::GaborFilterDialog(IJAbstractCartesianGrid *inputGrid,
}

///-------------------setup the 3D viewer-------------------
_vtkwidget = new QVTKOpenGLWidget();
_vtkwidget = new QVTKOpenGLNativeWidget();

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

// enable antialiasing
_renderer->SetUseFXAA( true );

_vtkwidget->SetRenderWindow(vtkGenericOpenGLRenderWindow::New());
_vtkwidget->GetRenderWindow()->AddRenderer(_renderer);
_vtkwidget->setRenderWindow(vtkGenericOpenGLRenderWindow::New());
_vtkwidget->renderWindow()->AddRenderer(_renderer);
_vtkwidget->setFocusPolicy(Qt::StrongFocus);

//----------------------adding the orientation axes-------------------------
vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
_vtkAxesWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
_vtkAxesWidget->SetOutlineColor(0.9300, 0.5700, 0.1300);
_vtkAxesWidget->SetOrientationMarker(axes);
_vtkAxesWidget->SetInteractor(_vtkwidget->GetRenderWindow()->GetInteractor());
_vtkAxesWidget->SetInteractor(_vtkwidget->renderWindow()->GetInteractor());
_vtkAxesWidget->SetViewport(0.0, 0.0, 0.2, 0.2);
_vtkAxesWidget->SetEnabled(1);
_vtkAxesWidget->InteractiveOn();
Expand Down Expand Up @@ -155,7 +155,8 @@ void GaborFilterDialog::updateDisplay()
double featureSizeFinal = ( featureSizeXFinal + featureSizeYFinal ) / 2;
//get the feature size step size (intial size is greater because initial frequency is lower)
double dFeatureSize = ( featureSizeInitial - featureSizeFinal ) / ( s1 - s0 ) ;

//get the z coordinate of the origin of the spectrogram
double spectrogramOriginZ = featureSizeFinal - 0.5 * dFeatureSize;

/////--------------------code to render the spectrogram cube-----------------------
vtkSmartPointer<vtkActor> spectrogramActor = vtkSmartPointer<vtkActor>::New();
Expand All @@ -182,7 +183,7 @@ void GaborFilterDialog::updateDisplay()
dFeatureSize);
spectrogramGridAsCellCentered->SetOrigin ( m_inputGrid->getOriginX() - m_inputGrid->getCellSizeI()/2,
m_inputGrid->getOriginY() - m_inputGrid->getCellSizeJ()/2,
featureSizeFinal - 0.5 * dFeatureSize );
spectrogramOriginZ );
spectrogramGridAsCellCentered->SetExtent( extent[0], extent[1]+1,
extent[2], extent[3]+1,
extent[4], extent[5]+1 );
Expand Down Expand Up @@ -218,7 +219,8 @@ void GaborFilterDialog::updateDisplay()
vtkSmartPointer<vtkThreshold> threshold = vtkSmartPointer<vtkThreshold>::New();
{
threshold->SetInputData( spectrogramGridAsCellCentered );
threshold->ThresholdByUpper(1); // Criterion is cells whose scalars are greater or equal to threshold.
threshold->SetUpperThreshold(1); // Criterion is cells whose scalars are greater or equal to threshold.
threshold->SetThresholdFunction( vtkThreshold::THRESHOLD_UPPER );
threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "Visibility");
threshold->Update();
}
Expand Down Expand Up @@ -249,7 +251,7 @@ void GaborFilterDialog::updateDisplay()
_scalarBar->SetTitle("amplitude");
//scalarBar->SetNumberOfLabels( 4 );
_scalarBar->SetRenderer( _renderer );
_scalarBar->SetInteractor( _vtkwidget->GetRenderWindow()->GetInteractor() );
_scalarBar->SetInteractor( _vtkwidget->renderWindow()->GetInteractor() );

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

//put the input grid a bit far from the spectrogram cube
//put the input grid a bit below from the spectrogram cube
double* origin = out->GetOrigin();
origin[2] -= 10.0;
origin[0] = m_inputGrid->getOriginX();
origin[1] = m_inputGrid->getOriginY();
origin[2] = spectrogramOriginZ - 10.0;
out->SetOrigin( origin );

//render the input grid with the correct cell sizes
out->SetSpacing ( m_inputGrid->getCellSizeI(),
m_inputGrid->getCellSizeJ(),
m_inputGrid->getCellSizeK());

//Create a color table
vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();
{
Expand Down Expand Up @@ -330,7 +339,7 @@ void GaborFilterDialog::updateDisplay()
_renderer->AddActor( gridActor );
_currentActors.push_back( gridActor );
_renderer->ResetCamera();
_vtkwidget->GetRenderWindow()->Render();
_vtkwidget->renderWindow()->Render();
}

void GaborFilterDialog::onScan()
Expand Down Expand Up @@ -408,7 +417,7 @@ void GaborFilterDialog::onFreqAzSelectionsUpdated(const GaborFrequencyAzimuthSel

void GaborFilterDialog::onUserEditedAFrequency(QString freqValue)
{
Q_UNUSED( freqValue );
Q_UNUSED( freqValue )
//get the user-entered topological frequencies
// the frequencies are topological (that is, inverse of cell counts)
// because the Gabor transform involves convolutions, which are cell-centered
Expand Down
4 changes: 2 additions & 2 deletions imagejockey/gabor/gaborfilterdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GaborFilterDialog;

class IJAbstractCartesianGrid;
class IJQuick3DViewer;
class QVTKOpenGLWidget;
class QVTKOpenGLNativeWidget;
class vtkRenderer;
class vtkOrientationMarkerWidget;
class vtkPolyData;
Expand Down Expand Up @@ -50,7 +50,7 @@ class GaborFilterDialog : public QDialog

////////-----members used for 3D display-------------------
// the Qt widget containing a VTK viewport
QVTKOpenGLWidget *_vtkwidget;
QVTKOpenGLNativeWidget *_vtkwidget;
// the VTK renderer (add VTK actors to it to build the scene).
vtkSmartPointer<vtkRenderer> _renderer;
// this must be class variable, otherwise a crash ensues due to smart pointer going
Expand Down
10 changes: 6 additions & 4 deletions imagejockey/imagejockeygridplot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <qwt_plot_renderer.h>
#include <qwt_plot_canvas.h>
#include <qwt_plot_curve.h>
#include <qwt_matrix_raster_data.h>
#include <QPen>
#include <cmath>

#include <qapplication.h>
Expand Down Expand Up @@ -41,8 +43,8 @@ class SpectrogramZoomer: public QwtPlotZoomer
}
};

///////////////////////////////////////////RASTER DATA ADAPTER: QwtRasterData <-> CartesianGrid ///////////////////////
class SpectrogramData: public QwtRasterData{
///////////////////////////////////////////RASTER DATA ADAPTER: QwtMatrixRasterData <-> CartesianGrid ///////////////////////
class SpectrogramData: public QwtMatrixRasterData{
public:
SpectrogramData() : m_var( nullptr ), m_cg( nullptr ), m_decibelRefValue(100.0) {
//set some default values before the user chooses a grid
Expand Down Expand Up @@ -105,8 +107,8 @@ class SpectrogramData: public QwtRasterData{
double m_decibelRefValue;
};

///////////////////////////////////////////RASTER DATA ADAPTER: QwtRasterData <-> SVDFactor ///////////////////////
class FactorData: public QwtRasterData{
///////////////////////////////////////////RASTER DATA ADAPTER: QwtMatrixRasterData <-> SVDFactor ///////////////////////
class FactorData: public QwtMatrixRasterData{
public:
FactorData() : m_factor( nullptr ), m_colorScaleForSVDFactor( ColorScaleForSVDFactor::LINEAR ) {
//set some default values before the user chooses a factor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void vtkBoundingRectContextDevice2D::DrawMathTextString(float* point, const vtkS
{
if (!this->DelegateDevice)
{
vtkWarningMacro(<< "No DelegateDevice defined") return;
vtkWarningMacro(<< "No DelegateDevice defined"); return;
}

// Not sure if this will work for math text
Expand Down
Loading