ResInsight/ApplicationCode/ProjectDataModel/GridCrossPlots/RimGridCrossPlotCurveSet.cpp

1092 lines
40 KiB
C++
Raw Normal View History

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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimGridCrossPlotCurveSet.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RiaLogging.h"
#include "RifEclipseDataTableFormatter.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "RigActiveCellInfo.h"
#include "RigActiveCellsResultAccessor.h"
#include "RigCaseCellResultCalculator.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseCrossPlotDataExtractor.h"
#include "RigFormationNames.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "RigMainGrid.h"
#include "RiuGridCrossQwtPlot.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "RimCase.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimEclipseCellColors.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "RimEclipseResultDefinition.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCurve.h"
#include "RimGridView.h"
#include "RimProject.h"
#include "RimRegularLegendConfig.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "RimTools.h"
#include "cafCategoryMapper.h"
#include "cafColorTable.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiSliderEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafProgressInfo.h"
#include "cvfScalarMapper.h"
#include "cvfqtUtils.h"
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
#include <QString>
CAF_PDM_SOURCE_INIT(RimGridCrossPlotCurveSet, "GridCrossPlotCurveSet");
namespace caf
{
template<>
void RimGridCrossPlotCurveSet::CurveGroupingEnum::setUp()
{
addItem(RigGridCrossPlotCurveGrouping::NO_GROUPING, "NONE", "Nothing");
addItem(RigGridCrossPlotCurveGrouping::GROUP_BY_TIME, "TIME", "Time Step");
addItem(RigGridCrossPlotCurveGrouping::GROUP_BY_FORMATION, "FORMATION", "Formations");
addItem(RigGridCrossPlotCurveGrouping::GROUP_BY_RESULT, "RESULT", "Result Property");
setDefault(RigGridCrossPlotCurveGrouping::GROUP_BY_TIME);
}
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridCrossPlotCurveSet::RimGridCrossPlotCurveSet()
{
CAF_PDM_InitObject("Cross Plot Data Set", ":/WellLogCurve16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&m_case, "Case", "Case", "", "", "");
m_case.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitField(&m_timeStep, "TimeStep", -1, "Time Step", "", "", "");
m_timeStep.uiCapability()->setUiEditorTypeName(caf::PdmUiComboBoxEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&m_cellFilterView, "VisibleCellView", "Filter by 3d View Visibility", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_grouping, "Grouping", "Group Data by", "", "", "");
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_InitFieldNoDefault(&m_xAxisProperty, "XAxisProperty", "X-Axis Property", "", "", "");
m_xAxisProperty = new RimEclipseResultDefinition;
m_xAxisProperty.uiCapability()->setUiHidden(true);
m_xAxisProperty.uiCapability()->setUiTreeChildrenHidden(true);
m_xAxisProperty->setLabelsOnTop(true);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_InitFieldNoDefault(&m_yAxisProperty, "YAxisProperty", "Y-Axis Property", "", "", "");
m_yAxisProperty = new RimEclipseResultDefinition;
m_yAxisProperty.uiCapability()->setUiHidden(true);
m_yAxisProperty.uiCapability()->setUiTreeChildrenHidden(true);
m_yAxisProperty->setLabelsOnTop(true);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_InitFieldNoDefault(&m_groupingProperty, "GroupingProperty", "Data Grouping Property", "", "", "");
m_groupingProperty = new RimEclipseCellColors;
m_groupingProperty.uiCapability()->setUiHidden(true);
m_groupingProperty->legendConfig()->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_InitFieldNoDefault(&m_nameConfig, "NameConfig", "Name", "", "", "");
m_nameConfig = new RimGridCrossPlotCurveSetNameConfig(this);
m_nameConfig.uiCapability()->setUiTreeHidden(true);
m_nameConfig.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_crossPlotCurves, "CrossPlotCurves", "Curves", "", "", "");
m_crossPlotCurves.uiCapability()->setUiTreeHidden(true);
setDefaults();
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::setCellFilterView(RimGridView* cellFilterView)
{
m_cellFilterView = cellFilterView;
m_groupingProperty->setReservoirView(dynamic_cast<RimEclipseView*>(m_cellFilterView()));
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::loadDataAndUpdate(bool updateParentPlot)
{
onLoadDataAndUpdate(updateParentPlot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::setParentQwtPlotNoReplot(QwtPlot* parent)
{
for (auto& curve : m_crossPlotCurves())
{
curve->setParentQwtPlotNoReplot(m_isChecked() ? parent : nullptr);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::xAxisName() const
{
return m_xAxisProperty->resultVariableUiShortName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::yAxisName() const
{
return m_yAxisProperty->resultVariableUiShortName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimGridCrossPlotCurveSet::indexInPlot() const
{
RimGridCrossPlot* parent;
this->firstAncestorOrThisOfTypeAsserted(parent);
return parent->indexOfCurveSet(this);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::createAutoName() const
{
if (m_case() == nullptr)
{
return "Undefined";
}
QStringList nameTags;
if (!m_nameConfig->customName().isEmpty())
{
nameTags += m_nameConfig->customName();
}
if (m_nameConfig->addCaseName())
{
nameTags += caseNameString();
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
if (m_nameConfig->addAxisVariables())
{
nameTags += axisVariableString();
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
if (m_nameConfig->addTimestep() && !timeStepString().isEmpty())
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
{
nameTags += timeStepString();
}
2019-03-07 07:17:12 -06:00
if (m_nameConfig->addGrouping() && groupParameter() != "None")
{
QString catTitle = groupTitle();
if (!catTitle.isEmpty()) nameTags += catTitle;
}
return nameTags.join(", ");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::groupTitle() const
2019-03-07 07:17:12 -06:00
{
if (m_grouping != NO_GROUPING)
{
return QString("Grouped by %1").arg(groupParameter());
}
return "";
2019-03-07 07:17:12 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::groupParameter() const
{
if (m_grouping() == GROUP_BY_TIME)
{
return QString("Time Steps");
}
else if (m_grouping() == GROUP_BY_FORMATION)
{
return QString("Formations");
}
else if (m_grouping() == GROUP_BY_RESULT && m_groupingProperty->hasResult())
{
return QString("%1").arg(m_groupingProperty->resultVariableUiShortName());
}
2019-03-07 07:17:12 -06:00
return "None";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::detachAllCurves()
{
for (auto curve : m_crossPlotCurves())
{
curve->detachQwtCurve();
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::cellFilterViewUpdated()
{
if (m_cellFilterView())
{
loadDataAndUpdate(true);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimRegularLegendConfig* RimGridCrossPlotCurveSet::legendConfig() const
{
return m_groupingProperty->legendConfig();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimGridCrossPlotCurve*> RimGridCrossPlotCurveSet::curves() const
{
return m_crossPlotCurves.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::caseNameString() const
{
if (m_case())
{
return m_case->caseUserDescription();
}
return "";
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::axisVariableString() const
{
2019-03-07 07:17:12 -06:00
return QString("%1 x %2").arg(xAxisName(), yAxisName());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::timeStepString() const
{
// If using time categorization, the time step will be included as a category, so skip it here.
if (m_grouping() != RigGridCrossPlotCurveGrouping::GROUP_BY_TIME)
{
if (m_case() && (m_xAxisProperty->hasDynamicResult() || m_yAxisProperty->hasDynamicResult()))
{
if (m_timeStep == -1)
{
return "All Time Steps";
}
return m_case->timeStepStrings()[m_timeStep];
}
}
return "";
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> RimGridCrossPlotCurveSet::groupStrings() const
{
std::vector<QString> groupStrings;
for (auto curve : m_crossPlotCurves())
{
groupStrings.push_back(legendConfig()->categoryNameFromCategoryValue(curve->groupIndex()));
}
return groupStrings;
}
2019-03-07 07:17:12 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<RimGridCrossPlotCurveSet::NameComponents, QString>
RimGridCrossPlotCurveSet::nameComponents() const
{
std::map<RimGridCrossPlotCurveSet::NameComponents, QString> componentNames;
if (m_nameConfig->addCaseName())
2019-03-12 04:27:20 -05:00
componentNames[GCP_CASE_NAME] = caseNameString();
2019-03-07 07:17:12 -06:00
if (m_nameConfig->addAxisVariables())
2019-03-12 04:27:20 -05:00
componentNames[GCP_AXIS_VARIABLES] = axisVariableString();
2019-03-07 07:17:12 -06:00
if (m_nameConfig->addTimestep())
2019-03-12 04:27:20 -05:00
componentNames[GCP_TIME_STEP] = timeStepString();
2019-03-07 07:17:12 -06:00
if (m_nameConfig->addGrouping())
2019-03-12 04:27:20 -05:00
componentNames[GCP_GROUP_NAME] = groupTitle();
2019-03-07 07:17:12 -06:00
return componentNames;
}
//--------------------------------------------------------------------------------------------------
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::initAfterRead()
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
if (eclipseCase)
{
m_xAxisProperty->setEclipseCase(eclipseCase);
m_yAxisProperty->setEclipseCase(eclipseCase);
m_groupingProperty->setEclipseCase(eclipseCase);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::onLoadDataAndUpdate(bool updateParentPlot)
{
updateDataSetName();
detachAllCurves();
m_crossPlotCurves.deleteAllChildObjects();
if (m_case() == nullptr)
{
return;
}
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
if (eclipseCase == nullptr)
{
return;
}
if (!eclipseCase->ensureReservoirCaseIsOpen())
{
RiaLogging::warning(QString("Failed to open eclipse grid file %1").arg(eclipseCase->gridFileName()));
return;
}
RigEclipseResultAddress xAddress(m_xAxisProperty->resultType(), m_xAxisProperty->resultVariable());
RigEclipseResultAddress yAddress(m_yAxisProperty->resultType(), m_yAxisProperty->resultVariable());
RigEclipseResultAddress groupAddress(m_groupingProperty->resultType(), m_groupingProperty->resultVariable());
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
std::map<int, cvf::UByteArray> timeStepCellVisibilityMap = calculateCellVisibility(eclipseCase);
updateLegend();
RigEclipseCrossPlotResult result = RigEclipseCrossPlotDataExtractor::extract(
eclipseCase->eclipseCaseData(), m_timeStep(), xAddress, yAddress, m_grouping(), groupAddress, timeStepCellVisibilityMap);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
if (isXAxisLogarithmic() || isYAxisLogarithmic())
{
filterInvalidCurveValues(&result);
}
createCurves(result);
if (updateParentPlot)
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
{
triggerPlotNameUpdateAndReplot();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::createCurves(const RigEclipseCrossPlotResult& result)
{
m_groupedResults.clear();
if (!groupingEnabled())
{
const caf::ColorTable& colors = RiaColorTables::contrastCategoryPaletteColors();
int colorIndex = indexInPlot();
RimGridCrossPlotCurve* curve = new RimGridCrossPlotCurve();
curve->setColor(colors.cycledColor3f(colorIndex));
curve->setGroupingInformation(indexInPlot(), 0);
curve->setSamples(result.xValues, result.yValues);
curve->updateCurveAppearance();
curve->updateUiIconFromPlotSymbol();
m_crossPlotCurves.push_back(curve);
m_groupedResults[0] = result;
}
else
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
{
std::vector<double> tickValues;
if (groupingByCategoryResult())
{
for (size_t i = 0; i < result.xValues.size(); ++i)
{
int categoryNum =
m_grouping == GROUP_BY_RESULT
? static_cast<int>(result.groupValuesContinuous[i])
: result.groupValuesDiscrete[i];
m_groupedResults[categoryNum].xValues.push_back(result.xValues[i]);
m_groupedResults[categoryNum].yValues.push_back(result.yValues[i]);
if (!result.groupValuesContinuous.empty())
m_groupedResults[categoryNum].groupValuesContinuous.push_back(result.groupValuesContinuous[i]);
if (!result.groupValuesDiscrete.empty())
m_groupedResults[categoryNum].groupValuesDiscrete.push_back(result.groupValuesDiscrete[i]);
}
}
else
{
legendConfig()->scalarMapper()->majorTickValues(&tickValues);
for (size_t i = 0; i < result.xValues.size(); ++i)
{
auto upperBoundIt = std::lower_bound(tickValues.begin(), tickValues.end(), result.groupValuesContinuous[i]);
int upperBoundIndex = static_cast<int>(upperBoundIt - tickValues.begin());
int categoryNum = std::min((int) tickValues.size() - 2, std::max(0, upperBoundIndex - 1));
m_groupedResults[categoryNum].xValues.push_back(result.xValues[i]);
m_groupedResults[categoryNum].yValues.push_back(result.yValues[i]);
if (!result.groupValuesContinuous.empty())
m_groupedResults[categoryNum].groupValuesContinuous.push_back(result.groupValuesContinuous[i]);
if (!result.groupValuesDiscrete.empty())
m_groupedResults[categoryNum].groupValuesDiscrete.push_back(result.groupValuesDiscrete[i]);
}
}
for (auto it = m_groupedResults.rbegin(); it != m_groupedResults.rend(); ++it)
{
RimGridCrossPlotCurve* curve = new RimGridCrossPlotCurve();
curve->setGroupingInformation(indexInPlot(), it->first);
if (groupingByCategoryResult())
{
curve->setColor(cvf::Color3f(legendConfig()->scalarMapper()->mapToColor(it->first)));
}
else
{
curve->setColor(cvf::Color3f(legendConfig()->scalarMapper()->mapToColor(tickValues[it->first])));
}
curve->setSamples(it->second.xValues, it->second.yValues);
curve->showLegend(m_crossPlotCurves.empty());
curve->setLegendEntryText(createAutoName());
curve->updateCurveAppearance();
curve->updateUiIconFromPlotSymbol();
m_crossPlotCurves.push_back(curve);
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGridCrossPlotCurveSet::createGroupName(size_t groupIndex) const
{
if (groupingByCategoryResult())
{
return legendConfig()->categoryNameFromCategoryValue(groupIndex);
}
else
{
std::vector<double> tickValues;
legendConfig()->scalarMapper()->majorTickValues(&tickValues);
double lowerLimit = tickValues[groupIndex];
double upperLimit =
groupIndex + 1u < tickValues.size() ? tickValues[groupIndex + 1u] : std::numeric_limits<double>::infinity();
return QString("%1 [%2, %3]").arg(groupParameter()).arg(lowerLimit).arg(upperLimit);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<int, cvf::UByteArray> RimGridCrossPlotCurveSet::calculateCellVisibility(RimEclipseCase* eclipseCase) const
{
std::map<int, cvf::UByteArray> timeStepCellVisibilityMap;
if (m_cellFilterView)
{
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_cellFilterView());
if (eclipseView)
{
std::set<int> timeSteps;
if (m_timeStep() == -1)
{
for (int i = 0; i < (int)eclipseCase->timeStepDates().size(); ++i)
{
timeSteps.insert(i);
}
}
else
{
timeSteps.insert(m_timeStep());
}
for (int i : timeSteps)
{
eclipseView->calculateCurrentTotalCellVisibility(&timeStepCellVisibilityMap[i], i);
}
}
}
return timeStepCellVisibilityMap;
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_case);
if (m_case)
{
uiOrdering.add(&m_timeStep);
uiOrdering.add(&m_cellFilterView);
uiOrdering.add(&m_grouping);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
if (m_grouping() == GROUP_BY_TIME &&
!(m_xAxisProperty->hasDynamicResult() || m_yAxisProperty->hasDynamicResult()))
{
m_grouping = NO_GROUPING;
}
if (m_grouping() == GROUP_BY_RESULT)
{
caf::PdmUiGroup* dataGroupingGroup = uiOrdering.addNewGroup("Data Grouping Property");
m_groupingProperty->uiOrdering(uiConfigName, *dataGroupingGroup);
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
caf::PdmUiGroup* xAxisGroup = uiOrdering.addNewGroup("X-Axis Property");
m_xAxisProperty->uiOrdering(uiConfigName, *xAxisGroup);
caf::PdmUiGroup* yAxisGroup = uiOrdering.addNewGroup("Y-Axis Property", false);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
m_yAxisProperty->uiOrdering(uiConfigName, *yAxisGroup);
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup("Name Configuration");
m_nameConfig->uiOrdering(uiConfigName, *nameGroup);
uiOrdering.skipRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
{
if (changedField == &m_case)
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case.value());
if (eclipseCase)
{
m_xAxisProperty->setEclipseCase(eclipseCase);
m_yAxisProperty->setEclipseCase(eclipseCase);
m_groupingProperty->setEclipseCase(eclipseCase);
// TODO: Do we need all these??
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
m_xAxisProperty->updateConnectedEditors();
m_yAxisProperty->updateConnectedEditors();
m_groupingProperty->updateConnectedEditors();
loadDataAndUpdate(true);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
}
else if (changedField == &m_timeStep)
{
2019-03-07 07:17:12 -06:00
if (m_timeStep != -1 && m_grouping == GROUP_BY_TIME)
{
m_grouping = NO_GROUPING;
}
loadDataAndUpdate(true);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
else if (changedField == &m_grouping)
{
if (m_grouping == GROUP_BY_TIME)
{
legendConfig()->setColorRange(RimRegularLegendConfig::NORMAL);
legendConfig()->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
}
else if (groupingByCategoryResult())
{
legendConfig()->setColorRange(RimRegularLegendConfig::CATEGORY);
legendConfig()->setMappingMode(RimRegularLegendConfig::CATEGORY_INTEGER);
}
else
{
legendConfig()->setColorRange(RimRegularLegendConfig::NORMAL);
legendConfig()->setMappingMode(RimRegularLegendConfig::LINEAR_DISCRETE);
}
loadDataAndUpdate(true);
}
else if (changedField == &m_cellFilterView)
{
m_groupingProperty->setReservoirView(dynamic_cast<RimEclipseView*>(m_cellFilterView()));
loadDataAndUpdate(true);
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
else if (changedField == &m_isChecked)
{
updateLegend();
triggerPlotNameUpdateAndReplot();
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimGridCrossPlotCurveSet::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly)
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &m_case)
{
RimTools::eclipseCaseOptionItems(&options);
if (options.empty())
{
options.push_front(caf::PdmOptionItemInfo("None", nullptr));
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
else if (fieldNeedingOptions == &m_timeStep)
{
QStringList timeStepNames;
if (m_case)
{
timeStepNames = m_case->timeStepStrings();
}
options.push_back(caf::PdmOptionItemInfo("All Time Steps", -1));
for (int i = 0; i < timeStepNames.size(); i++)
{
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
}
}
else if (fieldNeedingOptions == &m_cellFilterView)
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
if (eclipseCase)
{
options.push_back(caf::PdmOptionItemInfo("Disabled", nullptr));
for (RimEclipseView* view : eclipseCase->reservoirViews.childObjects())
{
options.push_back(caf::PdmOptionItemInfo(view->name(), view, false, view->uiIcon()));
}
}
}
else if (fieldNeedingOptions == &m_grouping)
{
std::set<RigGridCrossPlotCurveGrouping> validOptions = { NO_GROUPING, GROUP_BY_TIME, GROUP_BY_FORMATION, GROUP_BY_RESULT };
if (!hasMultipleTimeSteps())
{
validOptions.erase(GROUP_BY_TIME);
}
2019-03-07 07:17:12 -06:00
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
if (!eclipseCase || !eclipseCase->eclipseCaseData()->activeFormationNames())
{
validOptions.erase(GROUP_BY_FORMATION);
}
}
for (auto optionItem : validOptions)
{
options.push_back(caf::PdmOptionItemInfo(CurveGroupingEnum::uiText(optionItem), optionItem));
}
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::updateLegend()
{
2019-03-07 07:17:12 -06:00
legendConfig()->setTitle(groupParameter());
legendConfig()->disableAllTimeStepsRange(!hasMultipleTimeSteps());
RimGridCrossPlot* parent;
this->firstAncestorOrThisOfTypeAsserted(parent);
if (parent->qwtPlot())
{
if (groupingEnabled() && m_case() && isChecked() && legendConfig()->showLegend())
{
if (m_grouping() == GROUP_BY_FORMATION)
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
2019-03-07 07:17:12 -06:00
if (eclipseCase)
{
RigFormationNames* formationNames = eclipseCase->eclipseCaseData()->activeFormationNames();
if (formationNames)
{
const std::vector<QString>& categoryNames = formationNames->formationNames();
if (!categoryNames.empty())
{
legendConfig()->setNamedCategories(categoryNames);
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
}
}
}
}
else if (m_grouping() == GROUP_BY_TIME)
{
QStringList timeStepNames = m_case->timeStepStrings();
std::vector<QString> categoryNames;
for (auto name : timeStepNames)
{
categoryNames.push_back(name);
}
2019-03-07 07:17:12 -06:00
if (!categoryNames.empty())
{
legendConfig()->setNamedCategories(categoryNames);
legendConfig()->setAutomaticRanges(0, categoryNames.size() - 1, 0, categoryNames.size() - 1);
}
}
else if (m_groupingProperty->eclipseResultAddress().isValid())
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(m_case());
if (eclipseCase)
{
m_groupingProperty->updateLegendData(eclipseCase, m_timeStep());
}
}
parent->qwtPlot()->addOrUpdateCurveSetLegend(this);
}
else
{
parent->qwtPlot()->removeCurveSetLegend(this);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridCrossPlotCurveSet::groupingByCategoryResult() const
{
if (m_grouping == GROUP_BY_FORMATION || m_grouping == GROUP_BY_TIME)
{
return true;
}
else if (m_grouping == GROUP_BY_RESULT)
{
return m_groupingProperty->hasCategoryResult();
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridCrossPlotCurveSet::groupingEnabled() const
{
if (m_grouping != NO_GROUPING)
{
if (m_grouping == GROUP_BY_RESULT && !m_groupingProperty->eclipseResultAddress().isValid())
{
return false;
}
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::swapAxisProperties(bool updatePlot)
{
RimEclipseResultDefinition* xAxisProperties = m_xAxisProperty();
RimEclipseResultDefinition* yAxisProperties = m_yAxisProperty();
m_xAxisProperty.removeChildObject(xAxisProperties);
m_yAxisProperty.removeChildObject(yAxisProperties);
m_yAxisProperty = xAxisProperties;
m_xAxisProperty = yAxisProperties;
updateConnectedEditors();
loadDataAndUpdate(updatePlot);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::exportFormattedData(RifEclipseDataTableFormatter& formatter) const
{
if (m_groupedResults.empty())
return;
if (m_grouping != NO_GROUPING)
{
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn("X"),
RifEclipseOutputTableColumn("Y"),
RifEclipseOutputTableColumn("Group Index"),
RifEclipseOutputTableColumn("Group Description")};
formatter.header(header);
}
else
{
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn("X"), RifEclipseOutputTableColumn("Y")};
formatter.header(header);
}
caf::ProgressInfo progress(m_groupedResults.size(), "Gathering Data Points");
for (auto it = m_groupedResults.begin(); it != m_groupedResults.end(); ++it)
{
auto task = progress.task(QString("Exporting Group %1").arg(it->first));
RigEclipseCrossPlotResult res = it->second;
for (size_t i = 0; i < it->second.xValues.size(); ++i)
{
if (m_grouping() == NO_GROUPING)
{
formatter.add(res.xValues[i]);
formatter.add(res.yValues[i]);
}
else
{
int groupIndex = it->first;
QString groupName = createGroupName(groupIndex);
formatter.add(res.xValues[i]);
formatter.add(res.yValues[i]);
formatter.add(groupIndex);
formatter.add(groupName);
}
formatter.rowCompleted();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridCrossPlotCurveSet::isXAxisLogarithmic() const
{
RimGridCrossPlot* parent = nullptr;
firstAncestorOrThisOfTypeAsserted(parent);
return parent->isXAxisLogarithmic();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridCrossPlotCurveSet::isYAxisLogarithmic() const
{
RimGridCrossPlot* parent = nullptr;
firstAncestorOrThisOfTypeAsserted(parent);
return parent->isYAxisLogarithmic();
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::triggerPlotNameUpdateAndReplot()
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
{
RimGridCrossPlot* parent;
2019-03-12 08:31:26 -05:00
this->firstAncestorOrThisOfType(parent);
if (parent)
{
parent->updateCurveNamesAndPlotTitle();
parent->reattachCurvesToQwtAndReplot();
parent->updateConnectedEditors();
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
2019-03-07 07:17:12 -06:00
void RimGridCrossPlotCurveSet::updateCurveNames(size_t curveSetIndex, size_t curveSetCount)
{
2019-03-07 07:17:12 -06:00
for (size_t i = 0; i < m_crossPlotCurves.size(); ++i)
{
2019-03-07 07:17:12 -06:00
QString curveSetName = createAutoName();
if (curveSetName.isEmpty())
{
2019-03-07 07:17:12 -06:00
if (curveSetCount > 1u)
curveSetName = QString("Curve Set #%1").arg(curveSetIndex + 1);
2019-03-07 07:17:12 -06:00
else
curveSetName = "Curve Set";
}
2019-03-07 07:17:12 -06:00
auto curve = m_crossPlotCurves[i];
if (groupingEnabled())
{
QString curveGroupName = createGroupName(curve->groupIndex());
curve->setCustomName(curveGroupName);
curve->setLegendEntryText(curveSetName);
}
2019-03-07 07:17:12 -06:00
else
{
2019-03-07 07:17:12 -06:00
curve->setCustomName(curveSetName);
}
curve->updateCurveNameAndUpdatePlotLegendAndTitle();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::updateDataSetName()
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
{
this->setName(createAutoName());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::performAutoNameUpdate()
{
updateDataSetName();
triggerPlotNameUpdateAndReplot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::setDefaults()
{
RimProject* project = RiaApplication::instance()->project();
if (project)
{
if (!project->eclipseCases().empty())
{
RimEclipseCase* eclipseCase = project->eclipseCases().front();
m_case = eclipseCase;
m_xAxisProperty->setEclipseCase(eclipseCase);
m_yAxisProperty->setEclipseCase(eclipseCase);
m_groupingProperty->setEclipseCase(eclipseCase);
m_xAxisProperty->setResultType(RiaDefines::DYNAMIC_NATIVE);
m_xAxisProperty->setResultVariable("SOIL");
m_yAxisProperty->setResultType(RiaDefines::DYNAMIC_NATIVE);
m_yAxisProperty->setResultVariable("PRESSURE");
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::defineEditorAttribute(const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{
if (groupingEnabled())
{
m_groupingProperty->uiTreeOrdering(uiTreeOrdering, uiConfigName);
}
for (auto curve : m_crossPlotCurves())
{
uiTreeOrdering.add(curve);
}
uiTreeOrdering.skipRemainingChildren(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimGridCrossPlotCurveSet::hasMultipleTimeSteps() const
{
return m_timeStep() == -1 && (m_xAxisProperty->hasDynamicResult() || m_yAxisProperty->hasDynamicResult());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSet::filterInvalidCurveValues(RigEclipseCrossPlotResult* result)
{
bool xLog = isXAxisLogarithmic();
bool yLog = isYAxisLogarithmic();
if (xLog || yLog)
{
RigEclipseCrossPlotResult validResult;
for (size_t i = 0; i < result->xValues.size(); ++i)
{
double xValue = result->xValues[i];
double yValue = result->yValues[i];
bool invalid = (xLog && xValue <= 0.0) || (yLog && yValue <= 0.0);
if (!invalid)
{
validResult.xValues.push_back(xValue);
validResult.yValues.push_back(yValue);
if (i < result->groupValuesContinuous.size())
{
validResult.groupValuesContinuous.push_back(result->groupValuesContinuous[i]);
}
if (i < result->groupValuesDiscrete.size())
{
validResult.groupValuesDiscrete.push_back(result->groupValuesDiscrete[i]);
}
}
}
*result = validResult;
}
}
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_SOURCE_INIT(RimGridCrossPlotCurveSetNameConfig, "RimGridCrossPlotCurveSetNameConfig");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGridCrossPlotCurveSetNameConfig::RimGridCrossPlotCurveSetNameConfig(RimNameConfigHolderInterface* parent)
: RimNameConfig(parent)
{
CAF_PDM_InitObject("Cross Plot Curve Set NameGenerator", "", "", "");
2019-03-07 07:17:12 -06:00
CAF_PDM_InitField(&addCaseName, "AddCaseName", true, "Add Case Name", "", "", "");
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
CAF_PDM_InitField(&addAxisVariables, "AddAxisVariables", true, "Add Axis Variables", "", "", "");
2019-03-07 07:17:12 -06:00
CAF_PDM_InitField(&addTimestep, "AddTimeStep", true, "Add Time Step", "", "", "");
CAF_PDM_InitField(&addGrouping, "AddGrouping", true, "Add Data Group", "", "", "");
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
setCustomName("");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridCrossPlotCurveSetNameConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&addCaseName);
uiOrdering.add(&addAxisVariables);
uiOrdering.add(&addTimestep);
uiOrdering.add(&addGrouping);
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 f2146c600705280c85391f88a861a070812ae83a. * #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 05:52:23 -06:00
}