Files
ResInsight/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlot.h
T
Magne Sjaastad 931c8d066c #14235 Correlation report: synchronise all sub-plots and control data source from the report
Selecting a summary vector in a correlation report now propagates to the contained tornado, cross and summary plots by selecting the first matrix cell, which sends the existing selection signal handled by the report. A virtual onDataSourceChanged() hook on the abstract correlation plot is called after the summary vector selection dialog, and the matrix and tornado plots override it to re-select their first item so dependent plots update.

When a plot is used as a sub-plot of a correlation report, the data source and correlation settings are controlled from the report, so its property editor exposes only the plot settings. Used individually the plots show the complete set of options. Whether a plot is a report sub-plot is tracked with a flag set by the owning report on construction and after read.

Use updateAllRequiredEditors() for sub-plot interactions and for time step changes driven from the summary plot, so the project tree text and property panel reflect the updated auto-generated titles. Re-apply the configured dock title bar visibility after toggling a sub-plot dock, so the title bar stays hidden when a hidden sub-plot is shown again.
2026-06-26 17:09:26 +02:00

91 lines
3.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 "Summary/RiaSummaryCurveDefinition.h" // use of caf::Signal requires this include
#include "RimAbstractCorrelationPlot.h"
#include "cafPdmFieldCvfColor.h"
#include <QDateTime>
class RimSummaryAddress;
class RiuGroupedBarChartBuilder;
class RiuPlotItem;
//==================================================================================================
///
///
//==================================================================================================
class RimCorrelationPlot : public RimAbstractCorrelationPlot
{
CAF_PDM_HEADER_INIT;
public:
caf::Signal<std::pair<QString, RiaSummaryCurveDefinition>> tornadoItemSelected;
public:
RimCorrelationPlot();
~RimCorrelationPlot() override;
bool showAbsoluteValues() const;
void setShowAbsoluteValues( bool showAbsoluteValues );
bool sortByAbsoluteValues() const;
void setSortByAbsoluteValues( bool sortByAbsoluteValues );
void selectAllParameters();
bool showOnlyTopNCorrelations() const;
void setShowOnlyTopNCorrelations( bool showOnlyTopNCorrelations );
int topNFilterCount() const;
void setTopNFilterCount( int filterCount );
void setSelectedParameter( const QString& paramName );
private:
// Overridden PDM methods
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void onLoadDataAndUpdate() override;
void onDataSourceChanged() override;
void updateAxes() override;
QString asciiDataForPlotExport() const override;
// Private methods
void addDataToChartBuilder( RiuGroupedBarChartBuilder& chartBuilder ) const;
void updatePlotTitle() override;
void onPlotItemSelected( std::shared_ptr<RiuPlotItem> plotItem, bool toggle, int sampleIndex ) override;
private:
caf::PdmField<bool> m_showAbsoluteValues;
caf::PdmField<bool> m_sortByAbsoluteValues;
caf::PdmField<bool> m_excludeParametersWithoutVariation;
caf::PdmField<bool> m_showOnlyTopNCorrelations;
caf::PdmField<int> m_topNFilterCount;
caf::PdmField<std::vector<QString>> m_selectedParametersList;
caf::PdmField<cvf::Color3f> m_barColor;
caf::PdmField<cvf::Color3f> m_highlightBarColor;
QString m_selectedParameter;
};