mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user