#2600 Well CF Visualization: Add picking on connection factor objects

This commit is contained in:
Magne Sjaastad
2018-03-16 15:33:57 +01:00
parent 9656883c92
commit 7bb705b1b7
2 changed files with 62 additions and 1 deletions

View File

@@ -154,6 +154,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createPipeS
RivWellConnectionFactorGeometryGenerator::createStarGeometry(
&verticesForOneObject, &indicesForOneObject, m_radius, m_radius * 0.3f);
m_trianglesPerConnection = indicesForOneObject.size() / 3;
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray;
cvf::ref<cvf::UIntArray> indices = new cvf::UIntArray;
@@ -195,6 +197,8 @@ cvf::ref<cvf::DrawableGeo> RivWellConnectionFactorGeometryGenerator::createPipeS
//--------------------------------------------------------------------------------------------------
size_t RivWellConnectionFactorGeometryGenerator::globalCellIndexFromTriangleIndex(cvf::uint triangleIndex) const
{
if (m_trianglesPerConnection == 0) return 0;
size_t connectionIndex = triangleIndex / m_trianglesPerConnection;
return m_centerColorPairs[connectionIndex].m_globalCellIndex;

View File

@@ -34,6 +34,7 @@
#include "RigFemPartGrid.h"
#include "RigGeoMechCaseData.h"
#include "RigMainGrid.h"
#include "RigVirtualPerforationTransmissibilities.h"
#include "RiaDefines.h"
#include "RimCellEdgeColors.h"
@@ -72,8 +73,9 @@
#include "RivSimWellPipeSourceInfo.h"
#include "RivSourceInfo.h"
#include "RivTernarySaturationOverlayItem.h"
#include "RivWellPathSourceInfo.h"
#include "RivWellConnectionSourceInfo.h"
#include "RivWellFracturePartMgr.h"
#include "RivWellPathSourceInfo.h"
#include "cafCmdExecCommandManager.h"
#include "cafCmdFeatureManager.h"
@@ -528,6 +530,7 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
const RivIntersectionSourceInfo* crossSectionSourceInfo = dynamic_cast<const RivIntersectionSourceInfo*>(firstHitPart->sourceInfo());
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo = dynamic_cast<const RivIntersectionBoxSourceInfo*>(firstHitPart->sourceInfo());
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivSimWellPipeSourceInfo*>(firstHitPart->sourceInfo());
const RivWellConnectionSourceInfo* wellConnectionSourceInfo = dynamic_cast<const RivWellConnectionSourceInfo*>(firstHitPart->sourceInfo());
if (rivObjectSourceInfo)
{
@@ -626,6 +629,60 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
RiuMainWindow::instance()->selectAsCurrentItem(eclipseWellSourceInfo->well(), allowActiveViewChange);
}
else if (wellConnectionSourceInfo)
{
bool allowActiveViewChange = dynamic_cast<Rim2dIntersectionView*>(m_viewer->ownerViewWindow()) == nullptr;
size_t globalCellIndex = wellConnectionSourceInfo->globalCellIndexFromTriangleIndex(firstPartTriangleIndex);
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
if (eclipseView)
{
RimEclipseCase* eclipseCase = nullptr;
eclipseView->firstAncestorOrThisOfTypeAsserted(eclipseCase);
if (eclipseCase->eclipseCaseData() && eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities())
{
auto connectionFactors = eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities();
size_t timeStep = eclipseView->currentTimeStep();
const auto& completionData = connectionFactors->multipleCompletionsPerEclipseCell(wellConnectionSourceInfo->wellPath(), timeStep);
for (const auto& compData : completionData)
{
if (compData.first.globalCellIndex() == globalCellIndex)
{
auto completionDataItems = compData.second;
if (!completionDataItems.empty())
{
QString resultInfoText;
// For now, only report the fist completion and not the combined completion if more than one
// completion contributes into a cell
resultInfoText += QString("Well Connection Factor : %1").arg(completionDataItems[0].transmissibility());
resultInfoText += "<br><br>Details : <br>";
for (const auto& completionData : completionDataItems)
{
for (const auto& metaData : completionData.metadata())
{
resultInfoText += QString("<b>Name</b> %1 <b>Description</b> %2 <br>").arg(metaData.name).arg(metaData.comment);
}
}
RiuMainWindow::instance()->setResultInfo(resultInfoText);
}
break;
}
}
}
}
RiuMainWindow::instance()->selectAsCurrentItem(wellConnectionSourceInfo->wellPath(), allowActiveViewChange);
}
}
if (firstNncHitPart && firstNncHitPart->sourceInfo())