mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improved UI for surface band and curves (#8026)
* Add surface intersection bands and curves * #8024 Ensemble Surface : Fix mix of files for a ensemble layer surface
This commit is contained in:
@@ -60,6 +60,14 @@ void RimEnsembleStatisticsSurface::setStatisticsType( RigSurfaceStatisticsCalcul
|
||||
setUserDescription( fullName() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigSurfaceStatisticsCalculator::StatisticsType RimEnsembleStatisticsSurface::statisticsType() const
|
||||
{
|
||||
return m_statisticsType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
RimSurface* createCopy() override;
|
||||
|
||||
void setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType );
|
||||
RigSurfaceStatisticsCalculator::StatisticsType statisticsType() const;
|
||||
|
||||
QString fullName() const override;
|
||||
|
||||
|
||||
@@ -124,9 +124,11 @@ void RimEnsembleSurface::loadDataAndUpdate()
|
||||
{
|
||||
cvf::ref<RigSurface> firstSurface = sourceSurfaceForStatistics[0]->surfaceData();
|
||||
|
||||
// The search tree must be created before the multi threading loop is initiated to avoid crash
|
||||
firstSurface->ensureIntersectionSearchTreeIsBuilt();
|
||||
|
||||
auto surfaceCount = static_cast<int>( sourceSurfaceForStatistics.size() );
|
||||
std::vector<cvf::ref<RigSurface>> sourceSurfaces( surfaceCount );
|
||||
|
||||
#pragma omp parallel for
|
||||
for ( int i = 0; i < surfaceCount; i++ )
|
||||
{
|
||||
@@ -282,6 +284,21 @@ void RimEnsembleSurface::loadData()
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSurface* RimEnsembleSurface::findStatisticsSurface( RigSurfaceStatisticsCalculator::StatisticsType statisticsType )
|
||||
{
|
||||
for ( auto s : surfaces() )
|
||||
{
|
||||
auto ensembleSurface = dynamic_cast<RimEnsembleStatisticsSurface*>( s );
|
||||
|
||||
if ( ensembleSurface && ensembleSurface->statisticsType() == statisticsType ) return s;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "RimSurfaceCollection.h"
|
||||
|
||||
#include "RigSurfaceStatisticsCalculator.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
@@ -50,6 +52,8 @@ public:
|
||||
|
||||
void loadData() override;
|
||||
|
||||
RimSurface* findStatisticsSurface( RigSurfaceStatisticsCalculator::StatisticsType statisticsType );
|
||||
|
||||
protected:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
@@ -59,10 +59,6 @@ RimFileSurface::~RimFileSurface()
|
||||
void RimFileSurface::setSurfaceFilePath( const QString& filePath )
|
||||
{
|
||||
m_surfaceDefinitionFilePath = filePath;
|
||||
if ( userDescription().isEmpty() )
|
||||
{
|
||||
setUserDescription( QFileInfo( filePath ).fileName() );
|
||||
}
|
||||
|
||||
clearCachedNativeData();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
#include "cafPdmFieldScriptingCapability.h"
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
|
||||
#include "QFile"
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSurfaceCollection, "SurfaceCollection" );
|
||||
|
||||
@@ -117,6 +118,18 @@ void RimSurfaceCollection::addEnsembleSurface( RimEnsembleSurface* ensembleSurfa
|
||||
addSubCollection( ensembleSurface );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimEnsembleSurface*> RimSurfaceCollection::ensembleSurfaces() const
|
||||
{
|
||||
std::vector<RimEnsembleSurface*> ensSurfaces;
|
||||
|
||||
this->descendantsIncludingThisOfType( ensSurfaces );
|
||||
|
||||
return ensSurfaces;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -135,6 +148,8 @@ RimSurface* RimSurfaceCollection::importSurfacesFromFiles( const QStringList& fi
|
||||
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f( existingSurfCount + newSurfCount );
|
||||
|
||||
newSurface->setSurfaceFilePath( newFileName );
|
||||
newSurface->setUserDescription( QFileInfo( newFileName ).fileName() );
|
||||
|
||||
newSurface->setColor( newColor );
|
||||
|
||||
if ( !newSurface->onLoadData() )
|
||||
|
||||
@@ -37,7 +37,8 @@ public:
|
||||
void addSurface( RimSurface* surface );
|
||||
void setAsTopmostFolder();
|
||||
|
||||
void addEnsembleSurface( RimEnsembleSurface* ensembleSurface );
|
||||
void addEnsembleSurface( RimEnsembleSurface* ensembleSurface );
|
||||
std::vector<RimEnsembleSurface*> ensembleSurfaces() const;
|
||||
|
||||
RimSurface* importSurfacesFromFiles( const QStringList& fileNames, bool showLegend = true );
|
||||
RimSurface* addGridCaseSurface( RimCase* sourceCase, int oneBasedSliceIndex = 1 );
|
||||
|
||||
Reference in New Issue
Block a user