2016-12-16 07:05:11 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-12-16 07:05:11 -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
|
|
|
//
|
2016-12-16 07:05:11 -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>
|
2016-12-16 07:05:11 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimWellPathFractureCollection.h"
|
2016-12-16 07:05:11 -06:00
|
|
|
|
2017-06-09 03:33:50 -05:00
|
|
|
#include "RimProject.h"
|
2017-01-02 04:59:30 -06:00
|
|
|
#include "RimWellPathFracture.h"
|
2017-06-09 03:33:50 -05:00
|
|
|
|
2016-12-16 07:05:11 -06:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellPathFractureCollection, "WellPathFractureCollection" );
|
2016-12-16 07:05:11 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-16 07:05:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPathFractureCollection::RimWellPathFractureCollection( void )
|
2016-12-16 07:05:11 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitObject( "Fractures", ":/FractureLayout16x16.png", "", "" );
|
2016-12-16 07:05:11 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_fractures, "Fractures", "", "", "", "" );
|
|
|
|
m_fractures.uiCapability()->setUiHidden( true );
|
2017-06-09 03:33:50 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
setName( "Fractures" );
|
|
|
|
nameField()->uiCapability()->setUiHidden( true );
|
2018-08-21 03:34:29 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
2018-08-21 03:34:29 -05:00
|
|
|
m_mswParameters = new RimMswCompletionParameters;
|
2019-09-06 03:40:57 -05:00
|
|
|
m_mswParameters.uiCapability()->setUiTreeHidden( true );
|
|
|
|
m_mswParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
2018-12-18 06:43:21 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_InitField( &m_refMDType_OBSOLETE, "RefMDType", std::numeric_limits<int>::max(), "Reference MD", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_refMD_OBSOLETE, "RefMD", std::numeric_limits<double>::infinity(), "", "", "", "" );
|
2020-05-18 09:02:27 -05:00
|
|
|
|
|
|
|
setDeletable( true );
|
2016-12-16 07:05:11 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-16 07:05:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RimWellPathFractureCollection::~RimWellPathFractureCollection()
|
|
|
|
{
|
|
|
|
}
|
2017-01-02 03:12:43 -06:00
|
|
|
|
2018-08-21 03:34:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RimMswCompletionParameters* RimWellPathFractureCollection::mswParameters() const
|
|
|
|
{
|
|
|
|
return m_mswParameters;
|
|
|
|
}
|
|
|
|
|
2018-09-05 04:46:02 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-09-05 04:46:02 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellPathFractureCollection::addFracture( RimWellPathFracture* fracture )
|
2018-09-05 04:46:02 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_fractures.push_back( fracture );
|
2018-09-05 04:46:02 -05:00
|
|
|
}
|
|
|
|
|
2017-01-02 03:12:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-01-02 03:12:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-01-02 04:59:30 -06:00
|
|
|
void RimWellPathFractureCollection::deleteFractures()
|
2017-01-02 03:12:43 -06:00
|
|
|
{
|
2018-09-05 04:46:02 -05:00
|
|
|
m_fractures.deleteAllChildObjects();
|
2017-01-02 03:12:43 -06:00
|
|
|
}
|
2017-06-09 03:33:50 -05:00
|
|
|
|
2018-08-21 03:34:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathFractureCollection::setUnitSystemSpecificDefaults()
|
|
|
|
{
|
|
|
|
m_mswParameters->setUnitSystemSpecificDefaults();
|
|
|
|
}
|
|
|
|
|
2018-09-05 04:46:02 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-09-05 04:46:02 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-07 06:32:53 -05:00
|
|
|
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::allFractures() const
|
2018-09-05 04:46:02 -05:00
|
|
|
{
|
|
|
|
return m_fractures.childObjects();
|
|
|
|
}
|
|
|
|
|
2018-08-21 03:34:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-07 06:24:56 -05:00
|
|
|
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::activeFractures() const
|
|
|
|
{
|
|
|
|
std::vector<RimWellPathFracture*> active;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( isChecked() )
|
2018-09-07 06:24:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& f : allFractures() )
|
2018-09-07 06:24:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( f->isChecked() )
|
2018-09-07 06:24:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
active.push_back( f );
|
2018-09-07 06:24:56 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return active;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellPathFractureCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2018-08-21 03:34:29 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup( "Multi Segment Well Options" );
|
|
|
|
m_mswParameters->uiOrdering( uiConfigName, *mswGroup );
|
|
|
|
uiOrdering.skipRemainingFields( true );
|
2018-08-21 03:34:29 -05:00
|
|
|
}
|
|
|
|
|
2017-06-09 03:33:50 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-06-09 03:33:50 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimWellPathFractureCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
2017-06-09 03:33:50 -05:00
|
|
|
{
|
|
|
|
RimProject* proj;
|
2019-09-06 03:40:57 -05:00
|
|
|
this->firstAncestorOrThisOfTypeAsserted( proj );
|
|
|
|
if ( changedField == &m_isChecked )
|
2017-06-20 10:22:14 -05:00
|
|
|
{
|
|
|
|
proj->reloadCompletionTypeResultsInAllViews();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-09-11 05:41:45 -05:00
|
|
|
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
2017-06-20 10:22:14 -05:00
|
|
|
}
|
2017-06-09 03:33:50 -05:00
|
|
|
}
|
2018-12-18 06:43:21 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellPathFractureCollection::initAfterRead()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_refMDType_OBSOLETE() != std::numeric_limits<int>::max() )
|
2018-12-18 06:43:21 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_mswParameters->setReferenceMDType( (RimMswCompletionParameters::ReferenceMDType)m_refMDType_OBSOLETE() );
|
2018-12-18 06:43:21 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_refMD_OBSOLETE() != std::numeric_limits<double>::infinity() )
|
2018-12-18 06:43:21 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_mswParameters->setManualReferenceMD( m_refMD_OBSOLETE() );
|
2018-12-18 06:43:21 -06:00
|
|
|
}
|
|
|
|
}
|