Files
ResInsight/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.h
T

93 lines
3.3 KiB
C++
Raw Normal View History

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>
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
std::vector<RimSummaryCase*> summaryCasesExcludedByFilter() const;
void appendFilterFields( caf::PdmUiOrdering& uiOrdering );
struct CaseData
{
double parameterValue;
double summaryValue;
RimSummaryCase* summaryCase;
};
std::vector<CaseData> createCaseData() const;
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;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
2020-04-17 19:24:12 +02: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;
void updatePlotTitle() override;
void createPoints();
2025-03-17 12:30:40 +01:00
void updateValueRanges();
void updateFilterRanges();
RimSummaryCase* findClosestCase( const QPoint& canvasPos );
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
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
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
};