2013-12-03 13:30:32 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-24 00:14:52 -05:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2013-12-03 13:30:32 -06: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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-10-13 08:01:52 -05:00
|
|
|
#include "RimFaultInView.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
|
|
|
#include "RigFault.h"
|
|
|
|
|
2015-05-21 03:34:38 -05:00
|
|
|
#include "RimEclipseView.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2017-10-13 08:01:52 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimFaultInView, "Fault");
|
2013-12-03 13:30:32 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
RimFaultInView::RimFaultInView()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("RimFault", ":/draw_style_faults_24x24.png", "", "");
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&name, "FaultName", "Name", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
name.uiCapability()->setUiHidden(true);
|
|
|
|
name.uiCapability()->setUiReadOnly(true);
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2017-11-30 06:44:18 -06:00
|
|
|
CAF_PDM_InitField(&showFault, "ShowFault", true, "Show Fault", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
showFault.uiCapability()->setUiHidden(true);
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2017-11-30 06:44:18 -06:00
|
|
|
CAF_PDM_InitField(&faultColor, "Color", cvf::Color3f(0.588f, 0.588f, 0.804f), "Fault Color", "", "", "");
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2018-02-18 11:56:43 -06:00
|
|
|
m_rigFault = nullptr;
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
RimFaultInView::~RimFaultInView()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
caf::PdmFieldHandle* RimFaultInView::userDescriptionField()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return &name;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
void RimFaultInView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
2014-08-01 06:35:52 -05:00
|
|
|
this->updateUiIconFromToggleField();
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2014-06-12 05:35:48 -05:00
|
|
|
if (&faultColor == changedField || &showFault == changedField)
|
2013-12-04 05:13:01 -06:00
|
|
|
{
|
2018-02-18 11:56:43 -06:00
|
|
|
RimEclipseView* reservoirView = nullptr;
|
2015-07-31 11:58:23 -05:00
|
|
|
|
2016-09-21 06:59:41 -05:00
|
|
|
this->firstAncestorOrThisOfType(reservoirView);
|
2013-12-04 05:13:01 -06:00
|
|
|
|
|
|
|
if (reservoirView)
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-03 07:46:03 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFaultInView::initAfterRead()
|
|
|
|
{
|
|
|
|
this->updateUiIconFromToggleField();
|
|
|
|
}
|
|
|
|
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
caf::PdmFieldHandle* RimFaultInView::objectToggleField()
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return &showFault;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
void RimFaultInView::setFaultGeometry(const RigFault* faultGeometry)
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
m_rigFault = faultGeometry;
|
|
|
|
|
|
|
|
this->name = faultGeometry->name();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
const RigFault* RimFaultInView::faultGeometry() const
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return m_rigFault;
|
|
|
|
}
|
|
|
|
|