mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-08 07:15:13 -06:00
Create multiple polygons from a contour map
* Fix overwrite of value thresholds * Fix performance issue with filtered values * Add "Delete All Polygons" from the polygon collection * Add area threshold where user can specify area cutoff
This commit is contained in:
1 parent
bbd79cca6a
commit
f4c31e0b28
23 files changed
+390
-112
No files matched your search
@@ -25,12 +25,11 @@
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
#include "RimAnnotationLineAppearance.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimPolylineTarget.h"
|
||||
#include "RimPolylinesFromFileAnnotation.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReachCircleAnnotation.h"
|
||||
#include "RimTextAnnotation.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimUserDefinedPolylinesAnnotation.h"
|
||||
|
||||
#include "Polygons/RimPolygon.h"
|
||||
@@ -79,7 +78,7 @@ RimAnnotationCollection::~RimAnnotationCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationCollection::initAfterRead()
|
||||
{
|
||||
auto polycoll = RimProject::current()->activeOilField()->polygonCollection();
|
||||
auto polycoll = RimTools::polygonCollection();
|
||||
|
||||
for ( auto oldPolyObj : m_userDefinedPolylineAnnotations_OBSOLETE->annotations() )
|
||||
{
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
#include "RimCellFilter.h"
|
||||
#include "RimCellIndexFilter.h"
|
||||
#include "RimCellRangeFilter.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimPolygonFilter.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimUserDefinedFilter.h"
|
||||
#include "RimUserDefinedIndexFilter.h"
|
||||
#include "RimViewController.h"
|
||||
@@ -144,8 +144,7 @@ void RimCellFilterCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuB
|
||||
|
||||
menuBuilder.subMenuStart( "Polygon Filter", QIcon( ":/CellFilter_Polygon.png" ) );
|
||||
{
|
||||
auto project = RimProject::current();
|
||||
auto polygonCollection = project->activeOilField()->polygonCollection();
|
||||
auto polygonCollection = RimTools::polygonCollection();
|
||||
for ( auto p : polygonCollection->allPolygons() )
|
||||
{
|
||||
if ( !p ) continue;
|
||||
|
||||
@@ -478,9 +478,6 @@ std::pair<double, double> RimContourMapProjection::minmaxValuesAllTimeSteps()
|
||||
const auto [minVal, maxVal] = computeMinMaxValuesAllTimeSteps();
|
||||
m_minResultAllTimeSteps = minVal;
|
||||
m_maxResultAllTimeSteps = maxVal;
|
||||
|
||||
m_lowerThreshold = minVal;
|
||||
m_upperThreshold = maxVal;
|
||||
}
|
||||
|
||||
return std::pair<double, double>( m_minResultAllTimeSteps, m_maxResultAllTimeSteps );
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
#include "RimEclipseCaseEnsemble.h"
|
||||
#include "RimEclipseContourMapProjection.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSimWellInViewCollection.h"
|
||||
#include "RimStatisticsContourMapProjection.h"
|
||||
#include "RimStatisticsContourMapView.h"
|
||||
@@ -213,8 +211,7 @@ void RimStatisticsContourMap::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
||||
if ( m_enableFormationFilter ) formationGrp->add( &m_selectedFormations );
|
||||
}
|
||||
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( auto polygonCollection = proj->activeOilField()->polygonCollection().p() )
|
||||
if ( auto polygonCollection = RimTools::polygonCollection() )
|
||||
{
|
||||
if ( !polygonCollection->allPolygons().empty() )
|
||||
{
|
||||
@@ -389,8 +386,7 @@ QList<caf::PdmOptionItemInfo> RimStatisticsContourMap::calculateValueOptions( co
|
||||
}
|
||||
else if ( &m_selectedPolygons == fieldNeedingOptions )
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
if ( auto polygonCollection = proj->activeOilField()->polygonCollection().p() )
|
||||
if ( auto polygonCollection = RimTools::polygonCollection() )
|
||||
{
|
||||
for ( auto p : polygonCollection->allPolygons() )
|
||||
{
|
||||
|
||||
@@ -100,6 +100,18 @@ void RimPolygonCollection::deleteUserDefinedPolygons()
|
||||
scheduleRedrawViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPolygonCollection::deleteAllPolygons()
|
||||
{
|
||||
m_polygons().deleteChildren();
|
||||
m_polygonFiles().deleteChildren();
|
||||
|
||||
updateViewTreeItems();
|
||||
scheduleRedrawViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -184,6 +196,8 @@ void RimPolygonCollection::childFieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
void RimPolygonCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
||||
{
|
||||
RimPolygonCollection::appendPolygonMenuItems( menuBuilder );
|
||||
menuBuilder.addSeparator();
|
||||
menuBuilder << "RicDeleteAllPolygonsFeature";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
RimPolygon* appendUserDefinedPolygon();
|
||||
void addUserDefinedPolygon( RimPolygon* polygon );
|
||||
void deleteUserDefinedPolygons();
|
||||
void deleteAllPolygons();
|
||||
|
||||
void addPolygonFile( RimPolygonFile* polygonFile );
|
||||
|
||||
|
||||
@@ -558,8 +558,7 @@ RimWellPath* RimTools::firstWellPath()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSurfaceCollection* RimTools::surfaceCollection()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
return proj->activeOilField()->surfaceCollection();
|
||||
return RimProject::current()->activeOilField()->surfaceCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -567,8 +566,7 @@ RimSurfaceCollection* RimTools::surfaceCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPolygonCollection* RimTools::polygonCollection()
|
||||
{
|
||||
RimProject* proj = RimProject::current();
|
||||
return proj->activeOilField()->polygonCollection();
|
||||
return RimProject::current()->activeOilField()->polygonCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user