mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1044 - pre-proto - Added function for creating new sim well fracture, not yet setting correct i j k
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RiuSelectionManager.h"
|
||||
#include "RivWellPipeSourceInfo.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtPosFeature");
|
||||
@@ -40,8 +42,43 @@ CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtP
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
// Not yet implemented
|
||||
// Infrastructure is missing for being able to obtain i j and k when right-clicking
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return;
|
||||
|
||||
|
||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
RiuSimWellSelectionItem* simWellItem = nullptr;
|
||||
if (selItem->type() == RiuSelectionItem::SIMWELL_SELECTION_OBJECT)
|
||||
{
|
||||
simWellItem = static_cast<RiuSimWellSelectionItem*>(selItem);
|
||||
if (!simWellItem) return;
|
||||
}
|
||||
|
||||
const RivEclipseWellSourceInfo* simwellSourceInfo = simWellItem->m_simwellSourceInfo;
|
||||
RimEclipseWell* simWell = simwellSourceInfo->well();
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(simWell);
|
||||
if (!objHandle) return;
|
||||
|
||||
RimEclipseWell* simWellObject = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(simWellObject);
|
||||
if (!simWellObject) return;
|
||||
|
||||
RimSimWellFractureCollection* fractureCollection = simWellObject->simwellFractureCollection();
|
||||
if (!fractureCollection) return;
|
||||
|
||||
RimSimWellFracture* fracture = new RimSimWellFracture();
|
||||
fractureCollection->simwellFractures.push_back(fracture);
|
||||
|
||||
fracture->name = "New SimWell Fracture";
|
||||
|
||||
fracture->i = static_cast<int>(simWellItem->i);
|
||||
fracture->j = static_cast<int>(simWellItem->j);
|
||||
fracture->k = static_cast<int>(simWellItem->k);
|
||||
|
||||
fractureCollection->updateConnectedEditors();
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "RiuSelectionManager.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
caf::PdmField<QString> name;
|
||||
caf::PdmPtrField<RimFractureDefinition* > fractureDefinition;
|
||||
|
||||
size_t gridindex;
|
||||
caf::PdmField<int> i;
|
||||
caf::PdmField<int> j;
|
||||
caf::PdmField<int> k;
|
||||
|
||||
@@ -215,3 +215,18 @@ RiuWellPathSelectionItem::RiuWellPathSelectionItem(const RivWellPathSourceInfo*
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuSimWellSelectionItem::RiuSimWellSelectionItem(const RivEclipseWellSourceInfo* simwellSourceInfo,
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k)
|
||||
: m_simwellSourceInfo(simwellSourceInfo),
|
||||
i(i),
|
||||
j(j),
|
||||
k(k)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <array>
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
// #include "RivWellPathSourceInfo.h"
|
||||
// #include "RivWellPipeSourceInfo.h"
|
||||
|
||||
class RimEclipseView;
|
||||
class RiuSelectionChangedHandler;
|
||||
@@ -36,6 +37,7 @@ class RiuSelectionItem;
|
||||
class RimGeoMechView;
|
||||
class RimWellPath;
|
||||
class RivWellPathSourceInfo;
|
||||
class RivEclipseWellSourceInfo;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@@ -102,7 +104,8 @@ public:
|
||||
{
|
||||
ECLIPSE_SELECTION_OBJECT,
|
||||
GEOMECH_SELECTION_OBJECT,
|
||||
WELLPATH_SELECTION_OBJECT
|
||||
WELLPATH_SELECTION_OBJECT,
|
||||
SIMWELL_SELECTION_OBJECT
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -207,3 +210,32 @@ public:
|
||||
cvf::Vec3d m_currentPickPositionInDomainCoords;
|
||||
cvf::uint m_firstPartTriangleIndex;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RiuSimWellSelectionItem : public RiuSelectionItem
|
||||
{
|
||||
public:
|
||||
explicit RiuSimWellSelectionItem(const RivEclipseWellSourceInfo* simwellSourceInfo,
|
||||
size_t i, size_t j, size_t k);
|
||||
|
||||
|
||||
virtual ~RiuSimWellSelectionItem() {};
|
||||
|
||||
virtual RiuSelectionType type() const
|
||||
{
|
||||
return SIMWELL_SELECTION_OBJECT;
|
||||
}
|
||||
|
||||
public:
|
||||
caf::PdmPointer<RimEclipseView> m_view;
|
||||
const RivEclipseWellSourceInfo* m_simwellSourceInfo;
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k;
|
||||
};
|
||||
|
||||
@@ -314,8 +314,15 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
if (well)
|
||||
{
|
||||
caf::SelectionManager::instance()->setSelectedItem(well);
|
||||
|
||||
commandIds << "RicNewSimWellIntersectionFeature";
|
||||
|
||||
|
||||
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
size_t k = 0;
|
||||
RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo, i, j, k);
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
commandIds << "RicNewSimWellFractureAtPosFeature";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user