(#641) Create user defined polyline by clicking on reservoir cells

This commit is contained in:
Magne Sjaastad
2015-11-27 17:18:30 +01:00
parent 7cd4394102
commit bd2a65acb4
11 changed files with 462 additions and 19 deletions

View File

@@ -23,6 +23,7 @@
#include "RicGeoMechPropertyFilterNewExec.h"
#include "RicRangeFilterNewExec.h"
#include "CrossSectionCommands/RicNewPolylineCrossSectionFeature.h"
#include "CrossSectionCommands/RicNewSimWellCrossSectionFeature.h"
#include "CrossSectionCommands/RicNewWellPathCrossSectionFeature.h"
#include "WellLogCommands/RicNewWellLogCurveExtractionFeature.h"
@@ -277,6 +278,8 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
commandIds << "RicSetMasterViewFeature";
}
commandIds << "RicNewPolylineCrossSectionFeature";
RimContextCommandBuilder::appendCommandsToMenu(commandIds, &menu);
if (menu.actions().size() > 0)
@@ -439,6 +442,17 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
if (m_viewer->rayPick(winPosX, winPosY, &hitItems))
{
extractIntersectionData(hitItems, &localIntersectionPoint, &firstHitPart, &firstPartTriangleIndex, &firstNncHitPart, &nncPartTriangleIndex);
if (!m_activeUiCommandFeature.isNull())
{
cvf::ref<RicPolylineUiEvent> uiEventObj = new RicPolylineUiEvent(localIntersectionPoint);
if (m_activeUiCommandFeature->handleUiEvent(uiEventObj.p()))
{
return;
}
}
updateSelectionFromPickedPart(firstHitPart);
}
@@ -564,6 +578,22 @@ void RiuViewerCommands::findCellAndGridIndex(const RivCrossSectionSourceInfo* cr
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewerCommands::setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature)
{
m_activeUiCommandFeature = uiCommandFeature;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicCommandFeature* RiuViewerCommands::activeUiCommandFeature() const
{
return m_activeUiCommandFeature;
}
//--------------------------------------------------------------------------------------------------
/// Perform picking and return the index of the face that was hit, if a drawable geo was hit
//--------------------------------------------------------------------------------------------------