mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#641) Create user defined polyline by clicking on reservoir cells
This commit is contained in:
@@ -649,3 +649,20 @@ cvf::Color3f RiuViewer::computeContrastColor() const
|
||||
|
||||
return contrastColor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature)
|
||||
{
|
||||
CVF_ASSERT(m_viewerCommands);
|
||||
m_viewerCommands->setActiveUiCommandFeature(uiCommandFeature);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicCommandFeature* RiuViewer::activeUiCommandFeature() const
|
||||
{
|
||||
return m_viewerCommands->activeUiCommandFeature();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "cafMouseState.h"
|
||||
#include "cvfStructGrid.h"
|
||||
|
||||
class RicCommandFeature;
|
||||
class RimView;
|
||||
class RiuSimpleHistogramWidget;
|
||||
class RiuViewerCommands;
|
||||
@@ -88,6 +89,9 @@ public:
|
||||
|
||||
void setAxisLabels(const cvf::String& xLabel, const cvf::String& yLabel, const cvf::String& zLabel);
|
||||
|
||||
void setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature);
|
||||
RicCommandFeature* activeUiCommandFeature() const;
|
||||
|
||||
public slots:
|
||||
virtual void slotSetCurrentFrame(int frameIndex);
|
||||
virtual void slotEndAnimation();
|
||||
|
||||
@@ -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
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,6 +31,7 @@ class RimGeoMechView;
|
||||
class RimView;
|
||||
class RiuViewer;
|
||||
class RivCrossSectionSourceInfo;
|
||||
class RicCommandFeature;
|
||||
|
||||
class QMouseEvent;
|
||||
|
||||
@@ -54,6 +55,9 @@ public:
|
||||
|
||||
void findCellAndGridIndex(const RivCrossSectionSourceInfo* crossSectionSourceInfo, cvf::uint firstPartTriangleIndex, size_t* cellIndex, size_t* gridIndex);
|
||||
|
||||
void setActiveUiCommandFeature(RicCommandFeature* uiCommandFeature);
|
||||
RicCommandFeature* activeUiCommandFeature() const;
|
||||
|
||||
|
||||
private slots:
|
||||
void slotRangeFilterI();
|
||||
@@ -78,6 +82,8 @@ private:
|
||||
caf::PdmPointer<RimCrossSection> m_currentCrossSection;
|
||||
|
||||
QPointer<RiuViewer> m_viewer;
|
||||
|
||||
QPointer<RicCommandFeature> m_activeUiCommandFeature;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user