mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5116 Well Measurement: select RimWellMeasurementInView when picking in 3d view.
This commit is contained in:
parent
33693932b6
commit
49dd2ad307
@ -26,6 +26,8 @@
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimWellMeasurement.h"
|
||||
#include "RimWellMeasurementCollection.h"
|
||||
#include "RimWellMeasurementInView.h"
|
||||
#include "RimWellMeasurementInViewCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathAttribute.h"
|
||||
#include "RimWellPathAttributeCollection.h"
|
||||
@ -159,7 +161,23 @@ bool RicWellPathPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& event
|
||||
}
|
||||
|
||||
RiuMainWindow::instance()->setResultInfo( measurementText );
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( collection );
|
||||
|
||||
Rim3dView* rimView = RiaApplication::instance()->activeReservoirView();
|
||||
if ( rimView )
|
||||
{
|
||||
// Find the RimWellMeasurementInView which matches the selection
|
||||
std::vector<RimWellMeasurementInViewCollection*> wellMeasurementInViewCollections;
|
||||
rimView->descendantsIncludingThisOfType( wellMeasurementInViewCollections );
|
||||
if ( !wellMeasurementInViewCollections.empty() )
|
||||
{
|
||||
RimWellMeasurementInView* wellMeasurementInView =
|
||||
wellMeasurementInViewCollections[0]->getWellMeasurementInView( measurement );
|
||||
if ( wellMeasurementInView )
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( wellMeasurementInView );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,3 +142,21 @@ void RimWellMeasurementInViewCollection::syncWithChangesInWellMeasurementCollect
|
||||
updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get the "in-view" measurement corresponding to a give measurement.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellMeasurementInView*
|
||||
RimWellMeasurementInViewCollection::getWellMeasurementInView( const RimWellMeasurement* measurement ) const
|
||||
{
|
||||
for ( RimWellMeasurementInView* wellMeasurementInView : measurements() )
|
||||
{
|
||||
if ( wellMeasurementInView->measurementKind() == measurement->kind() )
|
||||
{
|
||||
return wellMeasurementInView;
|
||||
}
|
||||
}
|
||||
|
||||
// No match
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <vector>
|
||||
|
||||
class RimWellMeasurementInView;
|
||||
class RimWellMeasurement;
|
||||
|
||||
class RimWellMeasurementInViewCollection : public RimCheckableNamedObject
|
||||
{
|
||||
@ -37,6 +38,8 @@ public:
|
||||
|
||||
void syncWithChangesInWellMeasurementCollection();
|
||||
|
||||
RimWellMeasurementInView* getWellMeasurementInView( const RimWellMeasurement* measurement ) const;
|
||||
|
||||
protected:
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
|
Loading…
Reference in New Issue
Block a user