Well measurement improvements

* Update 3D view and plot when measurement data is added
* #8625 Make visibility of measurement follow well path visibility
This commit is contained in:
Magne Sjaastad
2023-02-07 17:44:47 +01:00
committed by GitHub
parent 8028444018
commit 9ae00177bf
5 changed files with 100 additions and 57 deletions

View File

@@ -24,6 +24,7 @@
#include "RimWellLogTrack.h"
#include "RimWellMeasurement.h"
#include "RimWellMeasurementCollection.h"
#include "RimWellMeasurementCurve.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
@@ -69,7 +70,9 @@ void RicNewWellMeasurementCurveFeature::onActionTriggered( bool isChecked )
measurementKind = firstMeasurement->kind();
}
RicWellLogTools::addWellMeasurementCurve( wellLogPlotTrack, wellPath, measurementKind );
auto curve = RicWellLogTools::addWellMeasurementCurve( wellLogPlotTrack, wellPath, measurementKind );
bool updateParentPlot = true;
if ( curve ) curve->loadDataAndUpdate( updateParentPlot );
}
}
}

View File

@@ -20,6 +20,8 @@
#include "RiaApplication.h"
#include "RimGridView.h"
#include "RimWellMeasurementInViewCollection.h"
#include "RimWellPathCollection.h"
#include "RicWellMeasurementImportTools.h"
@@ -63,6 +65,14 @@ void RicImportWellMeasurementsFeature::onActionTriggered( bool isChecked )
app->setLastUsedDialogDirectory( "WELLPATH_DIR", QFileInfo( wellPathFilePaths.last() ).absolutePath() );
RicWellMeasurementImportTools::importWellMeasurementsFromFiles( wellPathFilePaths, wellPathCollection );
RimGridView* activeView = RiaApplication::instance()->activeGridView();
if ( activeView )
{
std::vector<RimWellMeasurementInViewCollection*> measurementsInView;
activeView->descendantsOfType( measurementsInView );
if ( !measurementsInView.empty() ) measurementsInView.front()->setCheckState( true );
}
}
//--------------------------------------------------------------------------------------------------

View File

@@ -306,9 +306,8 @@ void RivWellPathPartMgr::appendWellMeasurementsToModel( cvf::ModelBasicList*
if ( !gridView->measurementCollection()->isChecked() ) return;
for ( RimWellMeasurementInView* wellMeasurementInView : gridView->measurementCollection()->measurements() )
{
if ( wellMeasurementInView->isChecked() && wellMeasurementInView->isWellChecked( m_rimWellPath->name() ) )
for ( RimWellMeasurementInView* wellMeasurementInView :
gridView->measurementCollection()->visibleMeasurementsForWellPath( m_rimWellPath->name() ) )
{
std::vector<QString> measurementKinds;
measurementKinds.push_back( wellMeasurementInView->measurementKind() );
@@ -334,9 +333,8 @@ void RivWellPathPartMgr::appendWellMeasurementsToModel( cvf::ModelBasicList*
double startMD = wellMeasurement->MD() - wellPathRadius * 0.5;
double endMD = wellMeasurement->MD() + wellPathRadius * 0.5;
double wellMeasurementRadius = this->wellMeasurementRadius( characteristicCellSize,
this->wellPathCollection(),
wellMeasurementInView );
double wellMeasurementRadius =
this->wellMeasurementRadius( characteristicCellSize, this->wellPathCollection(), wellMeasurementInView );
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back( displayCoordTransform->transformToDisplayCoord(
@@ -371,7 +369,6 @@ void RivWellPathPartMgr::appendWellMeasurementsToModel( cvf::ModelBasicList*
}
}
}
}
//--------------------------------------------------------------------------------------------------
///

View File

@@ -15,6 +15,7 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellMeasurementInViewCollection.h"
#include "Rim3dView.h"
@@ -27,9 +28,11 @@
#include "RimWellMeasurementCollection.h"
#include "RimWellMeasurementFilter.h"
#include "RimWellMeasurementInView.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "cafCmdFeatureMenuBuilder.h"
#include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiTableViewEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafPdmUiTreeSelectionEditor.h"
@@ -51,6 +54,9 @@ RimWellMeasurementInViewCollection::RimWellMeasurementInViewCollection()
m_isChecked = false;
this->setName( "Well Measurements" );
CAF_PDM_InitField( &m_linkWellVisibility, "linkWellVisibility", true, "Link Visibility to Well Path Visibility" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_linkWellVisibility );
}
//--------------------------------------------------------------------------------------------------
@@ -74,6 +80,31 @@ std::vector<RimWellMeasurementInView*> RimWellMeasurementInViewCollection::measu
return attrs;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellMeasurementInView*>
RimWellMeasurementInViewCollection::visibleMeasurementsForWellPath( const QString& wellName ) const
{
if ( !isChecked() ) return {};
if ( m_linkWellVisibility )
{
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
auto wellPath = wellPathCollection->tryFindMatchingWellPath( wellName );
if ( wellPath && !wellPath->showWellPath() ) return {};
}
std::vector<RimWellMeasurementInView*> visible;
for ( auto m : measurements() )
{
if ( m->isChecked() && m->isWellChecked( wellName ) ) visible.push_back( m );
}
return visible;
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------

View File

@@ -35,6 +35,7 @@ public:
~RimWellMeasurementInViewCollection() override;
std::vector<RimWellMeasurementInView*> measurements() const;
std::vector<RimWellMeasurementInView*> visibleMeasurementsForWellPath( const QString& wellName ) const;
void syncWithChangesInWellMeasurementCollection();
@@ -46,4 +47,5 @@ protected:
private:
caf::PdmChildArrayField<RimWellMeasurementInView*> m_measurementsInView;
caf::PdmField<bool> m_linkWellVisibility;
};