#3312 Well Path Creation: Update intersections, completion type result and fractures when moving the wellpath

This commit is contained in:
Jacob Støren 2018-09-12 13:18:48 +02:00
parent 50b10d6078
commit 0431540073
8 changed files with 89 additions and 35 deletions

View File

@ -32,6 +32,7 @@
#include <QMouseEvent>
#include "RivPartPriority.h"
#include "cafPdmUiCommandSystemProxy.h"
#include "RimModeledWellPath.h"
//--------------------------------------------------------------------------------------------------
///
@ -58,8 +59,6 @@ RicPointTangentManipulator::~RicPointTangentManipulator()
void RicPointTangentManipulator::setOrigin(const cvf::Vec3d& origin)
{
m_partManager->setOrigin(origin);
emit notifyRedraw();
}
//--------------------------------------------------------------------------------------------------
@ -68,8 +67,6 @@ void RicPointTangentManipulator::setOrigin(const cvf::Vec3d& origin)
void RicPointTangentManipulator::setTangent(const cvf::Vec3d& tangent)
{
m_partManager->setTangent(tangent);
emit notifyRedraw();
}
//--------------------------------------------------------------------------------------------------
@ -78,7 +75,6 @@ void RicPointTangentManipulator::setTangent(const cvf::Vec3d& tangent)
void RicPointTangentManipulator::setHandleSize(double handleSize)
{
m_partManager->setHandleSize(handleSize);
emit notifyRedraw();
}
//--------------------------------------------------------------------------------------------------
@ -108,7 +104,6 @@ bool RicPointTangentManipulator::eventFilter(QObject *obj, QEvent* inputEvent)
if(m_partManager->isManipulatorActive())
{
emit notifySelected();
emit notifyRedraw();
return true;
}
@ -137,8 +132,6 @@ bool RicPointTangentManipulator::eventFilter(QObject *obj, QEvent* inputEvent)
emit notifyUpdate(origin, tangent);
emit notifyRedraw();
return true;
}
}
@ -154,6 +147,7 @@ bool RicPointTangentManipulator::eventFilter(QObject *obj, QEvent* inputEvent)
m_partManager->originAndTangent(&origin, &tangent);
emit notifyUpdate(origin, tangent);
emit notifyDragFinished();
return true;
}
@ -809,6 +803,10 @@ void RicWellTarget3dEditor::configureAndUpdateUi(const QString& uiConfigName)
SIGNAL( notifySelected() ),
this,
SLOT( slotSelectedIn3D() ) );
QObject::connect(m_manipulator,
SIGNAL( notifyDragFinished() ),
this,
SLOT( slotDragFinished() ) );
m_cvfModel = new cvf::ModelBasicList;
m_ownerViewer->addStaticModelOnce(m_cvfModel.p());
}
@ -871,11 +869,9 @@ void RicWellTarget3dEditor::slotUpdated(const cvf::Vec3d& origin, const cvf::Vec
domainOrigin.z() = -domainOrigin.z();
QVariant originVariant = caf::PdmValueFieldSpecialization < cvf::Vec3d >::convert(domainOrigin);
std::cout << "RicWellTarget3dEditor::slotUpdated() start" << std::endl;
target->enableFullUpdate(false);
caf::PdmUiCommandSystemProxy::instance()->setUiValueToField(target->m_targetPoint.uiCapability(), originVariant);
std::cout << "RicWellTarget3dEditor::slotUpdated() end" << std::endl;
target->enableFullUpdate(true);
}
void RicWellTarget3dEditor::slotSelectedIn3D()
@ -887,4 +883,20 @@ void RicWellTarget3dEditor::slotSelectedIn3D()
}
caf::SelectionManager::instance()->setSelectedItemAtLevel(target, caf::SelectionManager::FIRST_LEVEL);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellTarget3dEditor::slotDragFinished()
{
RimWellPathTarget* target = dynamic_cast<RimWellPathTarget*>(this->pdmObject());
if ( !target)
{
return;
}
RimModeledWellPath* wellpath;
target->firstAncestorOrThisOfTypeAsserted(wellpath);
wellpath->scheduleUpdateOfDependentVisualization();
}

View File

@ -60,7 +60,7 @@ public:
signals:
void notifySelected();
void notifyRedraw();
void notifyDragFinished();
void notifyUpdate(const cvf::Vec3d& origin, const cvf::Vec3d& tangent);
protected:
@ -286,6 +286,7 @@ protected:
private slots:
void slotUpdated(const cvf::Vec3d& origin, const cvf::Vec3d& tangent);
void slotSelectedIn3D();
void slotDragFinished();
private:
QPointer<RicPointTangentManipulator> m_manipulator;
cvf::ref<cvf::ModelBasicList> m_cvfModel;

View File

