2016-05-09 12:13:54 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2016 Statoil 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 "cafPdmField.h"
|
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
#include "cafPdmPtrField.h"
|
2016-06-07 15:12:14 +02:00
|
|
|
#include "cafPdmChildField.h"
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-06-13 15:41:52 +02:00
|
|
|
#include "RiaDefines.h"
|
2017-11-08 13:09:05 +01:00
|
|
|
#include "RifEclipseSummaryAddressQMetaType.h"
|
2016-10-10 11:05:45 +02:00
|
|
|
#include "RimPlotCurve.h"
|
|
|
|
|
|
2016-05-31 13:42:27 +02:00
|
|
|
#include "cafAppEnum.h"
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-09-20 09:30:32 +02:00
|
|
|
class RifSummaryReaderInterface;
|
2016-10-10 11:05:45 +02:00
|
|
|
class RimSummaryCase;
|
2016-06-15 17:31:50 +02:00
|
|
|
class RimSummaryFilter;
|
2018-09-04 09:08:29 +02:00
|
|
|
class RiuQwtPlotCurve;
|
2016-11-04 14:32:39 +01:00
|
|
|
class RimSummaryCurveAutoName;
|
2017-11-08 13:09:05 +01:00
|
|
|
class RimSummaryAddress;
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-09-23 08:01:46 +02:00
|
|
|
|
2016-05-09 12:13:54 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
2016-05-24 10:33:47 +02:00
|
|
|
class RimSummaryCurve : public RimPlotCurve
|
2016-05-09 12:13:54 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2016-10-10 11:05:45 +02:00
|
|
|
|
2016-05-09 12:13:54 +02:00
|
|
|
public:
|
|
|
|
|
RimSummaryCurve();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimSummaryCurve() override;
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-11-15 11:36:33 +01:00
|
|
|
// Y Axis functions
|
|
|
|
|
void setSummaryCaseY(RimSummaryCase* sumCase);
|
|
|
|
|
RimSummaryCase* summaryCaseY() const;
|
|
|
|
|
void setSummaryAddressY(const RifEclipseSummaryAddress& address);
|
|
|
|
|
RifEclipseSummaryAddress summaryAddressY() const;
|
|
|
|
|
std::string unitNameY() const;
|
|
|
|
|
std::vector<double> valuesY() const;
|
2018-07-10 13:55:54 +02:00
|
|
|
RifEclipseSummaryAddress errorSummaryAddressY() const;
|
|
|
|
|
std::vector<double> errorValuesY() const;
|
2017-11-15 11:36:33 +01:00
|
|
|
void setLeftOrRightAxisY(RiaDefines::PlotAxis plotAxis);
|
|
|
|
|
RiaDefines::PlotAxis axisY() const;
|
2017-11-21 11:52:49 +01:00
|
|
|
const std::vector<time_t>& timeStepsY() const;
|
2017-11-15 11:36:33 +01:00
|
|
|
|
|
|
|
|
// X Axis functions
|
2017-12-01 11:15:19 +01:00
|
|
|
void setSummaryCaseX(RimSummaryCase* sumCase);
|
|
|
|
|
RimSummaryCase* summaryCaseX() const;
|
2017-11-15 11:36:33 +01:00
|
|
|
RifEclipseSummaryAddress summaryAddressX() const;
|
2017-12-01 11:15:19 +01:00
|
|
|
void setSummaryAddressX(const RifEclipseSummaryAddress& address);
|
2017-11-15 11:36:33 +01:00
|
|
|
std::string unitNameX() const;
|
|
|
|
|
std::vector<double> valuesX() const;
|
|
|
|
|
|
|
|
|
|
// Other
|
2016-10-10 11:05:45 +02:00
|
|
|
void updateQwtPlotAxis();
|
2016-11-04 15:23:44 +01:00
|
|
|
void applyCurveAutoNameSettings(const RimSummaryCurveAutoName& autoNameSettings);
|
|
|
|
|
|
2018-10-18 19:45:57 +02:00
|
|
|
QString curveExportDescription(const RifEclipseSummaryAddress& address = RifEclipseSummaryAddress()) const override;
|
2018-07-09 13:58:01 +02:00
|
|
|
void forceUpdateCurveAppearanceFromCaseType();
|
2018-06-28 15:15:25 +02:00
|
|
|
|
2018-09-13 12:38:17 +02:00
|
|
|
void markCachedDataForPurge();
|
2018-12-13 16:05:46 +01:00
|
|
|
|
|
|
|
|
void setAsTopZWithinCategory(bool enable);
|
|
|
|
|
void setZIndexFromCurveInfo();
|
2018-09-13 12:38:17 +02:00
|
|
|
|
2016-05-24 10:33:47 +02:00
|
|
|
protected:
|
2016-05-26 14:23:29 +02:00
|
|
|
// RimPlotCurve overrides
|
2018-10-18 19:45:57 +02:00
|
|
|
QString createCurveAutoName() override;
|
|
|
|
|
void updateZoomInParentPlot() override;
|
|
|
|
|
void onLoadDataAndUpdate(bool updateParentPlot) override;
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2018-09-07 14:26:14 +02:00
|
|
|
|
2018-10-18 19:45:57 +02:00
|
|
|
void updateLegendsInPlot() override;
|
2018-09-07 14:26:14 +02:00
|
|
|
|
2018-12-17 16:01:15 +01:00
|
|
|
|
|
|
|
|
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
|
|
|
|
|
2016-05-26 14:23:29 +02:00
|
|
|
private:
|
2017-11-15 11:36:33 +01:00
|
|
|
RifSummaryReaderInterface* valuesSummaryReaderX() const;
|
|
|
|
|
RifSummaryReaderInterface* valuesSummaryReaderY() const;
|
2017-11-21 10:39:20 +01:00
|
|
|
const std::vector<time_t>& timeStepsX() const;
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-08-22 15:24:35 +02:00
|
|
|
void calculateCurveInterpolationFromAddress();
|
|
|
|
|
|
2016-05-26 14:23:29 +02:00
|
|
|
// Overridden PDM methods
|
2018-10-18 19:45:57 +02:00
|
|
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
|
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
|
|
|
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
|
|
|
|
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
2016-05-09 12:13:54 +02:00
|
|
|
|
2017-11-08 15:12:53 +01:00
|
|
|
static void appendOptionItemsForSummaryAddresses(QList<caf::PdmOptionItemInfo>* options,
|
|
|
|
|
RimSummaryCase* summaryCase,
|
|
|
|
|
RimSummaryFilter* summaryFilter);
|
|
|
|
|
|
2016-10-10 11:05:45 +02:00
|
|
|
private:
|
2017-11-08 13:09:05 +01:00
|
|
|
// Y values
|
|
|
|
|
caf::PdmPtrField<RimSummaryCase*> m_yValuesSummaryCase;
|
|
|
|
|
caf::PdmChildField<RimSummaryAddress*> m_yValuesCurveVariable;
|
|
|
|
|
caf::PdmField<QString> m_yValuesSelectedVariableDisplayField;
|
|
|
|
|
caf::PdmChildField<RimSummaryFilter*> m_yValuesSummaryFilter;
|
|
|
|
|
caf::PdmField<RifEclipseSummaryAddress> m_yValuesUiFilterResultSelection;
|
2017-11-15 15:20:47 +01:00
|
|
|
caf::PdmField<bool> m_yPushButtonSelectSummaryAddress;
|
2017-11-08 13:09:05 +01:00
|
|
|
|
2017-11-08 15:12:53 +01:00
|
|
|
// X values
|
|
|
|
|
caf::PdmPtrField<RimSummaryCase*> m_xValuesSummaryCase;
|
|
|
|
|
caf::PdmChildField<RimSummaryAddress*> m_xValuesCurveVariable;
|
|
|
|
|
caf::PdmField<QString> m_xValuesSelectedVariableDisplayField;
|
|
|
|
|
caf::PdmChildField<RimSummaryFilter*> m_xValuesSummaryFilter;
|
|
|
|
|
caf::PdmField<RifEclipseSummaryAddress> m_xValuesUiFilterResultSelection;
|
2017-11-15 15:20:47 +01:00
|
|
|
caf::PdmField<bool> m_xPushButtonSelectSummaryAddress;
|
2017-11-08 15:12:53 +01:00
|
|
|
|
2017-11-08 13:09:05 +01:00
|
|
|
caf::PdmChildField<RimSummaryCurveAutoName*> m_curveNameConfig;
|
|
|
|
|
caf::PdmField<caf::AppEnum< RiaDefines::PlotAxis>> m_plotAxis;
|
2018-12-13 16:05:46 +01:00
|
|
|
caf::PdmField<bool> m_isTopZWithinCategory;
|
2016-05-09 12:13:54 +02:00
|
|
|
};
|