Whitespace

This commit is contained in:
Magne Sjaastad 2019-01-02 14:41:17 +01:00
parent fe75265053
commit 8709734697

View File

@ -23,11 +23,11 @@
#include "RiaColorTables.h" #include "RiaColorTables.h"
#include "RiaDefines.h" #include "RiaDefines.h"
#include "MeasurementCommands/RicMeasurementPickEventHandler.h"
#include "RicContourMapPickEventHandler.h"
#include "RicEclipsePropertyFilterNewExec.h" #include "RicEclipsePropertyFilterNewExec.h"
#include "RicGeoMechPropertyFilterNewExec.h" #include "RicGeoMechPropertyFilterNewExec.h"
#include "RicPickEventHandler.h" #include "RicPickEventHandler.h"
#include "RicContourMapPickEventHandler.h"
#include "MeasurementCommands/RicMeasurementPickEventHandler.h"
#include "WellLogCommands/Ric3dWellLogCurvePickEventHandler.h" #include "WellLogCommands/Ric3dWellLogCurvePickEventHandler.h"
#include "WellPathCommands/RicIntersectionPickEventHandler.h" #include "WellPathCommands/RicIntersectionPickEventHandler.h"
#include "WellPathCommands/RicWellPathPickEventHandler.h" #include "WellPathCommands/RicWellPathPickEventHandler.h"
@ -60,21 +60,22 @@
#include "RimPerforationInterval.h" #include "RimPerforationInterval.h"
#include "RimSimWellInView.h" #include "RimSimWellInView.h"
#include "RimStimPlanFractureTemplate.h" #include "RimStimPlanFractureTemplate.h"
#include "RimTextAnnotation.h"
#include "RimViewController.h" #include "RimViewController.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimTextAnnotation.h"
#include "RiuMainWindow.h"
#include "RiuResultTextBuilder.h"
#include "Riu3dSelectionManager.h" #include "Riu3dSelectionManager.h"
#include "RiuViewer.h" #include "RiuMainWindow.h"
#include "RiuPickItemInfo.h" #include "RiuPickItemInfo.h"
#include "RiuResultTextBuilder.h"
#include "RiuViewer.h"
#include "RivFemPartGeometryGenerator.h" #include "RivFemPartGeometryGenerator.h"
#include "RivFemPickSourceInfo.h" #include "RivFemPickSourceInfo.h"
#include "RivIntersectionBoxSourceInfo.h" #include "RivIntersectionBoxSourceInfo.h"
#include "RivIntersectionSourceInfo.h" #include "RivIntersectionSourceInfo.h"
#include "RivObjectSourceInfo.h" #include "RivObjectSourceInfo.h"
#include "RivPartPriority.h"
#include "RivSimWellConnectionSourceInfo.h" #include "RivSimWellConnectionSourceInfo.h"
#include "RivSimWellPipeSourceInfo.h" #include "RivSimWellPipeSourceInfo.h"
#include "RivSourceInfo.h" #include "RivSourceInfo.h"
@ -82,24 +83,23 @@
#include "RivWellConnectionSourceInfo.h" #include "RivWellConnectionSourceInfo.h"
#include "RivWellFracturePartMgr.h" #include "RivWellFracturePartMgr.h"
#include "RivWellPathSourceInfo.h" #include "RivWellPathSourceInfo.h"
#include "RivPartPriority.h"
#include "cafCmdExecCommandManager.h" #include "cafCmdExecCommandManager.h"
#include "cafCmdFeatureManager.h" #include "cafCmdFeatureManager.h"
#include "cafCmdFeatureMenuBuilder.h" #include "cafCmdFeatureMenuBuilder.h"
#include "cafDisplayCoordTransform.h" #include "cafDisplayCoordTransform.h"
#include "cafOverlayScalarMapperLegend.h"
#include "cafPdmUiTreeView.h" #include "cafPdmUiTreeView.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
#include "cafOverlayScalarMapperLegend.h"
#include "cvfDrawableGeo.h" #include "cvfDrawableGeo.h"
#include "cvfDrawableText.h"
#include "cvfHitItemCollection.h" #include "cvfHitItemCollection.h"
#include "cvfOverlayAxisCross.h" #include "cvfOverlayAxisCross.h"
#include "cvfPart.h" #include "cvfPart.h"
#include "cvfTransform.h"
#include "cvfScene.h"
#include "cvfDrawableText.h"
#include "cvfRay.h" #include "cvfRay.h"
#include "cvfScene.h"
#include "cvfTransform.h"
#include <QMenu> #include <QMenu>
#include <QMouseEvent> #include <QMouseEvent>
@ -107,7 +107,6 @@
#include <array> #include <array>
//================================================================================================== //==================================================================================================
// //
// RiaViewerCommands // RiaViewerCommands
@ -139,10 +138,7 @@ RiuViewerCommands::RiuViewerCommands(RiuViewer* ownerViewer)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuViewerCommands::~RiuViewerCommands() RiuViewerCommands::~RiuViewerCommands() {}
{
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
@ -152,7 +148,6 @@ void RiuViewerCommands::setOwnerView(Rim3dView * owner)
m_reservoirView = owner; m_reservoirView = owner;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -226,8 +221,10 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
{ {
const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>(firstHitPart->sourceInfo()); const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>(firstHitPart->sourceInfo());
const RivFemPickSourceInfo* femSourceInfo = dynamic_cast<const RivFemPickSourceInfo*>(firstHitPart->sourceInfo()); const RivFemPickSourceInfo* femSourceInfo = dynamic_cast<const RivFemPickSourceInfo*>(firstHitPart->sourceInfo());
const RivIntersectionSourceInfo* crossSectionSourceInfo = dynamic_cast<const RivIntersectionSourceInfo*>(firstHitPart->sourceInfo()); const RivIntersectionSourceInfo* crossSectionSourceInfo =
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo = dynamic_cast<const RivIntersectionBoxSourceInfo*>(firstHitPart->sourceInfo()); dynamic_cast<const RivIntersectionSourceInfo*>(firstHitPart->sourceInfo());
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo =
dynamic_cast<const RivIntersectionBoxSourceInfo*>(firstHitPart->sourceInfo());
if (rivSourceInfo || femSourceInfo || crossSectionSourceInfo || intersectionBoxSourceInfo) if (rivSourceInfo || femSourceInfo || crossSectionSourceInfo || intersectionBoxSourceInfo)
{ {
@ -333,12 +330,12 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
menuBuilder.addSeparator(); menuBuilder.addSeparator();
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p()); RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(m_reservoirView.p());
if (eclipseView) if (eclipseView)
{ {
// Hide faults command // Hide faults command
const RigFault* fault = eclipseView->mainGrid()->findFaultFromCellIndexAndCellFace(m_currentCellIndex, m_currentFaceIndex); const RigFault* fault =
eclipseView->mainGrid()->findFaultFromCellIndexAndCellFace(m_currentCellIndex, m_currentFaceIndex);
if (fault) if (fault)
{ {
menuBuilder.addSeparator(); menuBuilder.addSeparator();
@ -350,7 +347,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
hideFaultList.push_back(currentCellIndex); hideFaultList.push_back(currentCellIndex);
hideFaultList.push_back(m_currentFaceIndex); hideFaultList.push_back(m_currentFaceIndex);
menuBuilder.addCmdFeatureWithUserData("RicEclipseHideFaultFeature", QString("Hide ") + faultName, hideFaultList); menuBuilder.addCmdFeatureWithUserData(
"RicEclipseHideFaultFeature", QString("Hide ") + faultName, hideFaultList);
} }
} }
} }
@ -371,8 +369,10 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
if (int2dView) pickedPositionInUTM = int2dView->transformToUtm(pickedPositionInUTM); if (int2dView) pickedPositionInUTM = int2dView->transformToUtm(pickedPositionInUTM);
double measuredDepth = wellPathSourceInfo->measuredDepth(firstPartTriangleIndex, pickedPositionInUTM); double measuredDepth = wellPathSourceInfo->measuredDepth(firstPartTriangleIndex, pickedPositionInUTM);
cvf::Vec3d closestPointOnCenterLine = wellPathSourceInfo->closestPointOnCenterLine(firstPartTriangleIndex, pickedPositionInUTM); cvf::Vec3d closestPointOnCenterLine =
RiuSelectionItem* selItem = new RiuWellPathSelectionItem(wellPathSourceInfo, closestPointOnCenterLine, measuredDepth); wellPathSourceInfo->closestPointOnCenterLine(firstPartTriangleIndex, pickedPositionInUTM);
RiuSelectionItem* selItem =
new RiuWellPathSelectionItem(wellPathSourceInfo, closestPointOnCenterLine, measuredDepth);
Riu3dSelectionManager::instance()->setSelectedItem(selItem, Riu3dSelectionManager::RUI_TEMPORARY); Riu3dSelectionManager::instance()->setSelectedItem(selItem, Riu3dSelectionManager::RUI_TEMPORARY);
} }
@ -421,7 +421,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
} }
} }
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivSimWellPipeSourceInfo*>(firstHitPart->sourceInfo()); const RivSimWellPipeSourceInfo* eclipseWellSourceInfo =
dynamic_cast<const RivSimWellPipeSourceInfo*>(firstHitPart->sourceInfo());
if (eclipseWellSourceInfo) if (eclipseWellSourceInfo)
{ {
RimSimWellInView* well = eclipseWellSourceInfo->well(); RimSimWellInView* well = eclipseWellSourceInfo->well();
@ -429,7 +430,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
{ {
caf::SelectionManager::instance()->setSelectedItem(well); caf::SelectionManager::instance()->setSelectedItem(well);
RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex()); RiuSelectionItem* selItem = new RiuSimWellSelectionItem(
eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex());
Riu3dSelectionManager::instance()->setSelectedItem(selItem, Riu3dSelectionManager::RUI_TEMPORARY); Riu3dSelectionManager::instance()->setSelectedItem(selItem, Riu3dSelectionManager::RUI_TEMPORARY);
menuBuilder << "RicNewWellLogCurveExtractionFeature"; menuBuilder << "RicNewWellLogCurveExtractionFeature";
@ -536,8 +538,7 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
if (pickItemInfos.size()) if (pickItemInfos.size())
{ {
Ric3DPickEvent viewerEventObject(pickItemInfos, Ric3DPickEvent viewerEventObject(pickItemInfos, m_reservoirView);
m_reservoirView);
if (sm_overridingPickHandler && sm_overridingPickHandler->handlePickEvent(viewerEventObject)) if (sm_overridingPickHandler && sm_overridingPickHandler->handlePickEvent(viewerEventObject))
{ {
@ -576,8 +577,10 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
if (pickItemInfos.size()) if (pickItemInfos.size())
{ {
size_t indexToFirstNoneNncItem = cvf::UNDEFINED_SIZE_T;; size_t indexToFirstNoneNncItem = cvf::UNDEFINED_SIZE_T;
size_t indexToNncItemNearFirstItem = cvf::UNDEFINED_SIZE_T;; ;
size_t indexToNncItemNearFirstItem = cvf::UNDEFINED_SIZE_T;
;
findFirstItems(pickItemInfos, &indexToFirstNoneNncItem, &indexToNncItemNearFirstItem); findFirstItems(pickItemInfos, &indexToFirstNoneNncItem, &indexToNncItemNearFirstItem);
@ -613,10 +616,14 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
const RivObjectSourceInfo* rivObjectSourceInfo = dynamic_cast<const RivObjectSourceInfo*>(firstHitPart->sourceInfo()); const RivObjectSourceInfo* rivObjectSourceInfo = dynamic_cast<const RivObjectSourceInfo*>(firstHitPart->sourceInfo());
const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>(firstHitPart->sourceInfo()); const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>(firstHitPart->sourceInfo());
const RivFemPickSourceInfo* femSourceInfo = dynamic_cast<const RivFemPickSourceInfo*>(firstHitPart->sourceInfo()); const RivFemPickSourceInfo* femSourceInfo = dynamic_cast<const RivFemPickSourceInfo*>(firstHitPart->sourceInfo());
const RivIntersectionSourceInfo* crossSectionSourceInfo = dynamic_cast<const RivIntersectionSourceInfo*>(firstHitPart->sourceInfo()); const RivIntersectionSourceInfo* crossSectionSourceInfo =
const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo = dynamic_cast<const RivIntersectionBoxSourceInfo*>(firstHitPart->sourceInfo()); dynamic_cast<const RivIntersectionSourceInfo*>(firstHitPart->sourceInfo());
const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = dynamic_cast<const RivSimWellPipeSourceInfo*>(firstHitPart->sourceInfo()); const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo =
const RivWellConnectionSourceInfo* wellConnectionSourceInfo = dynamic_cast<const RivWellConnectionSourceInfo*>(firstHitPart->sourceInfo()); 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) if (rivObjectSourceInfo)
{ {
@ -634,7 +641,8 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
{ {
auto selectedFractureTemplate = dynamic_cast<RimFractureTemplate*>(uiItems[0]); auto selectedFractureTemplate = dynamic_cast<RimFractureTemplate*>(uiItems[0]);
if ( selectedFractureTemplate != nullptr && selectedFractureTemplate == fracture->fractureTemplate() ) if (selectedFractureTemplate != nullptr &&
selectedFractureTemplate == fracture->fractureTemplate())
{ {
blockSelectionOfFracture = true; blockSelectionOfFracture = true;
} }
@ -647,9 +655,10 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
} }
} }
RimStimPlanFractureTemplate* stimPlanTempl =
RimStimPlanFractureTemplate* stimPlanTempl = fracture ? dynamic_cast<RimStimPlanFractureTemplate*>(fracture->fractureTemplate()) : nullptr; fracture ? dynamic_cast<RimStimPlanFractureTemplate*>(fracture->fractureTemplate()) : nullptr;
RimEllipseFractureTemplate* ellipseTempl = fracture ? dynamic_cast<RimEllipseFractureTemplate*>(fracture->fractureTemplate()) : nullptr; RimEllipseFractureTemplate* ellipseTempl =
fracture ? dynamic_cast<RimEllipseFractureTemplate*>(fracture->fractureTemplate()) : nullptr;
if (stimPlanTempl || ellipseTempl) if (stimPlanTempl || ellipseTempl)
{ {
// Set fracture resultInfo text // Set fracture resultInfo text
@ -665,7 +674,10 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
// Set intersection point result text // Set intersection point result text
QString intersectionPointText; QString intersectionPointText;
intersectionPointText.sprintf("Intersection point : Global [E: %.2f, N: %.2f, Depth: %.2f]", domainCoord.x(), domainCoord.y(), -domainCoord.z()); intersectionPointText.sprintf("Intersection point : Global [E: %.2f, N: %.2f, Depth: %.2f]",
domainCoord.x(),
domainCoord.y(),
-domainCoord.z());
resultInfoText.append(intersectionPointText); resultInfoText.append(intersectionPointText);
// Display result info text // Display result info text
@ -696,7 +708,6 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
gridIndex = femSourceInfo->femPartIndex(); gridIndex = femSourceInfo->femPartIndex();
cellIndex = femSourceInfo->triangleToElmMapper()->elementIndex(firstPartTriangleIndex); cellIndex = femSourceInfo->triangleToElmMapper()->elementIndex(firstPartTriangleIndex);
gmFace = femSourceInfo->triangleToElmMapper()->elementFace(firstPartTriangleIndex); gmFace = femSourceInfo->triangleToElmMapper()->elementFace(firstPartTriangleIndex);
} }
else if (crossSectionSourceInfo) else if (crossSectionSourceInfo)
{ {
@ -715,7 +726,6 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
intersectionTriangleHit = intersectionBoxSourceInfo->triangle(firstPartTriangleIndex); intersectionTriangleHit = intersectionBoxSourceInfo->triangle(firstPartTriangleIndex);
RiuMainWindow::instance()->selectAsCurrentItem(intersectionBoxSourceInfo->intersectionBox()); RiuMainWindow::instance()->selectAsCurrentItem(intersectionBoxSourceInfo->intersectionBox());
} }
else if (eclipseWellSourceInfo) else if (eclipseWellSourceInfo)
{ {
@ -743,7 +753,8 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
auto connectionFactors = eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities(); auto connectionFactors = eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities();
size_t timeStep = eclipseView->currentTimeStep(); size_t timeStep = eclipseView->currentTimeStep();
const auto& multipleCompletions = connectionFactors->multipleCompletionsPerEclipseCell(wellConnectionSourceInfo->wellPath(), timeStep); const auto& multipleCompletions = connectionFactors->multipleCompletionsPerEclipseCell(
wellConnectionSourceInfo->wellPath(), timeStep);
auto completionDataIt = multipleCompletions.find(globalCellIndex); auto completionDataIt = multipleCompletions.find(globalCellIndex);
if (completionDataIt != multipleCompletions.end()) if (completionDataIt != multipleCompletions.end())
@ -761,7 +772,8 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
} }
QString resultInfoText; QString resultInfoText;
resultInfoText += QString("<b>Well Connection Factor :</b> %1<br><br>").arg(aggregatedConnectionFactor); resultInfoText +=
QString("<b>Well Connection Factor :</b> %1<br><br>").arg(aggregatedConnectionFactor);
{ {
RiuResultTextBuilder textBuilder(eclipseView, globalCellIndex, eclipseView->currentTimeStep()); RiuResultTextBuilder textBuilder(eclipseView, globalCellIndex, eclipseView->currentTimeStep());
@ -775,7 +787,9 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
{ {
for (const auto& metaData : completionData.metadata()) for (const auto& metaData : completionData.metadata())
{ {
resultInfoText += QString("<b>Name</b> %1 <b>Description</b> %2 <br>").arg(metaData.name).arg(metaData.comment); resultInfoText += QString("<b>Name</b> %1 <b>Description</b> %2 <br>")
.arg(metaData.name)
.arg(metaData.comment);
} }
} }
@ -788,7 +802,8 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
} }
else if (dynamic_cast<const RivSimWellConnectionSourceInfo*>(firstHitPart->sourceInfo())) else if (dynamic_cast<const RivSimWellConnectionSourceInfo*>(firstHitPart->sourceInfo()))
{ {
const RivSimWellConnectionSourceInfo* simWellConnectionSourceInfo = dynamic_cast<const RivSimWellConnectionSourceInfo*>(firstHitPart->sourceInfo()); const RivSimWellConnectionSourceInfo* simWellConnectionSourceInfo =
dynamic_cast<const RivSimWellConnectionSourceInfo*>(firstHitPart->sourceInfo());
bool allowActiveViewChange = dynamic_cast<Rim2dIntersectionView*>(m_viewer->ownerViewWindow()) == nullptr; bool allowActiveViewChange = dynamic_cast<Rim2dIntersectionView*>(m_viewer->ownerViewWindow()) == nullptr;
@ -801,23 +816,25 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
RimEclipseCase* eclipseCase = nullptr; RimEclipseCase* eclipseCase = nullptr;
eclipseView->firstAncestorOrThisOfTypeAsserted(eclipseCase); eclipseView->firstAncestorOrThisOfTypeAsserted(eclipseCase);
if (eclipseCase->eclipseCaseData() && if (eclipseCase->eclipseCaseData() && eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities())
eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities())
{ {
auto connectionFactors = eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities(); auto connectionFactors = eclipseCase->eclipseCaseData()->virtualPerforationTransmissibilities();
size_t timeStep = eclipseView->currentTimeStep(); size_t timeStep = eclipseView->currentTimeStep();
const auto& completionData = connectionFactors->completionsForSimWell(simWellConnectionSourceInfo->simWellInView()->simWellData(), timeStep); const auto& completionData = connectionFactors->completionsForSimWell(
simWellConnectionSourceInfo->simWellInView()->simWellData(), timeStep);
for (const auto& compData : completionData) for (const auto& compData : completionData)
{ {
if (compData.completionDataGridCell().globalCellIndex() == globalCellIndex) if (compData.completionDataGridCell().globalCellIndex() == globalCellIndex)
{ {
{ {
QString resultInfoText = QString("<b>Simulation Well Connection Factor :</b> %1<br><br>").arg(connectionFactor); QString resultInfoText =
QString("<b>Simulation Well Connection Factor :</b> %1<br><br>").arg(connectionFactor);
{ {
RiuResultTextBuilder textBuilder(eclipseView, globalCellIndex, eclipseView->currentTimeStep()); RiuResultTextBuilder textBuilder(
eclipseView, globalCellIndex, eclipseView->currentTimeStep());
resultInfoText += textBuilder.geometrySelectionText("<br>"); resultInfoText += textBuilder.geometrySelectionText("<br>");
} }
@ -829,9 +846,9 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
} }
} }
} }
} }
RiuMainWindow::instance()->selectAsCurrentItem(simWellConnectionSourceInfo->simWellInView(), allowActiveViewChange); RiuMainWindow::instance()->selectAsCurrentItem(simWellConnectionSourceInfo->simWellInView(),
allowActiveViewChange);
} }
} }
} }
@ -874,13 +891,18 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
if (eclipseView) if (eclipseView)
{ {
selItem = new RiuEclipseSelectionItem(eclipseView, gridIndex, cellIndex, nncIndex, curveColor, face, localIntersectionPoint); selItem = new RiuEclipseSelectionItem(
eclipseView, gridIndex, cellIndex, nncIndex, curveColor, face, localIntersectionPoint);
} }
if (geomView) if (geomView)
{ {
if(intersectionHit) selItem = new RiuGeoMechSelectionItem(geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint, intersectionTriangleHit); if (intersectionHit)
else selItem = new RiuGeoMechSelectionItem(geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint); selItem = new RiuGeoMechSelectionItem(
geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint, intersectionTriangleHit);
else
selItem =
new RiuGeoMechSelectionItem(geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint);
} }
if (intersectionView) selItem = new Riu2dIntersectionSelectionItem(intersectionView, selItem); if (intersectionView) selItem = new Riu2dIntersectionSelectionItem(intersectionView, selItem);
@ -895,7 +917,6 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
Riu3dSelectionManager::instance()->setSelectedItem(selItem); Riu3dSelectionManager::instance()->setSelectedItem(selItem);
} }
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -958,7 +979,10 @@ void RiuViewerCommands::removeDefaultPickEventHandler(RicDefaultPickEventHandler
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionSourceInfo* crossSectionSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex) void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionSourceInfo* crossSectionSourceInfo,
cvf::uint firstPartTriangleIndex,
size_t* cellIndex,
size_t* gridIndex)
{ {
CVF_ASSERT(cellIndex && gridIndex); CVF_ASSERT(cellIndex && gridIndex);
@ -985,7 +1009,10 @@ void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionSourceInfo* cr
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex) void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionBoxSourceInfo* intersectionBoxSourceInfo,
cvf::uint firstPartTriangleIndex,
size_t* cellIndex,
size_t* gridIndex)
{ {
CVF_ASSERT(cellIndex && gridIndex); CVF_ASSERT(cellIndex && gridIndex);
@ -1006,7 +1033,6 @@ void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionBoxSourceInfo*
} }
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1048,7 +1074,8 @@ void RiuViewerCommands::findFirstItems(const std::vector<RiuPickItemInfo> & pick
{ {
if (nncNearFirstItemIndex == cvf::UNDEFINED_SIZE_T && canFindRelvantNNC) if (nncNearFirstItemIndex == cvf::UNDEFINED_SIZE_T && canFindRelvantNNC)
{ {
cvf::Vec3d distFirstNonNNCToCandidate = firstOrFirstNonNncIntersectionPoint - pickItemInfos[i].globalPickedPoint(); cvf::Vec3d distFirstNonNNCToCandidate =
firstOrFirstNonNncIntersectionPoint - pickItemInfos[i].globalPickedPoint();
// This candidate is an NNC hit // This candidate is an NNC hit
if (distFirstNonNNCToCandidate.lengthSquared() < pickDepthThresholdSquared) if (distFirstNonNNCToCandidate.lengthSquared() < pickDepthThresholdSquared)
@ -1069,7 +1096,8 @@ void RiuViewerCommands::findFirstItems(const std::vector<RiuPickItemInfo> & pick
} }
} }
if (firstNonNncHitIndex != cvf::UNDEFINED_SIZE_T && (nncNearFirstItemIndex != cvf::UNDEFINED_SIZE_T || !canFindRelvantNNC) ) if (firstNonNncHitIndex != cvf::UNDEFINED_SIZE_T &&
(nncNearFirstItemIndex != cvf::UNDEFINED_SIZE_T || !canFindRelvantNNC))
{ {
break; // Found what can be found break; // Found what can be found
} }
@ -1169,4 +1197,3 @@ void RiuViewerCommands::handleTextPicking(int winPosX, int winPosY, cvf::HitItem
hitItems->sort(); hitItems->sort();
} }