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