mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
Add collection and feature to create saturation pressure plots
This commit is contained in:
1 parent
795ce019ae
commit
614a3628f0
22 files changed
+595
-65
No files matched your search
@@ -4,13 +4,18 @@ ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurveSet.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurveSet.cpp)
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurveSet.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
${SOURCE_GROUP_HEADER_FILES}
|
||||
|
||||
@@ -151,6 +151,8 @@ QImage RimGridCrossPlot::snapshotWindowContent()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::zoomAll()
|
||||
{
|
||||
if (!m_qwtPlot) return;
|
||||
|
||||
setAutoZoomForAllAxes(true);
|
||||
updateAxisInQwt(RiaDefines::PLOT_AXIS_LEFT);
|
||||
updateAxisInQwt(RiaDefines::PLOT_AXIS_BOTTOM);
|
||||
@@ -277,6 +279,8 @@ void RimGridCrossPlot::updateAxisScaling()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateAxisDisplay()
|
||||
{
|
||||
if (!m_qwtPlot) return;
|
||||
|
||||
updateAxisInQwt(RiaDefines::PLOT_AXIS_BOTTOM);
|
||||
updateAxisInQwt(RiaDefines::PLOT_AXIS_LEFT);
|
||||
|
||||
@@ -663,6 +667,8 @@ QString RimGridCrossPlot::yAxisParameterString() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlot::updateAxisInQwt(RiaDefines::PlotAxis axisType)
|
||||
{
|
||||
if (!m_qwtPlot) return;
|
||||
|
||||
RimPlotAxisProperties* axisProperties = m_xAxisProperties();
|
||||
QString axisParameterString = xAxisParameterString();
|
||||
|
||||
@@ -799,6 +805,22 @@ std::vector<const QwtPlotCurve*> RimGridCrossPlot::visibleQwtCurves() const
|
||||
return plotCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisProperties* RimGridCrossPlot::xAxisProperties()
|
||||
{
|
||||
return m_xAxisProperties();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotAxisProperties* RimGridCrossPlot::yAxisProperties()
|
||||
{
|
||||
return m_yAxisProperties();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Name Configuration
|
||||
///
|
||||
|
||||
@@ -106,6 +106,9 @@ protected:
|
||||
void updateAxisFromQwt(RiaDefines::PlotAxis axisType);
|
||||
std::vector<const QwtPlotCurve*> visibleQwtCurves() const;
|
||||
|
||||
RimPlotAxisProperties* xAxisProperties();
|
||||
RimPlotAxisProperties* yAxisProperties();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
caf::PdmField<int> m_legendFontSize;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
@@ -43,8 +42,4 @@ public:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimGridCrossPlot*> m_gridCrossPlots;
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
#include <QString>
|
||||
#include "RimEclipseResultCase.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGridCrossPlotCurveSet, "GridCrossPlotCurveSet");
|
||||
|
||||
@@ -901,6 +902,22 @@ bool RimGridCrossPlotCurveSet::isYAxisLogarithmic() const
|
||||
return parent->isYAxisLogarithmic();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridCrossPlotCurveSet::setFromCaseAndEquilibriumRegion(RimEclipseResultCase* eclipseCase, const QString& dynamicResultName)
|
||||
{
|
||||
m_case = eclipseCase;
|
||||
|
||||
m_xAxisProperty->setEclipseCase(eclipseCase);
|
||||
m_xAxisProperty->setResultType(RiaDefines::DYNAMIC_NATIVE);
|
||||
m_xAxisProperty->setResultVariable(dynamicResultName);
|
||||
|
||||
m_yAxisProperty->setEclipseCase(eclipseCase);
|
||||
m_yAxisProperty->setResultType(RiaDefines::STATIC_NATIVE);
|
||||
m_yAxisProperty->setResultVariable("DEPTH");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -40,6 +40,7 @@ class RimCase;
|
||||
class RimGridCrossPlotCurve;
|
||||
class RimGridView;
|
||||
class RimEclipseCase;
|
||||
class RimEclipseResultCase;
|
||||
class RimEclipseCellColors;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimRegularLegendConfig;
|
||||
@@ -120,6 +121,8 @@ public:
|
||||
bool isXAxisLogarithmic() const;
|
||||
bool isYAxisLogarithmic() const;
|
||||
|
||||
void setFromCaseAndEquilibriumRegion(RimEclipseResultCase* eclipseResultCase, const QString& dynamicResultName);
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void onLoadDataAndUpdate(bool updateParentPlot);
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimSaturationPressurePlot.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimGridCrossPlotCurveSet.h"
|
||||
#include "RimPlotAxisAnnotation.h"
|
||||
#include "RimPlotAxisProperties.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSaturationPressurePlot, "RimSaturationPressurePlot");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSaturationPressurePlot::RimSaturationPressurePlot()
|
||||
{
|
||||
CAF_PDM_InitObject("Saturation Pressure Plot", ":/SummaryXPlotLight16x16.png", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSaturationPressurePlot::assignCaseAndEquilibriumRegion(RimEclipseResultCase* eclipseResultCase, int equilibriumRegion)
|
||||
{
|
||||
{
|
||||
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
||||
curveSet->setFromCaseAndEquilibriumRegion(eclipseResultCase, "PRESSURE");
|
||||
}
|
||||
{
|
||||
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
||||
curveSet->setFromCaseAndEquilibriumRegion(eclipseResultCase, "PDEW");
|
||||
}
|
||||
{
|
||||
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
||||
curveSet->setFromCaseAndEquilibriumRegion(eclipseResultCase, "PBUB");
|
||||
}
|
||||
|
||||
RimPlotAxisProperties* yAxisProps = yAxisProperties();
|
||||
|
||||
yAxisProps->setInvertedAxis(true);
|
||||
|
||||
{
|
||||
RimPlotAxisAnnotation* annotation = new RimPlotAxisAnnotation;
|
||||
annotation->setEquilibriumData(eclipseResultCase, equilibriumRegion, RimPlotAxisAnnotation::PL_EQUIL_GAS_OIL_CONTACT);
|
||||
|
||||
yAxisProps->appendAnnotation(annotation);
|
||||
}
|
||||
{
|
||||
RimPlotAxisAnnotation* annotation = new RimPlotAxisAnnotation;
|
||||
annotation->setEquilibriumData(eclipseResultCase, equilibriumRegion, RimPlotAxisAnnotation::PL_EQUIL_WATER_OIL_CONTACT);
|
||||
|
||||
yAxisProps->appendAnnotation(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSaturationPressurePlot::initAfterRead()
|
||||
{
|
||||
yAxisProperties()->showAnnotationObjectsInProjectTree();
|
||||
|
||||
RimGridCrossPlot::initAfterRead();
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "RimGridCrossPlot.h"
|
||||
|
||||
class RimEclipseResultCase;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimSaturationPressurePlot : public RimGridCrossPlot
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimSaturationPressurePlot();
|
||||
|
||||
void assignCaseAndEquilibriumRegion(RimEclipseResultCase* eclipseResultCase, int equilibriumRegion);
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
};
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEquil.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimSaturationPressurePlot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSaturationPressurePlotCollection, "RimSaturationPressurePlotCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSaturationPressurePlotCollection::RimSaturationPressurePlotCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Saturation Pressure Plots", ":/SummaryXPlotsLight16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_saturationPressurePlots, "SaturationPressurePlots", "Saturation Pressure Plots", "", "", "");
|
||||
m_saturationPressurePlots.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSaturationPressurePlotCollection::~RimSaturationPressurePlotCollection() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSaturationPressurePlotCollection::createSaturationPressurePlots(RimEclipseResultCase* eclipseResultCase)
|
||||
{
|
||||
if (!eclipseResultCase) return;
|
||||
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseResultCase->eclipseCaseData();
|
||||
if (!eclipseCaseData) return;
|
||||
|
||||
std::vector<RigEquil> equilData = eclipseCaseData->equilData();
|
||||
for (size_t i = 0; i < equilData.size(); i++)
|
||||
{
|
||||
RimSaturationPressurePlot* plot = new RimSaturationPressurePlot();
|
||||
plot->setAsPlotMdiWindow();
|
||||
|
||||
int equilibriumRegion = static_cast<int>(i) + 1;
|
||||
plot->assignCaseAndEquilibriumRegion(eclipseResultCase, equilibriumRegion);
|
||||
|
||||
m_saturationPressurePlots.push_back(plot);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSaturationPressurePlot*> RimSaturationPressurePlotCollection::plots()
|
||||
{
|
||||
return m_saturationPressurePlots.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSaturationPressurePlotCollection::deleteAllChildObjects()
|
||||
{
|
||||
m_saturationPressurePlots.deleteAllChildObjects();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2019- 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 "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimSaturationPressurePlot;
|
||||
class RimEclipseResultCase;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimSaturationPressurePlotCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimSaturationPressurePlotCollection();
|
||||
~RimSaturationPressurePlotCollection() override;
|
||||
|
||||
void createSaturationPressurePlots(RimEclipseResultCase* eclipseResultCase);
|
||||
|
||||
std::vector<RimSaturationPressurePlot*> plots();
|
||||
void deleteAllChildObjects();
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSaturationPressurePlot*> m_saturationPressurePlots;
|
||||
};
|
||||
@@ -95,6 +95,7 @@
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPltPlot.h"
|
||||
#include "RimWellRftPlot.h"
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimStimPlanFractureTemplate.h"
|
||||
@@ -470,6 +471,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
menuBuilder << "RicCreateGridCrossPlotFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimSaturationPressurePlotCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicCreateSaturationPressurePlotsFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimGridCrossPlot*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicPasteGridCrossPlotCurveSetFeature";
|
||||
|
||||
@@ -19,13 +19,14 @@
|
||||
|
||||
#include "RimMainPlotCollection.h"
|
||||
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimFlowCharacteristicsPlot.h"
|
||||
#include "RimFlowPlotCollection.h"
|
||||
#include "RimGridCrossPlot.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimPltPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRftPlotCollection.h"
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
#include "RimSummaryCrossPlotCollection.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
#include "RimViewWindow.h"
|
||||
@@ -70,6 +71,9 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
CAF_PDM_InitFieldNoDefault(&m_gridCrossPlotCollection, "Rim3dCrossPlotCollection", "3d Cross Plots", "", "", "");
|
||||
m_gridCrossPlotCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_saturationPressurePlotCollection, "RimSaturationPressurePlotCollection", "Saturation Pressure Plots", "", "", "");
|
||||
m_saturationPressurePlotCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_wellLogPlotCollection = new RimWellLogPlotCollection();
|
||||
m_rftPlotCollection = new RimRftPlotCollection();
|
||||
m_pltPlotCollection = new RimPltPlotCollection();
|
||||
@@ -77,6 +81,7 @@ RimMainPlotCollection::RimMainPlotCollection()
|
||||
m_summaryCrossPlotCollection = new RimSummaryCrossPlotCollection();
|
||||
m_flowPlotCollection = new RimFlowPlotCollection();
|
||||
m_gridCrossPlotCollection = new RimGridCrossPlotCollection;
|
||||
m_saturationPressurePlotCollection = new RimSaturationPressurePlotCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -158,6 +163,14 @@ RimGridCrossPlotCollection* RimMainPlotCollection::gridCrossPlotCollection()
|
||||
return m_gridCrossPlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSaturationPressurePlotCollection* RimMainPlotCollection::saturationPressurePlotCollection()
|
||||
{
|
||||
return m_saturationPressurePlotCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -170,6 +183,7 @@ void RimMainPlotCollection::deleteAllContainedObjects()
|
||||
m_summaryCrossPlotCollection()->deleteAllChildObjects();
|
||||
m_gridCrossPlotCollection->deleteAllChildObjects();
|
||||
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
|
||||
m_saturationPressurePlotCollection()->deleteAllChildObjects();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,30 +2,29 @@
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <QPointer>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include <QPointer>
|
||||
|
||||
class RimWellLogPlotCollection;
|
||||
class RimRftPlotCollection;
|
||||
@@ -37,46 +36,49 @@ class RimSummaryPlot;
|
||||
class RifReaderEclipseSummary;
|
||||
class RimEclipseResultCase;
|
||||
class RimFlowPlotCollection;
|
||||
|
||||
class RimSaturationPressurePlotCollection;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimMainPlotCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimMainPlotCollection();
|
||||
~RimMainPlotCollection() override;
|
||||
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
RimRftPlotCollection* rftPlotCollection();
|
||||
RimPltPlotCollection* pltPlotCollection();
|
||||
RimSummaryPlotCollection* summaryPlotCollection();
|
||||
RimSummaryCrossPlotCollection* summaryCrossPlotCollection();
|
||||
RimFlowPlotCollection* flowPlotCollection();
|
||||
RimGridCrossPlotCollection* gridCrossPlotCollection();
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
RimRftPlotCollection* rftPlotCollection();
|
||||
RimPltPlotCollection* pltPlotCollection();
|
||||
RimSummaryPlotCollection* summaryPlotCollection();
|
||||
RimSummaryCrossPlotCollection* summaryCrossPlotCollection();
|
||||
RimFlowPlotCollection* flowPlotCollection();
|
||||
RimGridCrossPlotCollection* gridCrossPlotCollection();
|
||||
RimSaturationPressurePlotCollection* saturationPressurePlotCollection();
|
||||
|
||||
void deleteAllContainedObjects();
|
||||
void updateCurrentTimeStepInPlots();
|
||||
void updatePlotsWithFormations();
|
||||
void updatePlotsWithCompletions();
|
||||
void deleteAllCachedData();
|
||||
|
||||
void deleteAllContainedObjects();
|
||||
void updateCurrentTimeStepInPlots();
|
||||
void updatePlotsWithFormations();
|
||||
void updatePlotsWithCompletions();
|
||||
void deleteAllCachedData();
|
||||
private:
|
||||
|
||||
// Overridden PDM methods
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RimWellLogPlotCollection*> m_wellLogPlotCollection;
|
||||
caf::PdmChildField<RimRftPlotCollection*> m_rftPlotCollection;
|
||||
caf::PdmChildField<RimPltPlotCollection*> m_pltPlotCollection;
|
||||
caf::PdmChildField<RimSummaryPlotCollection*> m_summaryPlotCollection;
|
||||
caf::PdmChildField<RimSummaryCrossPlotCollection*> m_summaryCrossPlotCollection;
|
||||
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
|
||||
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
|
||||
caf::PdmChildField<RimWellLogPlotCollection*> m_wellLogPlotCollection;
|
||||
caf::PdmChildField<RimRftPlotCollection*> m_rftPlotCollection;
|
||||
caf::PdmChildField<RimPltPlotCollection*> m_pltPlotCollection;
|
||||
caf::PdmChildField<RimSummaryPlotCollection*> m_summaryPlotCollection;
|
||||
caf::PdmChildField<RimSummaryCrossPlotCollection*> m_summaryCrossPlotCollection;
|
||||
caf::PdmChildField<RimFlowPlotCollection*> m_flowPlotCollection;
|
||||
caf::PdmChildField<RimGridCrossPlotCollection*> m_gridCrossPlotCollection;
|
||||
caf::PdmChildField<RimSaturationPressurePlotCollection*> m_saturationPressurePlotCollection;
|
||||
|
||||
caf::PdmField<bool> m_show;
|
||||
};
|
||||
@@ -75,6 +75,18 @@ void RimPlotAxisAnnotation::setValue(double value)
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisAnnotation::setEquilibriumData(RimEclipseCase* eclipseCase,
|
||||
int equilibriumRegion,
|
||||
PlotAxisAnnotationType annotationType)
|
||||
{
|
||||
m_sourceCase = eclipseCase;
|
||||
m_equilNum = equilibriumRegion;
|
||||
m_annotationType = annotationType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -166,7 +178,7 @@ QList<caf::PdmOptionItemInfo> RimPlotAxisAnnotation::calculateValueOptions(const
|
||||
{
|
||||
for (int i = 0; i < equilItems().size(); i++)
|
||||
{
|
||||
QString uiText = QString("%1").arg(i+1);
|
||||
QString uiText = QString("%1").arg(i + 1);
|
||||
options.push_back(caf::PdmOptionItemInfo(uiText, i));
|
||||
}
|
||||
}
|
||||
@@ -200,7 +212,7 @@ void RimPlotAxisAnnotation::defineUiOrdering(QString uiConfigName, caf::PdmUiOrd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEquil RimPlotAxisAnnotation::selectedItem() const
|
||||
{
|
||||
int index = m_equilNum() -1;
|
||||
int index = m_equilNum() - 1;
|
||||
|
||||
if (index < equilItems().size())
|
||||
{
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
void setName(const QString& name);
|
||||
void setValue(double value);
|
||||
|
||||
void setEquilibriumData(RimEclipseCase* eclipseCase, int equilibriumRegion, PlotAxisAnnotationType annotationType);
|
||||
|
||||
QString name() const;
|
||||
double value() const;
|
||||
|
||||
@@ -65,17 +67,16 @@ protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
private:
|
||||
RigEquil selectedItem() const;
|
||||
RigEquil selectedItem() const;
|
||||
std::vector<RigEquil> equilItems() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<ExportKeywordEnum> m_annotationType;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmField<double> m_value;
|
||||
|
||||
caf::PdmPtrField<RimEclipseCase*> m_sourceCase;
|
||||
caf::PdmField<int> m_equilNum;
|
||||
|
||||
caf::PdmField<int> m_equilNum;
|
||||
};
|
||||
@@ -99,7 +99,7 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
CAF_PDM_InitFieldNoDefault(&m_annotations, "Annotations", "", "", "", "");
|
||||
|
||||
m_annotations.uiCapability()->setUiHidden(true);
|
||||
m_annotations.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
// m_annotations.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
updateOptionSensitivity();
|
||||
}
|
||||
@@ -316,6 +316,14 @@ std::vector<RimPlotAxisAnnotation*> RimPlotAxisProperties::annotations() const
|
||||
return m_annotations.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::appendAnnotation(RimPlotAxisAnnotation* annotation)
|
||||
{
|
||||
m_annotations.push_back(annotation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -324,6 +332,22 @@ bool RimPlotAxisProperties::isActive() const
|
||||
return m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::setInvertedAxis(bool enable)
|
||||
{
|
||||
m_isAxisInverted = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisProperties::showAnnotationObjectsInProjectTree()
|
||||
{
|
||||
m_annotations.uiCapability()->setUiTreeChildrenHidden(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
bool isAxisInverted() const;
|
||||
|
||||
std::vector<RimPlotAxisAnnotation*> annotations() const;
|
||||
void appendAnnotation(RimPlotAxisAnnotation* annotation);
|
||||
|
||||
caf::PdmField<QString> customTitle;
|
||||
caf::PdmField<int> titleFontSize;
|
||||
@@ -87,6 +88,9 @@ public:
|
||||
caf::PdmField<int> valuesFontSize;
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
void setInvertedAxis(bool enable);
|
||||
void showAnnotationObjectsInProjectTree();
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimGridCrossPlotCollection.h"
|
||||
#include "RimSaturationPressurePlotCollection.h"
|
||||
#include "RimValveTemplate.h"
|
||||
#include "RimValveTemplateCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
@@ -1246,6 +1247,11 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
|
||||
{
|
||||
itemCollection->add(mainPlotCollection->gridCrossPlotCollection());
|
||||
}
|
||||
|
||||
if (mainPlotCollection->saturationPressurePlotCollection())
|
||||
{
|
||||
itemCollection->add(mainPlotCollection->saturationPressurePlotCollection());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user