2020-04-17 19:24:12 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// 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"
|
|
|
|
|
|
2025-03-17 12:30:40 +01:00
|
|
|
#include <array>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
2025-03-13 14:45:33 +01:00
|
|
|
class RiuQwtPlotRectAnnotation;
|
|
|
|
|
|
2020-04-17 19:24:12 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
class RimParameterResultCrossPlot : public RimAbstractCorrelationPlot
|
|
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
RimParameterResultCrossPlot();
|
|
|
|
|
~RimParameterResultCrossPlot() override;
|
2025-06-02 14:52:45 +02:00
|
|
|
void setEnsembleParameter( const QString& ensembleParameter );
|
|
|
|
|
QString ensembleParameter() const;
|
2020-04-17 19:24:12 +02:00
|
|
|
|
2025-03-13 14:45:33 +01:00
|
|
|
std::vector<RimSummaryCase*> summaryCasesExcludedByFilter() const;
|
|
|
|
|
void appendFilterFields( caf::PdmUiOrdering& uiOrdering );
|
|
|
|
|
|
2026-04-08 11:17:59 +02:00
|
|
|
struct CaseData
|
|
|
|
|
{
|
|
|
|
|
double parameterValue;
|
|
|
|
|
double summaryValue;
|
|
|
|
|
RimSummaryCase* summaryCase;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::vector<CaseData> createCaseData() const;
|
|
|
|
|
|
2025-03-13 14:45:33 +01:00
|
|
|
void detachAllCurves() override;
|
|
|
|
|
|
2020-04-17 19:24:12 +02:00
|
|
|
private:
|
|
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
|
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2022-05-29 13:01:27 +02:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2025-03-13 14:45:33 +01:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
2020-04-17 19:24:12 +02:00
|
|
|
|
2025-03-11 09:05:35 +01:00
|
|
|
RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override;
|
|
|
|
|
|
2023-10-11 08:54:52 +02:00
|
|
|
void onLoadDataAndUpdate() override;
|
|
|
|
|
void updateAxes() override;
|
|
|
|
|
QString asciiDataForPlotExport() const override;
|
2025-03-11 09:05:35 +01:00
|
|
|
void updatePlotTitle() override;
|
|
|
|
|
void createPoints();
|
2025-03-17 12:30:40 +01:00
|
|
|
|
2026-04-16 16:45:44 +02:00
|
|
|
void updateValueRanges();
|
|
|
|
|
void updateFilterRanges();
|
|
|
|
|
RimSummaryCase* findClosestCase( const QPoint& canvasPos );
|
2025-03-13 14:45:33 +01:00
|
|
|
|
|
|
|
|
QString excludedCasesText() const;
|
|
|
|
|
|
2025-03-17 12:30:40 +01:00
|
|
|
size_t hashFromCurrentData() const;
|
|
|
|
|
void writeDataToCache();
|
|
|
|
|
|
2020-04-17 19:24:12 +02:00
|
|
|
private:
|
|
|
|
|
caf::PdmField<QString> m_ensembleParameter;
|
2020-07-27 10:56:35 +02:00
|
|
|
|
2025-03-13 14:45:33 +01:00
|
|
|
caf::PdmField<bool> m_useParameterFilter;
|
|
|
|
|
caf::PdmField<std::pair<double, double>> m_summaryFilterRange;
|
|
|
|
|
caf::PdmField<std::pair<double, double>> m_parameterFilterRange;
|
|
|
|
|
caf::PdmProxyValueField<QString> m_excludedCasesText;
|
|
|
|
|
|
|
|
|
|
std::pair<double, double> m_xValueRange;
|
|
|
|
|
std::pair<double, double> m_yValueRange;
|
2023-10-11 08:54:52 +02:00
|
|
|
|
2025-03-13 14:45:33 +01:00
|
|
|
std::unique_ptr<RiuQwtPlotRectAnnotation> m_rectAnnotation;
|
2025-03-17 12:30:40 +01:00
|
|
|
|
|
|
|
|
std::map<size_t, std::array<double, 4>> m_filterValueRangeCache;
|
2020-04-17 19:24:12 +02:00
|
|
|
};
|