2014-07-29 01:49:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2014-07-29 01:49:54 -05:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-06-25 06:32:00 -05:00
|
|
|
#include "RimEclipseFaultColors.h"
|
2014-07-29 01:49:54 -05:00
|
|
|
|
2015-05-15 02:16:33 -05:00
|
|
|
#include "RimEclipseCase.h"
|
2015-06-25 06:32:00 -05:00
|
|
|
#include "RimEclipseCellColors.h"
|
2015-12-08 10:43:07 -06:00
|
|
|
#include "RimEclipseView.h"
|
2016-08-01 15:27:03 -05:00
|
|
|
#include "RimLegendConfig.h"
|
2015-12-08 10:43:07 -06:00
|
|
|
#include "RimTernaryLegendConfig.h"
|
|
|
|
|
2014-09-04 02:30:00 -05:00
|
|
|
#include "RiuMainWindow.h"
|
2015-08-10 01:00:16 -05:00
|
|
|
|
2015-08-09 07:12:09 -05:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2014-07-30 07:26:39 -05:00
|
|
|
|
2014-07-29 01:49:54 -05:00
|
|
|
|
|
|
|
|
2015-06-25 05:06:43 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimEclipseFaultColors, "RimFaultResultSlot");
|
2014-07-29 01:49:54 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
RimEclipseFaultColors::RimEclipseFaultColors()
|
2014-07-29 01:49:54 -05:00
|
|
|
{
|
2015-08-10 14:59:07 -05:00
|
|
|
CAF_PDM_InitObject("Separate Fault Result", ":/draw_style_faults_24x24.png", "", "");
|
2014-07-29 01:49:54 -05:00
|
|
|
|
2014-08-01 02:40:35 -05:00
|
|
|
CAF_PDM_InitField(&showCustomFaultResult, "ShowCustomFaultResult", false, "Show Custom Fault Result", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
showCustomFaultResult.uiCapability()->setUiHidden(true);
|
2014-08-01 02:40:35 -05:00
|
|
|
|
2015-06-26 02:39:05 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_customFaultResultColors, "CustomResultSlot", "Custom Fault Result", ":/CellResult.png", "", "");
|
|
|
|
m_customFaultResultColors = new RimEclipseCellColors();
|
2014-07-30 07:26:39 -05:00
|
|
|
|
2015-08-05 06:27:36 -05:00
|
|
|
m_customFaultResultColors.uiCapability()->setUiHidden(true);
|
2014-09-04 02:30:00 -05:00
|
|
|
|
2014-07-29 01:49:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
RimEclipseFaultColors::~RimEclipseFaultColors()
|
2014-07-29 01:49:54 -05:00
|
|
|
{
|
2015-12-09 06:52:25 -06:00
|
|
|
delete m_customFaultResultColors;
|
|
|
|
m_customFaultResultColors = NULL;
|
2014-07-29 01:49:54 -05:00
|
|
|
}
|
|
|
|
|
2014-07-30 07:26:39 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
void RimEclipseFaultColors::setReservoirView(RimEclipseView* ownerReservoirView)
|
2014-07-30 07:26:39 -05:00
|
|
|
{
|
2014-07-31 01:46:30 -05:00
|
|
|
m_reservoirView = ownerReservoirView;
|
2015-06-26 02:39:05 -05:00
|
|
|
m_customFaultResultColors->setReservoirView(ownerReservoirView);
|
2014-07-30 07:26:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
void RimEclipseFaultColors::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
2014-07-30 07:26:39 -05:00
|
|
|
{
|
2014-08-01 06:35:52 -05:00
|
|
|
this->updateUiIconFromToggleField();
|
2014-08-01 05:55:43 -05:00
|
|
|
|
2014-07-31 07:05:40 -05:00
|
|
|
if (m_reservoirView) m_reservoirView->scheduleCreateDisplayModelAndRedraw();
|
2014-07-30 07:26:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
void RimEclipseFaultColors::initAfterRead()
|
2014-07-30 07:26:39 -05:00
|
|
|
{
|
2015-06-26 02:39:05 -05:00
|
|
|
m_customFaultResultColors->initAfterRead();
|
2014-08-01 05:55:43 -05:00
|
|
|
|
2014-08-01 06:35:52 -05:00
|
|
|
this->updateUiIconFromToggleField();
|
2014-07-30 07:26:39 -05:00
|
|
|
}
|
|
|
|
|
2014-07-31 01:46:30 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
RimEclipseCellColors* RimEclipseFaultColors::customFaultResult()
|
2014-07-31 01:46:30 -05:00
|
|
|
{
|
2015-06-26 02:39:05 -05:00
|
|
|
return this->m_customFaultResultColors();
|
2014-07-30 07:26:39 -05:00
|
|
|
}
|
|
|
|
|
2018-02-13 06:29:44 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimEclipseFaultColors::updateUiFieldsFromActiveResult()
|
|
|
|
{
|
|
|
|
m_customFaultResultColors->updateUiFieldsFromActiveResult();
|
|
|
|
}
|
|
|
|
|
2014-08-01 02:40:35 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
caf::PdmFieldHandle* RimEclipseFaultColors::objectToggleField()
|
2014-08-01 02:40:35 -05:00
|
|
|
{
|
|
|
|
return &showCustomFaultResult;
|
|
|
|
}
|
|
|
|
|
2014-08-01 05:55:43 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
void RimEclipseFaultColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
2014-08-01 05:55:43 -05:00
|
|
|
{
|
2014-08-26 04:47:14 -05:00
|
|
|
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
2017-03-22 09:02:42 -05:00
|
|
|
m_customFaultResultColors->uiOrdering(uiConfigName, *group1);
|
2014-08-01 05:55:43 -05:00
|
|
|
}
|
|
|
|
|
2014-08-26 04:47:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-06-25 05:06:43 -05:00
|
|
|
bool RimEclipseFaultColors::hasValidCustomResult()
|
2014-08-26 04:47:14 -05:00
|
|
|
{
|
2014-09-09 06:07:01 -05:00
|
|
|
if (this->showCustomFaultResult())
|
2014-08-26 04:47:14 -05:00
|
|
|
{
|
2015-06-26 02:39:05 -05:00
|
|
|
if (m_customFaultResultColors->hasResult() || m_customFaultResultColors->isTernarySaturationSelected())
|
2014-09-04 02:30:00 -05:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2015-08-09 07:12:09 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimEclipseFaultColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
|
|
|
{
|
2016-11-02 08:20:11 -05:00
|
|
|
m_customFaultResultColors()->defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
2015-08-09 07:12:09 -05:00
|
|
|
}
|