#1038 - pre-proto - added calculation of measured depth along well path when creating new well path fracture in 3D view

This commit is contained in:
astridkbjorke committed 2016-12-21 13:40:53 +01:00
1 parent d6b3fad85e
commit 46e4815f9a
5 files changed
+98 -17

No files matched your search

@@ -21,9 +21,11 @@
#include "RimEclipseView.h"
#include "RimGeoMechView.h"
#include "RimWellPath.h"
#include "RiuSelectionChangedHandler.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -63,6 +65,25 @@ void RiuSelectionManager::selectedItems(std::vector<RiuSelectionItem*>& items, i
items = s;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuSelectionItem* RiuSelectionManager::selectedItem(int role /*= RUI_APPLICATION_GLOBAL*/) const
{
const std::vector<RiuSelectionItem*>& s = m_selection[role];
if (s.size() == 1)
{
if (s[0])
{
return s[0];
}
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -181,3 +202,16 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem(RimGeoMechView* view,
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuWellPathSelectionItem::RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
const cvf::Vec3d& currentPickPositionInDomainCoords,
cvf::uint firstPartTriangleIndex)
: m_currentPickPositionInDomainCoords(currentPickPositionInDomainCoords),
m_wellpathSourceInfo(wellPathSourceInfo),
m_firstPartTriangleIndex(firstPartTriangleIndex)
{
}
@@ -28,11 +28,14 @@
#include <vector>
#include <assert.h>
#include <array>
#include "RivWellPathSourceInfo.h"
class RimEclipseView;
class RiuSelectionChangedHandler;
class RiuSelectionItem;
class RimGeoMechView;
class RimWellPath;
class RivWellPathSourceInfo;
//==================================================================================================
//
@@ -57,7 +60,13 @@ public:
// Returns selected items
// Selection manager owns the selection items
void selectedItems(std::vector<RiuSelectionItem*>& items, int role = RUI_APPLICATION_GLOBAL) const;
// Returns selected items
// Selection manager owns the selection items
RiuSelectionItem* selectedItem(int role = RUI_APPLICATION_GLOBAL) const;
// PdmUiItem* selectedItem(int role = SelectionManager::APPLICATION_GLOBAL);
// Append item to selected items
// SelectionManager takes ownership of the item
void appendItemToSelection(RiuSelectionItem* item, int role = RUI_APPLICATION_GLOBAL);
@@ -92,7 +101,8 @@ public:
enum RiuSelectionType
{
ECLIPSE_SELECTION_OBJECT,
GEOMECH_SELECTION_OBJECT
GEOMECH_SELECTION_OBJECT,
WELLPATH_SELECTION_OBJECT
};
public:
@@ -172,3 +182,28 @@ public:
cvf::Vec3d m_localIntersectionPoint;
};
//==================================================================================================
//
//
//
//==================================================================================================
class RiuWellPathSelectionItem : public RiuSelectionItem
{
public:
explicit RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
const cvf::Vec3d& currentPickPositionInDomainCoords,
cvf::uint firstPartTriangleIndex);
virtual ~RiuWellPathSelectionItem() {};
virtual RiuSelectionType type() const
{
return WELLPATH_SELECTION_OBJECT;
}
public:
const RivWellPathSourceInfo* m_wellpathSourceInfo;
cvf::Vec3d m_currentPickPositionInDomainCoords;
cvf::uint m_firstPartTriangleIndex;
};
@@ -293,12 +293,17 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
RimWellPath* wellPath = wellPathSourceInfo->wellPath();
if (wellPath)
{
caf::SelectionManager::instance()->setSelectedItem(wellPath);
RiuSelectionItem* selItem = new RiuWellPathSelectionItem(wellPathSourceInfo, m_currentPickPositionInDomainCoords, firstPartTriangleIndex);
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
commandIds << "RicNewWellPathCollFractureAtPosFeature";
//TODO: Update so these also use RiuWellPathSelectionItem
caf::SelectionManager::instance()->setSelectedItem(wellPath);
commandIds << "RicNewWellLogFileCurveFeature";
commandIds << "RicNewWellLogCurveExtractionFeature";
commandIds << "RicNewWellPathIntersectionFeature";
commandIds << "RicNewWellPathCollFractureAtPosFeature";
}
}
@@ -603,6 +608,8 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
if(intersectionHit) selItem = new RiuGeoMechSelectionItem(geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint, intersectionTriangleHit);
else selItem = new RiuGeoMechSelectionItem(geomView, gridIndex, cellIndex, curveColor, gmFace, localIntersectionPoint);
}
}
if (appendToSelection)
@@ -614,6 +621,7 @@ void RiuViewerCommands::handlePickAction(int winPosX, int winPosY, Qt::KeyboardM
RiuSelectionManager::instance()->setSelectedItem(selItem);
}
}
}
//--------------------------------------------------------------------------------------------------