2012-09-11 09:22:36 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
|
|
|
//
|
|
|
|
|
// 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 "cafPdmObject.h"
|
|
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
|
#include "cafAppEnum.h"
|
|
|
|
|
|
2013-05-06 12:02:32 +02:00
|
|
|
#include "cvfAssert.h"
|
2015-11-04 12:51:55 +01:00
|
|
|
#include "cvfObject.h"
|
2013-05-06 12:02:32 +02:00
|
|
|
|
2013-05-06 10:55:00 +02:00
|
|
|
#include "cvfVector2.h"
|
2017-11-15 20:45:56 +01:00
|
|
|
#include <cmath>
|
2017-11-16 10:39:54 +01:00
|
|
|
#include <memory>
|
2012-09-11 09:22:36 +02:00
|
|
|
|
2019-01-16 10:51:43 +01:00
|
|
|
class RimGeoMechContourMapView;
|
2019-01-11 13:56:35 +01:00
|
|
|
class RimEclipseContourMapView;
|
2015-05-21 10:05:33 +02:00
|
|
|
class RimEclipseView;
|
2015-04-29 22:19:49 +02:00
|
|
|
class RimGeoMechView;
|
2018-01-15 14:52:22 +01:00
|
|
|
class RimGridView;
|
2015-11-04 12:51:55 +01:00
|
|
|
class RigStatisticsDataCache;
|
2017-11-16 10:39:54 +01:00
|
|
|
class RicGridStatisticsDialog;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2012-09-11 09:22:36 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
2013-04-26 14:47:34 +02:00
|
|
|
class Rim3dOverlayInfoConfig : public caf::PdmObject
|
2012-09-11 09:22:36 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2017-10-19 07:44:21 +02:00
|
|
|
|
2017-11-15 20:45:56 +01:00
|
|
|
class HistogramData
|
|
|
|
|
{
|
|
|
|
|
public:
|
2017-11-16 13:22:05 +01:00
|
|
|
HistogramData() : min(HUGE_VAL), max(HUGE_VAL), p10(HUGE_VAL), p90(HUGE_VAL), mean(HUGE_VAL), weightedMean(HUGE_VAL), sum(0.0), histogram(nullptr) {}
|
2017-11-15 20:45:56 +01:00
|
|
|
|
|
|
|
|
double min;
|
|
|
|
|
double max;
|
|
|
|
|
double p10;
|
|
|
|
|
double p90;
|
|
|
|
|
double mean;
|
|
|
|
|
double sum;
|
2017-11-16 11:43:24 +01:00
|
|
|
double weightedMean;
|
2017-11-15 20:45:56 +01:00
|
|
|
const std::vector<size_t>* histogram;
|
2018-11-08 10:18:49 +01:00
|
|
|
bool isValid(double parameter) { return parameter != HUGE_VAL && parameter != -HUGE_VAL; }
|
2017-11-16 13:22:05 +01:00
|
|
|
|
2018-11-08 10:18:49 +01:00
|
|
|
bool isValid() { return histogram && histogram->size() > 0 && isValid(min) && isValid(max); }
|
2017-11-15 20:45:56 +01:00
|
|
|
};
|
|
|
|
|
|
2012-09-11 09:22:36 +02:00
|
|
|
public:
|
|
|
|
|
Rim3dOverlayInfoConfig();
|
2018-10-18 19:45:57 +02:00
|
|
|
~Rim3dOverlayInfoConfig() override;
|
2012-09-11 09:22:36 +02:00
|
|
|
|
|
|
|
|
void update3DInfo();
|
|
|
|
|
|
2018-01-15 14:52:22 +01:00
|
|
|
void setReservoirView(RimGridView* ownerView);
|
2012-09-11 09:22:36 +02:00
|
|
|
|
2017-11-16 10:50:48 +01:00
|
|
|
void setPosition(cvf::Vec2ui position);
|
2015-11-04 12:51:55 +01:00
|
|
|
|
2018-02-15 13:00:33 +01:00
|
|
|
HistogramData histogramData();
|
|
|
|
|
QString timeStepText();
|
|
|
|
|
QString caseInfoText();
|
|
|
|
|
QString resultInfoText(const HistogramData& histData);
|
2017-11-15 20:45:56 +01:00
|
|
|
|
2018-02-15 13:00:33 +01:00
|
|
|
void showStatisticsInfoDialog(bool raise = true);
|
|
|
|
|
QImage statisticsDialogScreenShotImage();
|
|
|
|
|
|
2018-03-06 16:05:01 +01:00
|
|
|
bool showAnimProgress() const;
|
|
|
|
|
bool showCaseInfo() const;
|
|
|
|
|
bool showResultInfo() const;
|
|
|
|
|
bool isActive() const;
|
2018-10-23 16:32:40 +02:00
|
|
|
void setIsActive(bool active);
|
2017-11-16 10:39:54 +01:00
|
|
|
|
2015-11-04 12:51:55 +01:00
|
|
|
enum StatisticsTimeRangeType
|
|
|
|
|
{
|
|
|
|
|
ALL_TIMESTEPS,
|
|
|
|
|
CURRENT_TIMESTEP
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum StatisticsCellRangeType
|
|
|
|
|
{
|
|
|
|
|
ALL_CELLS,
|
|
|
|
|
VISIBLE_CELLS
|
|
|
|
|
};
|
|
|
|
|
|
2012-09-11 09:22:36 +02:00
|
|
|
protected:
|
2018-10-18 19:45:57 +02:00
|
|
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
|
|
|
|
caf::PdmFieldHandle* objectToggleField() override;
|
2017-01-03 13:14:07 +01:00
|
|
|
|
2018-10-18 19:45:57 +02:00
|
|
|
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
2017-01-03 13:14:07 +01:00
|
|
|
|
2012-09-11 09:22:36 +02:00
|
|
|
private:
|
2015-11-04 12:51:55 +01:00
|
|
|
void updateEclipse3DInfo(RimEclipseView * reservoirView);
|
2015-04-29 22:19:49 +02:00
|
|
|
void updateGeoMech3DInfo(RimGeoMechView * geoMechView);
|
|
|
|
|
|
2018-03-06 16:05:01 +01:00
|
|
|
void update3DInfoIn2dViews() const;
|
|
|
|
|
|
2017-11-28 15:07:46 +01:00
|
|
|
QString timeStepText(RimEclipseView* eclipseView);
|
|
|
|
|
QString timeStepText(RimGeoMechView* geoMechView);
|
2019-01-11 13:56:35 +01:00
|
|
|
HistogramData histogramData(RimEclipseContourMapView* contourMap);
|
2019-01-16 10:51:43 +01:00
|
|
|
HistogramData histogramData(RimGeoMechContourMapView* contourMap);
|
2017-11-16 13:22:05 +01:00
|
|
|
HistogramData histogramData(RimEclipseView* eclipseView);
|
|
|
|
|
HistogramData histogramData(RimGeoMechView* geoMechView);
|
2017-11-16 14:13:50 +01:00
|
|
|
QString caseInfoText(RimEclipseView* eclipseView);
|
|
|
|
|
QString caseInfoText(RimGeoMechView* geoMechView);
|
2017-12-05 11:24:11 +01:00
|
|
|
QString resultInfoText(const HistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean);
|
2017-11-16 14:13:50 +01:00
|
|
|
QString resultInfoText(const HistogramData& histData, RimGeoMechView* geoMechView);
|
2017-11-16 13:22:05 +01:00
|
|
|
|
2018-02-15 13:00:33 +01:00
|
|
|
caf::PdmField<bool> m_active;
|
|
|
|
|
caf::PdmField<bool> m_showAnimProgress;
|
|
|
|
|
caf::PdmField<bool> m_showCaseInfo;
|
|
|
|
|
caf::PdmField<bool> m_showResultInfo;
|
|
|
|
|
caf::PdmField<bool> m_showVolumeWeightedMean;
|
|
|
|
|
caf::PdmField<bool> m_showHistogram;
|
2015-11-11 17:44:00 +01:00
|
|
|
|
2015-11-04 12:51:55 +01:00
|
|
|
caf::PdmField<caf::AppEnum<StatisticsTimeRangeType> > m_statisticsTimeRange;
|
|
|
|
|
caf::PdmField<caf::AppEnum<StatisticsCellRangeType> > m_statisticsCellRange;
|
2015-04-29 22:19:49 +02:00
|
|
|
|
2018-01-15 14:52:22 +01:00
|
|
|
caf::PdmPointer<RimGridView> m_viewDef;
|
2012-09-11 09:22:36 +02:00
|
|
|
|
|
|
|
|
cvf::Vec2ui m_position;
|
2015-11-04 12:51:55 +01:00
|
|
|
|
2015-11-06 10:18:55 +01:00
|
|
|
void updateVisCellStatsIfNeeded();
|
2015-11-12 11:53:22 +01:00
|
|
|
void displayPropertyFilteredStatisticsMessage(bool showSwitchToCurrentTimestep);
|
2017-10-27 17:12:25 +02:00
|
|
|
bool hasInvalidStatisticsCombination();
|
2015-11-06 10:18:55 +01:00
|
|
|
bool m_isVisCellStatUpToDate;
|
2015-11-04 12:51:55 +01:00
|
|
|
cvf::ref<RigStatisticsDataCache> m_visibleCellStatistics;
|
2017-11-16 10:39:54 +01:00
|
|
|
|
|
|
|
|
std::unique_ptr<RicGridStatisticsDialog> m_gridStatisticsDialog;
|
2012-09-11 09:22:36 +02:00
|
|
|
};
|