@ -209,30 +209,26 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
setDefaultFractureColorResult();
}
if (changedField == &m_azimuth || changedField == &m_fractureTemplate || changedField == &m_stimPlanTimeIndexToPlot ||
changedField == this->objectToggleField() || changedField == &m_dip || changedField == &m_tilt ||
changedField == &m_perforationLength)
if ( changedField == &m_azimuth
|| changedField == &m_fractureTemplate
|| changedField == &m_stimPlanTimeIndexToPlot
|| changedField == this->objectToggleField()
|| changedField == &m_dip
|| changedField == &m_tilt
|| changedField == &m_perforationLength)
{
clearCachedNonDarcyProperties();
RimEclipseView* rimView = nullptr;
this->firstAncestorOrThisOfType(rimView);
if (rimView)
RimEclipseCase* eclipseCase = nullptr;
this->firstAncestorOrThisOfType(eclipseCase);
if ( eclipseCase )
{
RimEclipseCase* eclipseCase = nullptr;
rimView->firstAncestorOrThisOfType(eclipseCase);
if (eclipseCase)
{
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews(
eclipseCase);
}
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews(
eclipseCase);
}
else
{
// Can be triggered from well path, find active view
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->reloadCompletionTypeResultsInAllViews();
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
}
}
}

View File

@ -105,6 +105,8 @@ public:
bool hasDefiningPoints() const;
int branchIndex() const;
void rebuildGeometryAndScheduleCreateDisplayModel();
protected:
virtual caf::PdmFieldHandle* userDescriptionField();
virtual caf::PdmFieldHandle* objectToggleField();
@ -140,7 +142,6 @@ private:
void updateWellExtentDefaultValue();
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
void updateName();
void rebuildGeometryAndScheduleCreateDisplayModel();
static double azimuthInRadians(cvf::Vec3d vec);
private:
cvf::ref<RivIntersectionPartMgr> m_crossSectionPartMgr;

View File

@ -25,6 +25,11 @@
#include "cafPdmUiTreeOrdering.h"
#include "RimPlotCurve.h"
#include "RiaCompletionTypeCalculationScheduler.h"
#include "RimIntersection.h"
#include "RimWellPath.h"
#include "RimWellPathFractureCollection.h"
#include "RimWellPathFracture.h"
CAF_PDM_SOURCE_INIT(RimModeledWellPath, "ModeledWellPath");
@ -67,9 +72,6 @@ void RimModeledWellPath::createWellPathGeometry()
void RimModeledWellPath::updateWellPathVisualization()
{
this->setWellPathGeometry(m_geometryDefinition->createWellPathGeometry().p());
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->scheduleCreateDisplayModelAndRedrawAllViews();
std::vector<RimPlotCurve*> refferingCurves;
this->objectsWithReferringPtrFieldsOfType(refferingCurves);
@ -78,6 +80,32 @@ void RimModeledWellPath::updateWellPathVisualization()
{
curve->loadDataAndUpdate(false);
}
for ( auto fracture : this->fractureCollection()->activeFractures() )
{
fracture->loadDataAndUpdate();
}
std::vector<RimIntersection*> refferingIntersections;
this->objectsWithReferringPtrFieldsOfType(refferingIntersections);
for (auto intersection: refferingIntersections)
{
intersection->rebuildGeometryAndScheduleCreateDisplayModel();
}
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
proj->scheduleCreateDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimModeledWellPath::scheduleUpdateOfDependentVisualization()
{
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------

View File

@ -35,6 +35,7 @@ public:
void createWellPathGeometry();
void updateWellPathVisualization();
void scheduleUpdateOfDependentVisualization();
RimWellPathGeometryDef* geometryDefinition();
private:

View File

@ -24,6 +24,7 @@ RimWellPathTarget::RimWellPathTarget()
, m_targetPoint(cvf::Vec3d::ZERO)
, m_azimuth(0.0)
, m_inclination(0.0)
, m_isFullUpdateEnabled(true)
{
CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", "");
@ -173,6 +174,14 @@ double RimWellPathTarget::radius2() const
return 30.0/cvf::Math::toRadians(m_dogleg2);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathTarget::enableFullUpdate(bool enable)
{
m_isFullUpdateEnabled = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -195,6 +204,10 @@ void RimWellPathTarget::fieldChangedByUi(const caf::PdmFieldHandle* changedField
RimModeledWellPath* wellPath;
firstAncestorOrThisOfTypeAsserted(wellPath);
wellPath->updateWellPathVisualization();
if (m_isFullUpdateEnabled)
{
wellPath->scheduleUpdateOfDependentVisualization();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -54,6 +54,8 @@ private:
private:
friend class RicWellTarget3dEditor;
void enableFullUpdate(bool enable);
bool m_isFullUpdateEnabled;
caf::PdmField<bool> m_isEnabled;
caf::PdmField<caf::AppEnum<TargetTypeEnum> > m_targetType;
caf::PdmField<cvf::Vec3d> m_targetPoint;