2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05: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>
|
2012-05-18 02:45:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-03-13 05:05:46 -05:00
|
|
|
#include "RivReservoirSimWellsPartMgr.h"
|
2015-09-25 08:57:43 -05:00
|
|
|
|
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
|
|
|
#include "RimCellEdgeColors.h"
|
|
|
|
#include "RimEclipseCellColors.h"
|
|
|
|
#include "RimEclipsePropertyFilterCollection.h"
|
2015-05-21 03:34:38 -05:00
|
|
|
#include "RimEclipseView.h"
|
2017-10-13 02:29:42 -05:00
|
|
|
#include "RimSimWellInView.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimSimWellInViewCollection.h"
|
2015-09-25 08:57:43 -05:00
|
|
|
|
2017-01-03 03:09:57 -06:00
|
|
|
#include "RivSimWellPipesPartMgr.h"
|
2018-01-19 05:28:12 -06:00
|
|
|
#include "RivWellConnectionsPartMgr.h"
|
2020-02-03 05:20:35 -06:00
|
|
|
#include "RivWellDiskPartMgr.h"
|
2018-01-19 05:28:12 -06:00
|
|
|
#include "RivWellHeadPartMgr.h"
|
|
|
|
#include "RivWellSpheresPartMgr.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "cafDisplayCoordTransform.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafPdmFieldCvfColor.h"
|
2015-09-25 08:57:43 -05:00
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-02-24 04:07:15 -06:00
|
|
|
#include "cvfTransform.h"
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RivReservoirSimWellsPartMgr::RivReservoirSimWellsPartMgr( RimEclipseView* reservoirView )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
m_reservoirView = reservoirView;
|
|
|
|
|
|
|
|
m_scaleTransform = new cvf::Transform();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RivReservoirSimWellsPartMgr::~RivReservoirSimWellsPartMgr()
|
|
|
|
{
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-03-13 05:05:46 -05:00
|
|
|
void RivReservoirSimWellsPartMgr::clearGeometryCache()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-04-12 02:20:40 -05:00
|
|
|
m_wellPipesPartMgrs.clear();
|
|
|
|
m_wellHeadPartMgrs.clear();
|
2017-03-13 05:35:49 -05:00
|
|
|
m_wellSpheresPartMgrs.clear();
|
2020-02-03 05:20:35 -06:00
|
|
|
m_wellDiskPartMgrs.clear();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-03-13 05:05:46 -05:00
|
|
|
void RivReservoirSimWellsPartMgr::scheduleGeometryRegen()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2017-03-13 05:35:49 -05:00
|
|
|
m_wellSpheresPartMgrs.clear();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RivReservoirSimWellsPartMgr::setScaleTransform( cvf::Transform* scaleTransform )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
m_scaleTransform = scaleTransform;
|
|
|
|
}
|
|
|
|
|
2013-04-12 02:20:40 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-12 02:20:40 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RivReservoirSimWellsPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !m_reservoirView->wellCollection()->isActive() ) return;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_reservoirView->wellCollection()->wells.size() != m_wellPipesPartMgrs.size() )
|
2013-04-25 02:07:29 -05:00
|
|
|
{
|
2013-04-12 02:20:40 -05:00
|
|
|
clearGeometryCache();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < m_reservoirView->wellCollection()->wells.size(); ++i )
|
2013-04-12 02:20:40 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RivSimWellPipesPartMgr* wppmgr = new RivSimWellPipesPartMgr( m_reservoirView->wellCollection()->wells[i] );
|
|
|
|
m_wellPipesPartMgrs.push_back( wppmgr );
|
2013-04-12 02:20:40 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
RivWellHeadPartMgr* wellHeadMgr = new RivWellHeadPartMgr( m_reservoirView->wellCollection()->wells[i] );
|
|
|
|
m_wellHeadPartMgrs.push_back( wellHeadMgr );
|
2013-04-12 02:20:40 -05:00
|
|
|
}
|
2013-04-25 02:07:29 -05:00
|
|
|
}
|
2013-04-12 02:20:40 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++wIdx )
|
2013-04-25 02:07:29 -05:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
|
|
|
m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
2013-04-25 02:07:29 -05:00
|
|
|
}
|
2017-03-13 05:35:49 -05:00
|
|
|
|
2020-02-03 05:20:35 -06:00
|
|
|
// Well disks
|
|
|
|
if ( m_reservoirView->wellCollection()->wells.size() != m_wellDiskPartMgrs.size() )
|
|
|
|
{
|
2020-02-07 03:32:07 -06:00
|
|
|
m_wellDiskPartMgrs.clear();
|
2020-02-03 05:20:35 -06:00
|
|
|
|
|
|
|
for ( size_t i = 0; i < m_reservoirView->wellCollection()->wells.size(); ++i )
|
|
|
|
{
|
|
|
|
RivWellDiskPartMgr* wellDiskMgr = new RivWellDiskPartMgr( m_reservoirView->wellCollection()->wells[i] );
|
|
|
|
m_wellDiskPartMgrs.push_back( wellDiskMgr );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( size_t wIdx = 0; wIdx != m_wellDiskPartMgrs.size(); ++wIdx )
|
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
m_wellDiskPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex, m_reservoirView->displayCoordTransform().p() );
|
2020-02-03 05:20:35 -06:00
|
|
|
}
|
|
|
|
|
2017-03-13 05:35:49 -05:00
|
|
|
// Well spheres
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_reservoirView->wellCollection()->wells.size() != m_wellSpheresPartMgrs.size() )
|
2017-03-13 05:35:49 -05:00
|
|
|
{
|
|
|
|
m_wellSpheresPartMgrs.clear();
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimSimWellInView* rimWell : m_reservoirView->wellCollection()->wells() )
|
2017-03-13 05:35:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RivWellSpheresPartMgr* wppmgr = new RivWellSpheresPartMgr( m_reservoirView, rimWell );
|
|
|
|
m_wellSpheresPartMgrs.push_back( wppmgr );
|
2017-03-13 05:35:49 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx < m_wellSpheresPartMgrs.size(); wIdx++ )
|
2017-03-13 05:35:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( m_reservoirView->wellCollection()->wells[wIdx]->isWellSpheresVisible( frameIndex ) )
|
2017-03-13 05:35:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellSpheresPartMgrs[wIdx]->appendDynamicGeometryPartsToModel( model, frameIndex );
|
2017-03-13 05:35:49 -05:00
|
|
|
}
|
|
|
|
}
|
2017-03-14 13:21:55 -05:00
|
|
|
|
|
|
|
// Well Connection Arrows
|
|
|
|
if ( m_reservoirView->wellCollection()->showWellCommunicationLines() )
|
|
|
|
{
|
2017-10-13 02:29:42 -05:00
|
|
|
for ( RimSimWellInView* rimWell : m_reservoirView->wellCollection()->wells() )
|
2017-03-14 13:21:55 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::ref<RivWellConnectionsPartMgr> wppmgr = new RivWellConnectionsPartMgr( m_reservoirView, rimWell );
|
|
|
|
wppmgr->appendDynamicGeometryPartsToModel( model, frameIndex );
|
2017-03-14 13:21:55 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-12 02:20:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-12 02:20:40 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RivReservoirSimWellsPartMgr::updatePipeResultColor( size_t frameIndex )
|
2013-04-12 02:20:40 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++wIdx )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
m_wellPipesPartMgrs[wIdx]->updatePipeResultColor( frameIndex );
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|