mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1025 Removed unsused code and renamed to isWellPipe/SpheresVisible
This commit is contained in:
parent
f7437438d1
commit
860b51931c
@ -47,6 +47,15 @@ RivReservoirWellSpheresPartMgr::~RivReservoirWellSpheresPartMgr()
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivReservoirWellSpheresPartMgr::clearGeometryCache()
|
||||
{
|
||||
m_wellSpheresPartMgrs.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -58,6 +67,8 @@ void RivReservoirWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
|
||||
|
||||
if (m_reservoirView->wellCollection()->wells.size() != m_wellSpheresPartMgrs.size())
|
||||
{
|
||||
clearGeometryCache();
|
||||
|
||||
for (RimEclipseWell* rimWell : m_reservoirView->wellCollection()->wells())
|
||||
{
|
||||
RivWellSpheresPartMgr* wppmgr = new RivWellSpheresPartMgr(m_reservoirView, rimWell);
|
||||
@ -67,33 +78,8 @@ void RivReservoirWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode
|
||||
|
||||
for (size_t i = 0; i < m_wellSpheresPartMgrs.size(); i++)
|
||||
{
|
||||
|
||||
bool showGeo = false;
|
||||
|
||||
|
||||
if (m_reservoirView->wellCollection()->wells[i]->showWell())
|
||||
if (m_reservoirView->wellCollection()->wells[i]->isWellSpheresVisible(frameIndex))
|
||||
{
|
||||
|
||||
if (m_reservoirView->wellCollection->wellSphereVisibility == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
{
|
||||
showGeo = true;
|
||||
}
|
||||
|
||||
else if (m_reservoirView->wellCollection->wellSphereVisibility == RimEclipseWellCollection::PIPES_INDIVIDUALLY && m_reservoirView->wellCollection()->wells[i]->showWellSpheres() )
|
||||
{
|
||||
showGeo = true;
|
||||
}
|
||||
|
||||
else if (m_reservoirView->wellCollection->wellSphereVisibility == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS && m_reservoirView->wellCollection->wells[i]->visibleCellsInstersectsWell(frameIndex))
|
||||
{
|
||||
showGeo = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (showGeo)
|
||||
{
|
||||
m_wellSpheresPartMgrs.at(i)->appendDynamicGeometryPartsToModel(model, frameIndex);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Transform;
|
||||
class ModelBasicList;
|
||||
}
|
||||
|
||||
@ -38,14 +37,11 @@ public:
|
||||
RivReservoirWellSpheresPartMgr(RimEclipseView* reservoirView);
|
||||
~RivReservoirWellSpheresPartMgr();
|
||||
|
||||
void clearGeometryCache();
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_reservoirView;
|
||||
cvf::Collection< RivWellSpheresPartMgr > m_wellSpheresPartMgrs;
|
||||
|
||||
};
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RivWellSpheresPartMgr.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
@ -28,7 +30,6 @@
|
||||
|
||||
#include "RiuViewer.h"
|
||||
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@ -44,7 +45,6 @@
|
||||
#include "cvfGeometryBuilderTriangles.h"
|
||||
#include "cvfOpenGLResourceManager.h"
|
||||
#include "cvfShaderProgram.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
@ -52,8 +52,6 @@ public:
|
||||
RivWellSpheresPartMgr(RimEclipseView* reservoirView, RimEclipseWell* well);
|
||||
~RivWellSpheresPartMgr();
|
||||
|
||||
void scheduleGeometryRegen() { m_needsTransformUpdate = true; }
|
||||
|
||||
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, size_t frameIndex);
|
||||
|
||||
private:
|
||||
@ -63,6 +61,4 @@ private:
|
||||
private:
|
||||
caf::PdmPointer<RimEclipseView> m_rimReservoirView;
|
||||
caf::PdmPointer<RimEclipseWell> m_rimWell;
|
||||
|
||||
bool m_needsTransformUpdate;
|
||||
};
|
||||
|
@ -131,7 +131,6 @@ RimEclipseView::RimEclipseView()
|
||||
m_reservoirGridPartManager = new RivReservoirViewPartMgr(this);
|
||||
m_pipesPartManager = new RivReservoirPipesPartMgr(this);
|
||||
m_wellSpheresPartManager = new RivReservoirWellSpheresPartMgr(this);
|
||||
|
||||
|
||||
m_reservoir = NULL;
|
||||
}
|
||||
@ -666,7 +665,6 @@ void RimEclipseView::updateCurrentTimeStep()
|
||||
m_pipesPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
m_wellSpheresPartManager->appendDynamicGeometryPartsToModel(wellPipeModelBasicList.p(), m_currentTimeStep);
|
||||
|
||||
|
||||
wellPipeModelBasicList->updateBoundingBoxesRecursive();
|
||||
|
||||
this->removeModelByName(frameScene, wellPipeModelBasicList->name());
|
||||
@ -900,6 +898,7 @@ void RimEclipseView::scheduleReservoirGridGeometryRegen()
|
||||
void RimEclipseView::schedulePipeGeometryRegen()
|
||||
{
|
||||
m_pipesPartManager->scheduleGeometryRegen();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
}
|
||||
|
||||
|
||||
@ -1308,6 +1307,7 @@ void RimEclipseView::updateDisplayModelForWellResults()
|
||||
{
|
||||
m_reservoirGridPartManager->clearGeometryCache();
|
||||
m_pipesPartManager->clearGeometryCache();
|
||||
m_wellSpheresPartManager->clearGeometryCache();
|
||||
|
||||
syncronizeWellsWithResults();
|
||||
|
||||
|
@ -148,106 +148,6 @@ caf::PdmFieldHandle* RimEclipseWell::objectToggleField()
|
||||
return &showWell;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::calculateWellPipeVisibility(size_t frameIndex)
|
||||
{
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if ( this->showWell() == false )
|
||||
return false;
|
||||
|
||||
if ( this->showWellPipes() == false )
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::calculateWellSphereVisibility(size_t frameIndex)
|
||||
{
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if (this->showWell() == false)
|
||||
return false;
|
||||
|
||||
if (this->showWellSpheres() == false)
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -326,7 +226,99 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::isWellPipeVisible(size_t frameIndex)
|
||||
{
|
||||
return calculateWellPipeVisibility(frameIndex);
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if (this->showWell() == false)
|
||||
return false;
|
||||
|
||||
if (this->showWellPipes() == false)
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellPipeVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseWell::isWellSpheresVisible(size_t frameIndex)
|
||||
{
|
||||
if (m_reservoirView == NULL) return false;
|
||||
if (this->wellResults() == NULL) return false;
|
||||
|
||||
if (frameIndex >= this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex.size())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t wellTimeStepIndex = this->wellResults()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
|
||||
if (wellTimeStepIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_reservoirView->wellCollection()->isActive())
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_ON)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_FORCE_ALL_OFF)
|
||||
return false;
|
||||
|
||||
if (this->showWell() == false)
|
||||
return false;
|
||||
|
||||
if (this->showWellSpheres() == false)
|
||||
return false;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_INDIVIDUALLY)
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->crossSectionCollection()->hasActiveIntersectionForSimulationWell(this))
|
||||
return true;
|
||||
|
||||
if (m_reservoirView->wellCollection()->wellSphereVisibility() == RimEclipseWellCollection::PIPES_OPEN_IN_VISIBLE_CELLS)
|
||||
{
|
||||
return visibleCellsInstersectsWell(frameIndex);
|
||||
}
|
||||
|
||||
CVF_ASSERT(false); // Never end here. have you added new pipe visibility modes ?
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -53,13 +53,9 @@ public:
|
||||
size_t resultWellIndex() { return m_resultWellIndex; }
|
||||
|
||||
bool isWellPipeVisible(size_t frameIndex);
|
||||
bool isWellSpheresVisible(size_t frameIndex);
|
||||
|
||||
bool calculateWellPipeVisibility(size_t frameIndex);
|
||||
bool calculateWellSphereVisibility(size_t frameIndex);
|
||||
|
||||
bool visibleCellsInstersectsWell(size_t frameIndex);
|
||||
|
||||
//Trengs det en calculateWellGeometryVisibility??
|
||||
bool visibleCellsInstersectsWell(size_t frameIndex);
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||
virtual caf::PdmFieldHandle* objectToggleField();
|
||||
|
@ -346,8 +346,8 @@ void RimEclipseWellCollection::calculateWellGeometryVisibility(size_t frameIndex
|
||||
|
||||
for (size_t i = 0; i < wells().size(); ++i)
|
||||
{
|
||||
bool wellPipeVisible = wells[i]->calculateWellPipeVisibility(frameIndex);
|
||||
bool wellSphereVisible = wells[i]->calculateWellSphereVisibility(frameIndex);
|
||||
bool wellPipeVisible = wells[i]->isWellPipeVisible(frameIndex);
|
||||
bool wellSphereVisible = wells[i]->isWellSpheresVisible(frameIndex);
|
||||
|
||||
m_framesOfResultWellPipeVisibilities[frameIndex][wells[i]->resultWellIndex()] = wellPipeVisible || wellSphereVisible;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user