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
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2013-12-03 13:30:32 -06:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-12-03 13:30:32 -06:00
|
|
|
// 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"
|
2018-05-08 09:26:15 -05:00
|
|
|
#include "RimIntersectionCollection.h"
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimFaultInView, "Fault" );
|
2013-12-03 13:30:32 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
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
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "RimFault", ":/draw_style_faults_24x24.png", "", "" );
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &name, "FaultName", "Name", "", "", "" );
|
|
|
|
name.uiCapability()->setUiHidden( true );
|
|
|
|
name.uiCapability()->setUiReadOnly( true );
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &showFault, "ShowFault", true, "Show Fault", "", "", "" );
|
|
|
|
showFault.uiCapability()->setUiHidden( true );
|
2013-12-03 13:30:32 -06:00
|
|
|
|
2019-09-06 03:40:57 -05: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
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RimFaultInView::~RimFaultInView()
|
|
|
|
{
|
|
|
|
}
|
2013-12-03 13:30:32 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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
|
|
|
|
2019-09-06 03:40:57 -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
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfType( reservoirView );
|
2013-12-04 05:13:01 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirView )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
2019-11-26 05:30:44 -06:00
|
|
|
reservoirView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
2013-12-03 13:30:32 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-03 07:46:03 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-01-03 07:46:03 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFaultInView::initAfterRead()
|
|
|
|
{
|
|
|
|
this->updateUiIconFromToggleField();
|
|
|
|
}
|
|
|
|
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimFaultInView::setFaultGeometry( const RigFault* faultGeometry )
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
m_rigFault = faultGeometry;
|
|
|
|
|
|
|
|
this->name = faultGeometry->name();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-12-03 13:30:32 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-13 08:01:52 -05:00
|
|
|
const RigFault* RimFaultInView::faultGeometry() const
|
2013-12-03 13:30:32 -06:00
|
|
|
{
|
|
|
|
return m_rigFault;
|
|
|
|
}
|