mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-27 08:47:00 -06:00
#1044 - pre-proto - Updating indexing for i j and k in SimWellFracture to follow Eclipse indexing (starting with 1) and updating depth of z position at wellpath for WellPathFractures to be displayed as positive
This commit is contained in:
parent
a5e8001745
commit
6b58adb91b
@ -45,7 +45,6 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
if (!activeView) return;
|
||||
|
||||
|
||||
RiuSelectionManager* riuSelManager = RiuSelectionManager::instance();
|
||||
RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
@ -56,8 +55,7 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
if (!simWellItem) return;
|
||||
}
|
||||
|
||||
const RivSimWellPipeSourceInfo* simwellSourceInfo = simWellItem->m_simwellSourceInfo;
|
||||
RimEclipseWell* simWell = simwellSourceInfo->well();
|
||||
RimEclipseWell* simWell = simWellItem->m_simWell;
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(simWell);
|
||||
if (!objHandle) return;
|
||||
|
||||
@ -72,13 +70,9 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
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);
|
||||
fracture->setijk(simWellItem->i, simWellItem->j, simWellItem->k);
|
||||
|
||||
fractureCollection->updateConnectedEditors();
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -63,8 +63,7 @@ void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
if (!wellPathItem) return;
|
||||
}
|
||||
|
||||
const RivWellPathSourceInfo* wellpathSourceInfo = wellPathItem->m_wellpathSourceInfo;
|
||||
RimWellPath* wellPath = wellpathSourceInfo->wellPath();
|
||||
RimWellPath* wellPath = wellPathItem->m_wellpath;
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(wellPath);
|
||||
if (!objHandle) return;
|
||||
|
||||
@ -78,10 +77,8 @@ void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
fractureCollection->fractures.push_back(fracture);
|
||||
|
||||
fracture->name = "New Well Path Fracture";
|
||||
fracture->positionAtWellpath = wellPathItem->m_currentPickPositionInDomainCoords;
|
||||
|
||||
double measuredDepth = wellpathSourceInfo->measuredDepth(wellPathItem->m_firstPartTriangleIndex, wellPathItem->m_currentPickPositionInDomainCoords);
|
||||
fracture->measuredDepth = measuredDepth;
|
||||
fracture->positionAtWellpath = wellPathItem->m_pipeCenterlineIntersectionInDomainCoords;
|
||||
fracture->measuredDepth = wellPathItem->m_measuredDepth;
|
||||
fractureCollection->updateConnectedEditors();
|
||||
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ RimSimWellFracture::RimSimWellFracture(void)
|
||||
CAF_PDM_InitObject("SimWellFracture", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&name, "UserDescription", QString("Fracture Name"), "Name", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&i, "I", 1, "Fracture location cell I", "", "", "");
|
||||
CAF_PDM_InitField(&j, "J", 1, "Fracture location cell J", "", "", "");
|
||||
CAF_PDM_InitField(&k, "K", 1, "Fracture location cell K", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_i, "I", 1, "Fracture location cell I", "", "", "");
|
||||
CAF_PDM_InitField(&m_j, "J", 1, "Fracture location cell J", "", "", "");
|
||||
CAF_PDM_InitField(&m_k, "K", 1, "Fracture location cell K", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&fractureDefinition, "FractureDef", "FractureDef", "", "", "");
|
||||
|
||||
@ -111,6 +111,17 @@ RimFractureDefinition* RimSimWellFracture::attachedFractureDefinition()
|
||||
return fractureDefinition();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSimWellFracture::setijk(size_t i, size_t j, size_t k)
|
||||
{
|
||||
m_i = static_cast<int>(i + 1);
|
||||
m_j = static_cast<int>(j + 1);
|
||||
m_k = static_cast<int>(k + 1);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -121,9 +132,9 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
|
||||
caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup("Fractures");
|
||||
geometryGroup->add(&fractureDefinition);
|
||||
|
||||
geometryGroup->add(&i);
|
||||
geometryGroup->add(&j);
|
||||
geometryGroup->add(&k);
|
||||
geometryGroup->add(&m_i);
|
||||
geometryGroup->add(&m_j);
|
||||
geometryGroup->add(&m_k);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
|
||||
|
@ -45,12 +45,8 @@ public:
|
||||
caf::PdmPtrField<RimFractureDefinition* > fractureDefinition;
|
||||
|
||||
size_t gridindex;
|
||||
caf::PdmField<int> i;
|
||||
caf::PdmField<int> j;
|
||||
caf::PdmField<int> k;
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
void setijk(size_t i, size_t j, size_t k);
|
||||
|
||||
|
||||
// Overrides from RimFracture
|
||||
@ -60,6 +56,11 @@ public:
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
private:
|
||||
caf::PdmField<int> m_i; //Eclipse indexing, lowest value is 1
|
||||
caf::PdmField<int> m_j;
|
||||
caf::PdmField<int> m_k;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
@ -51,6 +51,12 @@ RimWellPathFracture::RimWellPathFracture(void)
|
||||
CAF_PDM_InitField( &measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location (if along well path)", "", "", "");
|
||||
CAF_PDM_InitField( &positionAtWellpath, "PositionAtWellpath", cvf::Vec3d::ZERO, "Fracture Position at Well Path", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&ui_positionAtWellpath, "ui_positionAtWellpath", "Fracture Position at Well Path", "", "", "");
|
||||
ui_positionAtWellpath.registerGetMethod(this, &RimWellPathFracture::wellPositionForUi);
|
||||
ui_positionAtWellpath.registerSetMethod(this, &RimWellPathFracture::setWellPositionFromUi);
|
||||
ui_positionAtWellpath.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
|
||||
CAF_PDM_InitField(&i, "I", 1, "Fracture location cell I", "", "", "");
|
||||
CAF_PDM_InitField(&j, "J", 1, "Fracture location cell J", "", "", "");
|
||||
CAF_PDM_InitField(&k, "K", 1, "Fracture location cell K", "", "", "");
|
||||
@ -125,8 +131,32 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
geometryGroup->add(&fractureDefinition);
|
||||
|
||||
geometryGroup->add(&measuredDepth);
|
||||
geometryGroup->add(&positionAtWellpath);
|
||||
geometryGroup->add(&ui_positionAtWellpath);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimWellPathFracture::wellPositionForUi() const
|
||||
{
|
||||
cvf::Vec3d v = positionAtWellpath();
|
||||
|
||||
v.z() = -v.z();
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFracture::setWellPositionFromUi(const cvf::Vec3d& vec)
|
||||
{
|
||||
cvf::Vec3d v = vec;
|
||||
|
||||
v.z() = -v.z();
|
||||
|
||||
positionAtWellpath = v;
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include "cafPdmProxyValueField.h"
|
||||
|
||||
class RimFractureDefinition;
|
||||
class RimWellPath;
|
||||
|
||||
@ -50,6 +52,9 @@ public:
|
||||
caf::PdmField<float> measuredDepth;
|
||||
caf::PdmField<cvf::Vec3d> positionAtWellpath;
|
||||
|
||||
caf::PdmProxyValueField<cvf::Vec3d> ui_positionAtWellpath;
|
||||
|
||||
|
||||
caf::PdmField<int> i;
|
||||
caf::PdmField<int> j;
|
||||
caf::PdmField<int> k;
|
||||
@ -66,5 +71,8 @@ protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
|
||||
private:
|
||||
cvf::Vec3d wellPositionForUi() const;
|
||||
void setWellPositionFromUi(const cvf::Vec3d& vec);
|
||||
|
||||
};
|
||||
|
@ -23,6 +23,9 @@
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RivSimWellPipeSourceInfo.h"
|
||||
#include "RivWellPathSourceInfo.h"
|
||||
|
||||
#include "RiuSelectionChangedHandler.h"
|
||||
|
||||
|
||||
@ -207,13 +210,12 @@ 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)
|
||||
const cvf::Vec3d& pipeCenterLineIntersectionInDomainCoords,
|
||||
double measuredDepth)
|
||||
: m_pipeCenterlineIntersectionInDomainCoords(pipeCenterLineIntersectionInDomainCoords),
|
||||
m_measuredDepth(measuredDepth)
|
||||
{
|
||||
|
||||
m_wellpath = wellPathSourceInfo->wellPath();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -223,10 +225,9 @@ RiuSimWellSelectionItem::RiuSimWellSelectionItem(const RivSimWellPipeSourceInfo*
|
||||
size_t i,
|
||||
size_t j,
|
||||
size_t k)
|
||||
: m_simwellSourceInfo(simwellSourceInfo),
|
||||
i(i),
|
||||
: i(i),
|
||||
j(j),
|
||||
k(k)
|
||||
{
|
||||
|
||||
m_simWell = simwellSourceInfo->well();
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
#include <array>
|
||||
#include "RimEclipseWell.h"
|
||||
// #include "RivWellPathSourceInfo.h"
|
||||
// #include "RivWellPipeSourceInfo.h"
|
||||
|
||||
@ -196,7 +197,7 @@ class RiuWellPathSelectionItem : public RiuSelectionItem
|
||||
public:
|
||||
explicit RiuWellPathSelectionItem(const RivWellPathSourceInfo* wellPathSourceInfo,
|
||||
const cvf::Vec3d& currentPickPositionInDomainCoords,
|
||||
cvf::uint firstPartTriangleIndex);
|
||||
double measuredDepth);
|
||||
|
||||
virtual ~RiuWellPathSelectionItem() {};
|
||||
|
||||
@ -206,9 +207,9 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
const RivWellPathSourceInfo* m_wellpathSourceInfo;
|
||||
cvf::Vec3d m_currentPickPositionInDomainCoords;
|
||||
cvf::uint m_firstPartTriangleIndex;
|
||||
RimWellPath* m_wellpath;
|
||||
cvf::Vec3d m_pipeCenterlineIntersectionInDomainCoords;
|
||||
double m_measuredDepth;
|
||||
};
|
||||
|
||||
|
||||
@ -233,8 +234,8 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
caf::PdmPointer<RimEclipseView> m_view;
|
||||
const RivSimWellPipeSourceInfo* m_simwellSourceInfo;
|
||||
// const RivSimWellPipeSourceInfo* m_simwellSourceInfo;
|
||||
RimEclipseWell* m_simWell;
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k;
|
||||
|
@ -294,8 +294,11 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
if (wellPath)
|
||||
{
|
||||
|
||||
RiuSelectionItem* selItem = new RiuWellPathSelectionItem(wellPathSourceInfo, m_currentPickPositionInDomainCoords, firstPartTriangleIndex);
|
||||
double measuredDepth = wellPathSourceInfo->measuredDepth(firstPartTriangleIndex, m_currentPickPositionInDomainCoords);
|
||||
cvf::Vec3d trueVerticalDepth = wellPathSourceInfo->trueVerticalDepth(firstPartTriangleIndex, globalIntersectionPoint);
|
||||
RiuSelectionItem* selItem = new RiuWellPathSelectionItem(wellPathSourceInfo, trueVerticalDepth, measuredDepth);
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
|
||||
commandIds << "RicNewWellPathFractureAtPosFeature";
|
||||
|
||||
|
||||
@ -316,14 +319,23 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
|
||||
caf::SelectionManager::instance()->setSelectedItem(well);
|
||||
commandIds << "RicNewSimWellIntersectionFeature";
|
||||
|
||||
size_t gridIndex = cvf::UNDEFINED_SIZE_T;
|
||||
size_t gridCellIndex = cvf::UNDEFINED_SIZE_T;
|
||||
|
||||
eclipseWellSourceInfo->findGridIndexAndCellIndex(firstPartTriangleIndex, &gridIndex, &gridCellIndex);
|
||||
|
||||
if (gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
size_t k = 0;
|
||||
ijkFromCellIndex(gridIndex, gridCellIndex, &i, &j, &k);
|
||||
|
||||
RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo, i, j, k);
|
||||
RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY);
|
||||
commandIds << "RicNewSimWellFractureAtPosFeature";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user