ResInsight/ApplicationCode/ProjectDataModel/RimMainPlotCollection.cpp
Gaute Lindkvist a010fc03d7
3d Cross Plot: First implementation (#4127)
* First cross plot commit

* Made cross plot deal with "all time steps" and categorise curves based on time step

* Support STATIC vs DYNAMIC plotting

* #4115 Avoid updating plots in RimEclipseCase::computeCachedData()

* Make sure loading of Cross plot from file works

* Show Legend in Cross Plot

* Uncheck / Check curves to disable/enable

* Axis titles and checkable data set

* Name config and setting of common plot look

* Fix category indentation in GeoMech results

* Support name configuration for Grid Cross Plot

* Support adding new curve sets

* Improve colors and symbols with better cycling

* Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands

* #4111 3D calculations : Always show difference options

* Whitespace

* #4111 Move resultDefinition field to private

* Whitespace

* #4087 Ensemble : When importing and ensemble, show by default an ensemble plot

* #4085 3D view: Improve overlay item colors

* #4106 Crash on Linux

Temporary workaround to avoid crash

* #4106 Stop trying to do recursive setting tab order widget

* The double pointer was handled wrongly and shift-tab order isn't working anyway.

* #4114 Regression Test : Remove cached pointer to eclipse case

* Revert "#4114 Regression Test : Remove cached pointer to eclipse case"

This reverts commit f2146c6007.

* #4114 Regression Test : Missing data for flow diag property filter

* #4085 3D view: Add check box for version info text

* Whtespace

* Improve labelling of static results

* Fix update of result property when changing type
2019-02-21 12:52:23 +01:00

251 lines
9.5 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimMainPlotCollection.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RimFlowPlotCollection.h"
#include "RimPltPlotCollection.h"
#include "RimProject.h"
#include "RimRftPlotCollection.h"
#include "RimSummaryCrossPlotCollection.h"
#include "RimSummaryPlotCollection.h"
#include "RimViewWindow.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellPltPlot.h"
#include "RimWellRftPlot.h"
#include "RiuMainWindow.h"
#include "RiuProjectPropertyView.h"
CAF_PDM_SOURCE_INIT(RimMainPlotCollection, "MainPlotCollection");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMainPlotCollection::RimMainPlotCollection()
{
CAF_PDM_InitObject("Plots", "", "", "");
CAF_PDM_InitField(&m_show, "Show", true, "Show 2D Plot Window", "", "", "");
m_show.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_wellLogPlotCollection, "WellLogPlotCollection", "", "", "", "");
m_wellLogPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_rftPlotCollection, "RftPlotCollection", "", "", "", "");
m_rftPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_pltPlotCollection, "PltPlotCollection", "", "", "", "");
m_pltPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_summaryPlotCollection, "SummaryPlotCollection", "Summary Plots", "", "", "");
m_summaryPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_summaryCrossPlotCollection, "SummaryCrossPlotCollection", "Summary Cross Plots", "", "", "");
m_summaryCrossPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_flowPlotCollection, "FlowPlotCollection", "Flow Diagnostics Plots", "", "", "");
m_flowPlotCollection.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_gridCrossPlotCollection, "Rim3dCrossPlotCollection", "3d Cross Plots", "", "", "");
m_gridCrossPlotCollection.uiCapability()->setUiHidden(true);
m_wellLogPlotCollection = new RimWellLogPlotCollection();
m_rftPlotCollection = new RimRftPlotCollection();
m_pltPlotCollection = new RimPltPlotCollection();
m_summaryPlotCollection = new RimSummaryPlotCollection();
m_summaryCrossPlotCollection = new RimSummaryCrossPlotCollection();
m_flowPlotCollection = new RimFlowPlotCollection();
m_gridCrossPlotCollection = new RimGridCrossPlotCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimMainPlotCollection::~RimMainPlotCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimMainPlotCollection::objectToggleField()
{
return &m_show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotCollection* RimMainPlotCollection::wellLogPlotCollection()
{
return m_wellLogPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRftPlotCollection* RimMainPlotCollection::rftPlotCollection()
{
return m_rftPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimPltPlotCollection* RimMainPlotCollection::pltPlotCollection()
{
return m_pltPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryPlotCollection* RimMainPlotCollection::summaryPlotCollection()
{
return m_summaryPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSummaryCrossPlotCollection* RimMainPlotCollection::summaryCrossPlotCollection()
{
return m_summaryCrossPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFlowPlotCollection* RimMainPlotCollection::flowPlotCollection()
{
return m_flowPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridCrossPlotCollection* RimMainPlotCollection::gridCrossPlotCollection()
{
return m_gridCrossPlotCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::deleteAllContainedObjects()
{
m_wellLogPlotCollection()->wellLogPlots.deleteAllChildObjects();
m_rftPlotCollection()->deleteAllPlots();
m_pltPlotCollection()->deleteAllPlots();
m_summaryPlotCollection()->summaryPlots.deleteAllChildObjects();
m_summaryCrossPlotCollection()->deleteAllChildObjects();
m_gridCrossPlotCollection->deleteAllChildObjects();
m_flowPlotCollection()->closeDefaultPlotWindowAndDeletePlots();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updateCurrentTimeStepInPlots()
{
m_flowPlotCollection()->defaultFlowCharacteristicsPlot()->updateCurrentTimeStep();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updatePlotsWithFormations()
{
if (m_wellLogPlotCollection)
{
for (RimWellLogPlot* wellLogPlot : m_wellLogPlotCollection->wellLogPlots())
{
wellLogPlot->loadDataAndUpdate();
}
}
if (m_pltPlotCollection)
{
for (RimWellPltPlot* pltPlot : m_pltPlotCollection->pltPlots())
{
pltPlot->loadDataAndUpdate();
}
}
if (m_rftPlotCollection)
{
for (RimWellRftPlot* rftPlot : m_rftPlotCollection->rftPlots())
{
rftPlot->loadDataAndUpdate();
}
}
if (m_flowPlotCollection)
{
m_flowPlotCollection->loadDataAndUpdate();
}
if (m_gridCrossPlotCollection)
{
for (RimGridCrossPlot* crossPlot : m_gridCrossPlotCollection->gridCrossPlots())
{
crossPlot->loadDataAndUpdate();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::updatePlotsWithCompletions()
{
if (m_wellLogPlotCollection)
{
for (RimWellLogPlot* wellLogPlot : m_wellLogPlotCollection->wellLogPlots())
{
wellLogPlot->loadDataAndUpdate();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMainPlotCollection::deleteAllCachedData()
{
m_wellLogPlotCollection()->deleteAllExtractors();
m_rftPlotCollection()->deleteAllExtractors();
m_pltPlotCollection()->deleteAllExtractors();
}