2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 09:45:23 +02: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.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2013-03-22 16:12:00 +01:00
|
|
|
#include "RiaStdInclude.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
#include "RivReservoirPipesPartMgr.h"
|
2015-05-21 10:34:38 +02:00
|
|
|
#include "RimEclipseView.h"
|
2015-06-25 13:36:15 +02:00
|
|
|
#include "RimEclipseWell.h"
|
|
|
|
|
#include "RimEclipseWellCollection.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "RivWellPipesPartMgr.h"
|
2012-06-26 16:10:41 +02:00
|
|
|
#include "RivWellHeadPartMgr.h"
|
2015-06-25 13:45:32 +02:00
|
|
|
#include "RimCellEdgeColors.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-05-06 10:55:00 +02:00
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
|
|
|
|
#include "cafPdmFieldCvfColor.h"
|
2015-06-25 13:32:00 +02:00
|
|
|
#include "RimEclipseCellColors.h"
|
2013-05-06 10:55:00 +02:00
|
|
|
#include "RimCellRangeFilterCollection.h"
|
2015-06-25 13:05:28 +02:00
|
|
|
#include "RimEclipsePropertyFilterCollection.h"
|
2013-05-06 10:55:00 +02:00
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-05-21 10:05:33 +02:00
|
|
|
RivReservoirPipesPartMgr::RivReservoirPipesPartMgr(RimEclipseView* reservoirView)
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
m_reservoirView = reservoirView;
|
|
|
|
|
|
|
|
|
|
m_scaleTransform = new cvf::Transform();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RivReservoirPipesPartMgr::~RivReservoirPipesPartMgr()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-04-12 09:20:40 +02:00
|
|
|
void RivReservoirPipesPartMgr::clearGeometryCache()
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2013-04-12 09:20:40 +02:00
|
|
|
m_wellPipesPartMgrs.clear();
|
|
|
|
|
m_wellHeadPartMgrs.clear();
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-04-12 09:20:40 +02:00
|
|
|
void RivReservoirPipesPartMgr::scheduleGeometryRegen()
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx)
|
|
|
|
|
{
|
2013-04-12 09:20:40 +02:00
|
|
|
m_wellPipesPartMgrs[wIdx]->scheduleGeometryRegen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (size_t wIdx = 0; wIdx != m_wellHeadPartMgrs.size(); ++ wIdx)
|
|
|
|
|
{
|
|
|
|
|
//m_wellHeadPartMgrs[wIdx]->scheduleGeometryRegen(scaleTransform);
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RivReservoirPipesPartMgr::setScaleTransform(cvf::Transform * scaleTransform)
|
|
|
|
|
{
|
|
|
|
|
m_scaleTransform = scaleTransform;
|
|
|
|
|
|
|
|
|
|
for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx)
|
|
|
|
|
{
|
|
|
|
|
m_wellPipesPartMgrs[wIdx]->setScaleTransform(scaleTransform);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (size_t wIdx = 0; wIdx != m_wellHeadPartMgrs.size(); ++ wIdx)
|
|
|
|
|
{
|
|
|
|
|
m_wellHeadPartMgrs[wIdx]->setScaleTransform(scaleTransform);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-04-12 09:20:40 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RivReservoirPipesPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2013-08-08 17:15:17 +02:00
|
|
|
if (!m_reservoirView->wellCollection()->isActive()) return;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-06-25 12:09:16 +02:00
|
|
|
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF) return;
|
2013-04-25 09:07:29 +02:00
|
|
|
|
|
|
|
|
if (m_reservoirView->wellCollection()->wells.size() != m_wellPipesPartMgrs.size())
|
|
|
|
|
{
|
2013-04-12 09:20:40 +02:00
|
|
|
clearGeometryCache();
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < m_reservoirView->wellCollection()->wells.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
RivWellPipesPartMgr * wppmgr = new RivWellPipesPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i]);
|
|
|
|
|
m_wellPipesPartMgrs.push_back(wppmgr);
|
|
|
|
|
wppmgr->setScaleTransform(m_scaleTransform.p());
|
|
|
|
|
|
2013-04-19 08:02:36 +02:00
|
|
|
RivWellHeadPartMgr* wellHeadMgr = new RivWellHeadPartMgr(m_reservoirView, m_reservoirView->wellCollection()->wells[i]);
|
2013-04-12 09:20:40 +02:00
|
|
|
m_wellHeadPartMgrs.push_back(wellHeadMgr);
|
|
|
|
|
wellHeadMgr->setScaleTransform(m_scaleTransform.p());
|
|
|
|
|
}
|
2013-04-25 09:07:29 +02:00
|
|
|
}
|
2013-04-12 09:20:40 +02:00
|
|
|
|
2013-04-25 09:07:29 +02:00
|
|
|
for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx)
|
|
|
|
|
{
|
|
|
|
|
m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex);
|
|
|
|
|
m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex);
|
|
|
|
|
}
|
2013-04-12 09:20:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RivReservoirPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
|
|
|
|
{
|
|
|
|
|
for (size_t wIdx = 0; wIdx != m_wellPipesPartMgrs.size(); ++ wIdx)
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
2013-04-12 09:20:40 +02:00
|
|
|
m_wellPipesPartMgrs[wIdx]->updatePipeResultColor( frameIndex);
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
}
|
2013-04-12 09:20:40 +02:00
|
|
|
|