mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1040 - pre-proto - Updating position of well path fractures when md is changed, and calculaing correct position when creating new well path fracture from project view
This commit is contained in:
parent
3f052976f5
commit
2a6cceff62
@ -36,6 +36,7 @@
|
|||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT(RicNewWellPathFractureFeature, "RicNewWellPathFractureFeature");
|
CAF_CMD_SOURCE_INIT(RicNewWellPathFractureFeature, "RicNewWellPathFractureFeature");
|
||||||
@ -63,6 +64,17 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
fracture->name = "Well Path Fracture";
|
fracture->name = "Well Path Fracture";
|
||||||
|
|
||||||
|
float md_default = 0.0f;
|
||||||
|
fracture->measuredDepth = md_default;
|
||||||
|
|
||||||
|
RimWellPath* wellPath = nullptr;
|
||||||
|
objHandle->firstAncestorOrThisOfType(wellPath);
|
||||||
|
CVF_ASSERT(wellPath);
|
||||||
|
|
||||||
|
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||||
|
cvf::Vec3d positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(md_default);
|
||||||
|
fracture->positionAtWellpath = positionAtWellpath;
|
||||||
|
|
||||||
RimOilField* oilfield = nullptr;
|
RimOilField* oilfield = nullptr;
|
||||||
objHandle->firstAncestorOrThisOfType(oilfield);
|
objHandle->firstAncestorOrThisOfType(oilfield);
|
||||||
if (!oilfield) return;
|
if (!oilfield) return;
|
||||||
|
@ -35,6 +35,7 @@ RimFracture::RimFracture(void)
|
|||||||
CAF_PDM_InitObject("Fracture", "", "", "");
|
CAF_PDM_InitObject("Fracture", "", "", "");
|
||||||
|
|
||||||
m_rigFracture = new RigFracture;
|
m_rigFracture = new RigFracture;
|
||||||
|
m_recomputeGeometry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -88,6 +89,24 @@ void RimFracture::computeGeometry()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_rigFracture->setGeometry(polygonIndices, nodeCoords);
|
m_rigFracture->setGeometry(polygonIndices, nodeCoords);
|
||||||
|
|
||||||
|
m_recomputeGeometry = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimFracture::setRecomputeGeometryFlag()
|
||||||
|
{
|
||||||
|
m_recomputeGeometry = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimFracture::isRecomputeGeometryFlagSet()
|
||||||
|
{
|
||||||
|
return m_recomputeGeometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -95,6 +114,8 @@ void RimFracture::computeGeometry()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimFracture::hasValidGeometry() const
|
bool RimFracture::hasValidGeometry() const
|
||||||
{
|
{
|
||||||
|
if (m_recomputeGeometry) return false;
|
||||||
|
|
||||||
return (nodeCoords().size() > 0 && polygonIndices().size() > 0);
|
return (nodeCoords().size() > 0 && polygonIndices().size() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +46,15 @@ public:
|
|||||||
bool hasValidGeometry() const;
|
bool hasValidGeometry() const;
|
||||||
void computeGeometry();
|
void computeGeometry();
|
||||||
|
|
||||||
|
void setRecomputeGeometryFlag();
|
||||||
|
|
||||||
const std::vector<cvf::uint>& polygonIndices() const;
|
const std::vector<cvf::uint>& polygonIndices() const;
|
||||||
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
const std::vector<cvf::Vec3f>& nodeCoords() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool isRecomputeGeometryFlagSet();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::ref<RigFracture> m_rigFracture;
|
cvf::ref<RigFracture> m_rigFracture;
|
||||||
|
bool m_recomputeGeometry;
|
||||||
};
|
};
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
|
#include "RivWellPathPartMgr.h"
|
||||||
|
|
||||||
#include "cafPdmFieldHandle.h"
|
#include "cafPdmFieldHandle.h"
|
||||||
#include "cafPdmObject.h"
|
#include "cafPdmObject.h"
|
||||||
#include "cafPdmUiItem.h"
|
#include "cafPdmUiItem.h"
|
||||||
@ -142,8 +144,17 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||||
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
|
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
|
||||||
|
|
||||||
}
|
//wellPath->partMgr()->scheduleGeometryRegen();
|
||||||
|
|
||||||
|
setRecomputeGeometryFlag();
|
||||||
|
|
||||||
|
RimProject* proj;
|
||||||
|
this->firstAncestorOrThisOfType(proj);
|
||||||
|
if (proj)
|
||||||
|
{
|
||||||
|
proj->createDisplayModelAndRedrawAllViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user