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

@@ -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;
};