Files
ResInsight/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlotCollection.h
T
Magne Sjaastad 387b19ef62 #12276 Add RFT correlation report plot with cross-plot and tornado plot
* Fix defensive guards and TVD interpolation

Guard against out-of-bounds IJK and invalid cells in RifReaderRftInterface.
Guard against null eclCase in RimDataSourceForRftPlt::address.
Guard against null plot widgets in RiuMultiPlotPage.
Fix interpolateMdFromTvd corrupting valid entries after infinity TVD values
by skipping infinity entries in the first pass and tracking only the last
two valid MD values for the startMD adjustment.

* Add RiuQwtCurveSelectorFilter for click-to-select realization in Qwt plots

New shared event filter class that installs on a QwtPlot canvas and calls a
user-supplied callback with the closest data point on each click.

Migrate the local CurveSelectorFilter in RimParameterResultCrossPlot to use
the new shared class. Add Z_HIGHLIGHTED_CURVE to ZIndex enum and replace all
raw z-order integers in RiuQwtPlotCurveDefines with named constants.

* Add RFT correlation report plot with cross-plot and tornado plot

New classes:
- RimRftCorrelationReportPlot: composite plot showing an RFT well log track
  alongside a parameter cross-plot and a tornado plot sub-plot.
- RimParameterRftCrossPlot: cross-plot of ensemble parameters vs RFT-derived
  measured depth values, with click-to-select realization support.
- RimRftTornadoPlot: tornado plot with correlation-sorted parameter list and
  click-to-select realization support.
- RicCreateRftCorrelationReportFeature: context menu command on RimWellRftPlot
  that creates a RimRftCorrelationReportPlot in the correlation plot collection.

Wire up in RimCorrelationPlotCollection and RimContextCommandBuilder.

* Add click-to-select and highlight selected realization in RFT plots

Install RiuQwtCurveSelectorFilter on RimWellRftPlot canvas to support
click-to-select realization. Highlight the selected realization using a
contrast color (orange-red) and increased line thickness. React to both
click-to-select in the plot and selection changes in the Data Sources panel.

Add Z_HIGHLIGHTED_CURVE z-order and replace raw z-order integers with
named constants in RimWellRftPlot.

Highlight selected realization with XCROSS symbol in RimParameterRftCrossPlot
via RimSummaryEnsembleTools::findSummaryCase.

* RimWellRftPlot: add Create RFT Correlation Report to canvas right-click menu

Override appendMenuItems in RimWellRftPlot to add RicCreateRftCorrelationReportFeature.
Call appendMenuItems from RiuMultiPlotPage::contextMenuEvent so any plot type
can contribute canvas menu items without modifying RiuMultiPlotPage.

* RicShowPlotDataFeature: support RimRftCorrelationReportPlot

Add RimRftCorrelationReportPlot to the isCommandEnabled check and expand
it into its cross-plot and tornado sub-plots in onActionTriggered, matching
the pattern used for RimCorrelationReportPlot.
2026-04-16 16:45:44 +02:00

103 lines
5.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimAbstractCorrelationPlot.h"
#include "RimAbstractPlotCollection.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
#include <ctime>
#include <vector>
class RimCorrelationPlot;
class RimCorrelationMatrixPlot;
class RimCorrelationReportPlot;
class RimParameterResultCrossPlot;
class RimRftCorrelationReportPlot;
class RimSummaryEnsemble;
class RimWellRftPlot;
//==================================================================================================
///
///
//==================================================================================================
class RimCorrelationPlotCollection : public caf::PdmObject, public RimTypedPlotCollection<RimAbstractCorrelationPlot>
{
CAF_PDM_HEADER_INIT;
public:
RimCorrelationPlotCollection();
~RimCorrelationPlotCollection() override;
RimCorrelationPlot* createCorrelationPlot( bool defaultToFirstEnsembleFopt = true );
RimCorrelationPlot* createCorrelationPlot( RimSummaryEnsemble* ensemble, const QString& quantityName, std::time_t timeStep );
RimCorrelationMatrixPlot* createCorrelationMatrixPlot( bool defaultToFirstEnsembleField = true );
RimCorrelationMatrixPlot*
createCorrelationMatrixPlot( RimSummaryEnsemble* ensemble, const std::vector<QString>& quantityNames, std::time_t timeStep );
RimParameterResultCrossPlot* createParameterResultCrossPlot( bool defaultToFirstEnsembleFopt = true );
RimParameterResultCrossPlot* createParameterResultCrossPlot( RimSummaryEnsemble* ensemble,
const QString& paramName,
const QString& quantityName,
std::time_t timeStep );
RimCorrelationReportPlot* createCorrelationReportPlot( bool defaultToFirstEnsembleField = true );
RimCorrelationReportPlot* createCorrelationReportPlot( RimSummaryEnsemble* ensemble,
const std::vector<QString>& matrixQuantityNames,
const QString& tornadoAndCrossPlotQuantityName,
std::time_t timeStep );
void removeReport( RimCorrelationReportPlot* correlationReport );
RimRftCorrelationReportPlot* createRftCorrelationReportPlot( RimWellRftPlot* source );
std::vector<RimAbstractCorrelationPlot*> plots() const final;
size_t plotCount() const final;
void insertPlot( RimAbstractCorrelationPlot* plot, size_t index ) final;
void removePlot( RimAbstractCorrelationPlot* correlationPlot ) final;
void deleteAllPlots() final;
void loadDataAndUpdateAllPlots() override;
std::vector<RimCorrelationReportPlot*> reports() const;
std::vector<RimRftCorrelationReportPlot*> rftReports() const;
private:
void applyFirstEnsembleFieldAddressesToPlot( RimAbstractCorrelationPlot* plot, const std::vector<QString>& quantityNames = {} );
void applyEnsembleFieldAndTimeStepToPlot( RimAbstractCorrelationPlot* plot,
RimSummaryEnsemble* ensemble,
const std::vector<QString>& quantityNames,
std::time_t timeStep );
void applyFirstEnsembleFieldAddressesToReport( RimCorrelationReportPlot* plot,
const std::vector<QString>& matrixQuantityNames,
const QString& tornadoAndCrossPlotQuantityName );
void applyEnsembleFieldAndTimeStepToReport( RimCorrelationReportPlot* plot,
RimSummaryEnsemble* ensemble,
const std::vector<QString>& matrixQuantityNames,
const QString& tornadoAndCrossPlotQuantityName,
std::time_t timeStep );
private:
caf::PdmChildArrayField<RimAbstractCorrelationPlot*> m_correlationPlots;
caf::PdmChildArrayField<RimCorrelationReportPlot*> m_correlationReports;
caf::PdmChildArrayField<RimRftCorrelationReportPlot*> m_rftCorrelationReports;
};