ResInsight/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFractureCollection.cpp
Magne Sjaastad 4f89e38334 #7595 MSW : Move MSW parameters to well path
Move msw parameters to well path
Make it clear when options are taken from top level well path or well path lateral
Use well path lateral custom values for diameter and roughness
2021-04-20 21:13:02 +02:00

129 lines
4.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- Statoil 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 "RimWellPathFractureCollection.h"
#include "RimProject.h"
#include "RimWellPathFracture.h"
#include "cafPdmObject.h"
CAF_PDM_SOURCE_INIT( RimWellPathFractureCollection, "WellPathFractureCollection" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathFractureCollection::RimWellPathFractureCollection( void )
{
CAF_PDM_InitObject( "Fractures", ":/FractureLayout16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault( &m_fractures, "Fractures", "", "", "", "" );
m_fractures.uiCapability()->setUiHidden( true );
setName( "Fractures" );
nameField()->uiCapability()->setUiHidden( true );
setDeletable( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathFractureCollection::~RimWellPathFractureCollection()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPathFractureCollection::hasFractures() const
{
return !m_fractures.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::addFracture( RimWellPathFracture* fracture )
{
m_fractures.push_back( fracture );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::deleteFractures()
{
m_fractures.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::allFractures() const
{
return m_fractures.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPathFracture*> RimWellPathFractureCollection::activeFractures() const
{
std::vector<RimWellPathFracture*> active;
if ( isChecked() )
{
for ( const auto& f : allFractures() )
{
if ( f->isChecked() )
{
active.push_back( f );
}
}
}
return active;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
if ( changedField == &m_isChecked )
{
RimProject::current()->reloadCompletionTypeResultsInAllViews();
}
else
{
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathFractureCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
std::vector<caf::PdmObjectHandle*>& referringObjects )
{
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
}