#1114 WIP: Refactor: Removed RivReservoirWellSpheresPartMgr

This commit is contained in:
Jacob Støren
2017-03-13 11:35:49 +01:00
parent d34b4e3c05
commit 4c8e1e2bcd
7 changed files with 49 additions and 166 deletions

View File

@@ -21,7 +21,6 @@ ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.h
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.h
${CEE_CURRENT_LIST_DIR}RivReservoirWellSpheresPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h
${CEE_CURRENT_LIST_DIR}RivResultToTextureMapper.h
${CEE_CURRENT_LIST_DIR}RivTernaryResultToTextureMapper.h
@@ -55,7 +54,6 @@ ${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivReservoirWellSpheresPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp
${CEE_CURRENT_LIST_DIR}RivTernaryScalarMapper.cpp

View File

@@ -36,6 +36,7 @@
#include "cafPdmFieldCvfMat4d.h"
#include "cvfTransform.h"
#include "RivWellSpheresPartMgr.h"
//--------------------------------------------------------------------------------------------------
///
@@ -62,6 +63,8 @@ void RivReservoirSimWellsPartMgr::clearGeometryCache()
{
m_wellPipesPartMgrs.clear();
m_wellHeadPartMgrs.clear();
m_wellSpheresPartMgrs.clear();
}
//--------------------------------------------------------------------------------------------------
@@ -78,6 +81,8 @@ void RivReservoirSimWellsPartMgr::scheduleGeometryRegen()
{
//m_wellHeadPartMgrs[wIdx]->scheduleGeometryRegen(scaleTransform);
}
m_wellSpheresPartMgrs.clear();
}
//--------------------------------------------------------------------------------------------------
@@ -126,6 +131,27 @@ void RivReservoirSimWellsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBa
m_wellPipesPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex);
m_wellHeadPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex);
}
// Well spheres
if (m_reservoirView->wellCollection()->wells.size() != m_wellSpheresPartMgrs.size())
{
m_wellSpheresPartMgrs.clear();
for (RimEclipseWell* rimWell : m_reservoirView->wellCollection()->wells())
{
RivWellSpheresPartMgr* wppmgr = new RivWellSpheresPartMgr(m_reservoirView, rimWell);
m_wellSpheresPartMgrs.push_back(wppmgr);
}
}
for (size_t wIdx = 0; wIdx < m_wellSpheresPartMgrs.size(); wIdx++)
{
if (m_reservoirView->wellCollection()->wells[wIdx]->isWellSpheresVisible(frameIndex))
{
m_wellSpheresPartMgrs[wIdx]->appendDynamicGeometryPartsToModel(model, frameIndex);
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -34,6 +34,7 @@ namespace cvf
class RimEclipseView;
class RivSimWellPipesPartMgr;
class RivWellHeadPartMgr;
class RivWellSpheresPartMgr;
class RivReservoirSimWellsPartMgr : public cvf::Object
{
@@ -57,4 +58,6 @@ private:
cvf::Collection< RivSimWellPipesPartMgr > m_wellPipesPartMgrs;
cvf::Collection< RivWellHeadPartMgr > m_wellHeadPartMgrs;
cvf::Collection< RivWellSpheresPartMgr > m_wellSpheresPartMgrs;
};

View File

@@ -1,86 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RivReservoirWellSpheresPartMgr.h"
#include "RivWellSpheresPartMgr.h"
#include "RimEclipseView.h"
#include "RimEclipseWell.h"
#include "RimEclipseWellCollection.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmFieldCvfMat4d.h"
#include "cvfTransform.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivReservoirWellSpheresPartMgr::RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView)
{
m_reservoirView = reservoirView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivReservoirWellSpheresPartMgr::~RivReservoirWellSpheresPartMgr()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivReservoirWellSpheresPartMgr::clearGeometryCache()
{
m_wellSpheresPartMgrs.clear();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivReservoirWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex)
{
if (!m_reservoirView->wellCollection()->isActive()) return;
if (m_reservoirView->wellCollection()->wells.size() != m_wellSpheresPartMgrs.size())
{
clearGeometryCache();
for (RimEclipseWell* rimWell : m_reservoirView->wellCollection()->wells())
{
RivWellSpheresPartMgr* wppmgr = new RivWellSpheresPartMgr(m_reservoirView, rimWell);
m_wellSpheresPartMgrs.push_back(wppmgr);
}
}
for (size_t i = 0; i < m_wellSpheresPartMgrs.size(); i++)
{
if (m_reservoirView->wellCollection()->wells[i]->isWellSpheresVisible(frameIndex))
{
m_wellSpheresPartMgrs.at(i)->appendDynamicGeometryPartsToModel(model, frameIndex);
}
}
}

View File

@@ -1,48 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"
#include "cvfCollection.h"
#include "cvfVector3.h"
#include "cafPdmPointer.h"
namespace cvf
{
class ModelBasicList;
}
class RimEclipseView;
class RivWellSpheresPartMgr;
class RivReservoirWellSpheresPartMgr : public cvf::Object
{
public:
explicit RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView);
~RivReservoirWellSpheresPartMgr();
void clearGeometryCache();
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
private:
caf::PdmPointer<RimEclipseView> m_reservoirView;
cvf::Collection< RivWellSpheresPartMgr > m_wellSpheresPartMgrs;
};

View File

@@ -63,7 +63,6 @@
#include "RivReservoirSimWellsPartMgr.h"
#include "RivReservoirViewPartMgr.h"
#include "RivReservoirWellSpheresPartMgr.h"
#include "RivSingleCellPartGenerator.h"
#include "RivTernarySaturationOverlayItem.h"
#include "RivWellPathCollectionPartMgr.h"
@@ -137,8 +136,7 @@ RimEclipseView::RimEclipseView()
this->faultResultSettings()->setReservoirView(this);
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
m_pipesPartManager = new RivReservoirSimWellsPartMgr(this);
m_wellSpheresPartManager = new RivReservoirWellSpheresPartMgr(this);
m_simWellsPartManager = new RivReservoirSimWellsPartMgr(this);
m_reservoir = NULL;
}
@@ -228,7 +226,7 @@ void RimEclipseView::updateScaleTransform()
scale(2, 2) = scaleZ();
this->scaleTransform()->setLocalTransform(scale);
m_pipesPartManager->setScaleTransform(this->scaleTransform());
m_simWellsPartManager->setScaleTransform(this->scaleTransform());
if (m_viewer) m_viewer->updateCachedValuesInScene();
}
@@ -613,26 +611,23 @@ void RimEclipseView::updateCurrentTimeStep()
crossSectionCollection->applySingleColorEffect();
}
// Simulation Well pipes
// Simulation Wells
if (m_viewer)
{
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
if (frameScene)
{
// Simulation Well pipes
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
simWellModelBasicList->setName("SimWellPipeMod");
cvf::ref<cvf::ModelBasicList> wellPipeModelBasicList = new cvf::ModelBasicList;
wellPipeModelBasicList->setName("SimWellPipeMod");
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
m_pipesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
m_wellSpheresPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
simWellModelBasicList->updateBoundingBoxesRecursive();
wellPipeModelBasicList->updateBoundingBoxesRecursive();
this->removeModelByName(frameScene, simWellModelBasicList->name());
frameScene->addModel(simWellModelBasicList.p());
this->removeModelByName(frameScene, wellPipeModelBasicList->name());
frameScene->addModel(wellPipeModelBasicList.p());
m_pipesPartManager->updatePipeResultColor(m_currentTimeStep);
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
}
}
@@ -678,8 +673,7 @@ void RimEclipseView::loadDataAndUpdate()
this->faultCollection()->syncronizeFaults();
m_reservoirGridPartManager->clearGeometryCache();
m_pipesPartManager->clearGeometryCache();
m_wellSpheresPartManager->clearGeometryCache();
m_simWellsPartManager->clearGeometryCache();
syncronizeWellsWithResults();
@@ -873,8 +867,7 @@ void RimEclipseView::scheduleReservoirGridGeometryRegen()
//--------------------------------------------------------------------------------------------------
void RimEclipseView::scheduleSimWellGeometryRegen()
{
m_pipesPartManager->scheduleGeometryRegen();
m_wellSpheresPartManager->clearGeometryCache();
m_simWellsPartManager->scheduleGeometryRegen();
}
@@ -1262,8 +1255,7 @@ void RimEclipseView::calculateVisibleWellCellsIncFence(cvf::UByteArray* visibleC
void RimEclipseView::updateDisplayModelForWellResults()
{
m_reservoirGridPartManager->clearGeometryCache();
m_pipesPartManager->clearGeometryCache();
m_wellSpheresPartManager->clearGeometryCache();
m_simWellsPartManager->clearGeometryCache();
syncronizeWellsWithResults();

View File

@@ -55,7 +55,6 @@ class RimEclipseCellColors;
class RimEclipseWellCollection;
class RiuViewer;
class RivReservoirSimWellsPartMgr;
class RivReservoirWellSpheresPartMgr;
class RivIntersectionPartMgr;
class RivReservoirViewPartMgr;
@@ -88,12 +87,12 @@ public:
// Fields containing child objects :
caf::PdmChildField<RimEclipseCellColors*> cellResult;
caf::PdmChildField<RimCellEdgeColors*> cellEdgeResult;
caf::PdmChildField<RimEclipseFaultColors*> faultResultSettings;
caf::PdmChildField<RimEclipseWellCollection*> wellCollection;
caf::PdmChildField<RimFaultCollection*> faultCollection;
caf::PdmChildField<RimEclipseCellColors*> cellResult;
caf::PdmChildField<RimCellEdgeColors*> cellEdgeResult;
caf::PdmChildField<RimEclipseFaultColors*> faultResultSettings;
caf::PdmChildField<RimEclipseWellCollection*> wellCollection;
caf::PdmChildField<RimFaultCollection*> faultCollection;
// Fields
@@ -180,8 +179,7 @@ private:
caf::PdmPointer<RimEclipseCase> m_reservoir;
cvf::ref<RivReservoirViewPartMgr> m_reservoirGridPartManager;
cvf::ref<RivReservoirSimWellsPartMgr> m_pipesPartManager;
cvf::ref<RivReservoirWellSpheresPartMgr> m_wellSpheresPartManager;
cvf::ref<RivReservoirSimWellsPartMgr> m_simWellsPartManager;
std::vector<RivCellSetEnum> m_visibleGridParts;
};