ResInsight/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftPlot.h

165 lines
5.9 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 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 "RimEnsembleCurveSetColorManager.h"
#include "RimViewWindow.h"
#include "RimWellLogPlot.h"
#include "RimWellRftEnsembleCurveSet.h"
#include "RifDataSourceForRftPltQMetaType.h"
#include "RiuPlotCurveSymbol.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
#include "cvfCollection.h"
2017-10-03 01:19:38 -05:00
#include <QDate>
#include <QMetaType>
#include <QPointer>
2019-03-12 03:13:48 -05:00
#include <map>
#include <set>
#include <utility>
class RimEclipseCase;
class RimEclipseResultCase;
class RimRegularLegendConfig;
class RimWellLogCurve;
class RimWellLogFileChannel;
class RimWellPath;
class RimWellPathCollection;
class RiuWellRftPlot;
class RigEclipseCaseData;
2019-03-12 03:13:48 -05:00
class RiaRftPltCurveDefinition;
class RifDataSourceForRftPlt;
class RifEclipseRftAddress;
class RiuDraggableOverlayFrame;
namespace cvf
{
class Color3f;
}
namespace caf
{
class PdmOptionItemInfo;
}
//==================================================================================================
///
///
//==================================================================================================
class RimWellRftPlot : public RimWellLogPlot
{
CAF_PDM_HEADER_INIT;
2017-10-04 07:36:33 -05:00
static const std::set<QString> PRESSURE_DATA_NAMES;
static const char PLOT_NAME_QFORMAT_STRING[];
public:
RimWellRftPlot();
~RimWellRftPlot() override;
const QString& simWellOrWellPathName() const;
2019-09-06 06:17:36 -05:00
void setSimWellOrWellPathName( const QString& currWellName );
int branchIndex() const;
void applyInitialSelections();
2019-03-12 03:13:48 -05:00
static const char* plotNameFormatString();
2019-09-06 06:17:36 -05:00
void deleteCurvesAssosicatedWithObservedData( const RimObservedFmuRftData* observedFmuRftData );
2019-08-20 08:09:13 -05:00
bool showErrorBarsForObservedData() const;
2019-12-05 05:54:32 -06:00
void onLegendDefinitionChanged();
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
2019-09-06 06:17:36 -05:00
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptionsForSources() const;
2019-09-06 06:17:36 -05:00
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void onLoadDataAndUpdate() override;
void initAfterRead() override;
bool useUndoRedoForFieldChanged() override;
private:
std::map<QString, QStringList> findWellSources();
void updateEditorsFromPreviousSelection();
void updateEditorsFromCurves();
void syncCurvesFromUiSelection();
void assignWellPathToExtractionCurves();
2019-09-06 06:17:36 -05:00
RimObservedFmuRftData* findObservedFmuData( const QString& wellPathName, const QDateTime& timeStep ) const;
2019-08-28 09:00:01 -05:00
std::set<RiaRftPltCurveDefinition> selectedCurveDefs() const;
std::set<RiaRftPltCurveDefinition> curveDefsFromCurves() const;
2017-10-03 01:19:38 -05:00
2019-09-06 06:17:36 -05:00
void updateCurvesInPlot( const std::set<RiaRftPltCurveDefinition>& allCurveDefs,
const std::set<RiaRftPltCurveDefinition>& curveDefsToAdd,
const std::set<RimWellLogCurve*>& curvesToDelete );
2019-03-12 03:13:48 -05:00
std::vector<RifDataSourceForRftPlt> selectedSourcesExpanded() const;
// RimViewWindow overrides
void applyCurveAppearance( RimWellLogCurve* curve );
void applyCurveColor( RimWellLogCurve* curve );
void updateFormationsOnPlot() const;
QString associatedSimWellName() const;
static RiuPlotCurveSymbol::PointSymbolEnum statisticsCurveSymbolFromAddress( const RifEclipseRftAddress& address );
static RiuPlotCurveSymbol::LabelPosition statisticsLabelPosFromAddress( const RifEclipseRftAddress& address );
cvf::Color3f findCurveColor( RimWellLogCurve* curve );
void defineCurveColorsAndSymbols( const std::set<RiaRftPltCurveDefinition>& allCurveDefs );
std::vector<RimSummaryCaseCollection*> selectedEnsembles() const;
void createEnsembleCurveSets();
RimWellRftEnsembleCurveSet* findEnsembleCurveSet( RimSummaryCaseCollection* ensemble ) const;
private:
friend class RimWellRftEnsembleCurveSet;
caf::PdmField<QString> m_wellPathNameOrSimWellName;
caf::PdmField<int> m_branchIndex;
caf::PdmField<bool> m_branchDetection;
caf::PdmField<bool> m_showStatisticsCurves;
caf::PdmField<bool> m_showEnsembleCurves;
caf::PdmField<bool> m_showErrorInObservedData;
caf::PdmField<std::vector<RifDataSourceForRftPlt>> m_selectedSources;
caf::PdmField<std::vector<QDateTime>> m_selectedTimeSteps;
caf::PdmChildArrayField<RimWellRftEnsembleCurveSet*> m_ensembleCurveSets;
std::map<RimWellRftEnsembleCurveSet*, QPointer<RiuDraggableOverlayFrame>> m_ensembleLegendFrames;
2018-05-11 06:14:49 -05:00
std::map<RifDataSourceForRftPlt, cvf::Color3f> m_dataSourceColors;
std::map<QDateTime, RiuPlotCurveSymbol::PointSymbolEnum> m_timeStepSymbols;
bool m_isOnLoad;
caf::PdmChildField<RimWellLogPlot*> m_wellLogPlot_OBSOLETE;
};