Copy changes from dev-branch into main

History of main branch was difficult to merge. Take a copy of dev-branch, and merge both ways between dev and main after the release.
This commit is contained in:
Magne Sjaastad
2023-10-23 08:12:19 +02:00
parent 5688838899
commit 06f9c6126d
1778 changed files with 35036 additions and 12457 deletions

View File

@@ -23,11 +23,10 @@
#include "RimAnnotationLineAppearance.h"
#include "RimEnsembleSurface.h"
#include "RimExtrudedCurveIntersection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSurface.h"
#include "RimSurfaceCollection.h"
#include "RimSurfaceIntersectionBand.h"
#include "RimTools.h"
#include "Riu3DMainWindowTools.h"
@@ -37,26 +36,6 @@
CAF_CMD_SOURCE_INIT( RicCreateSurfaceIntersectionBandFeature, "RicCreateSurfaceIntersectionBandFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimSurfaceCollection* RicCreateSurfaceIntersectionBandFeature::surfaceCollection()
{
RimProject* proj = RimProject::current();
return proj->activeOilField()->surfaceCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateSurfaceIntersectionBandFeature::isCommandEnabled()
{
auto* surfColl = RicCreateSurfaceIntersectionBandFeature::surfaceCollection();
auto surfaces = surfColl->ensembleSurfaces();
return !surfaces.empty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -67,19 +46,18 @@ void RicCreateSurfaceIntersectionBandFeature::onActionTriggered( bool isChecked
{
RimEnsembleSurface* firstEnsembleSurface = nullptr;
{
auto surfColl = RicCreateSurfaceIntersectionBandFeature::surfaceCollection();
auto surfColl = RimTools::surfaceCollection();
auto surfaces = surfColl->ensembleSurfaces();
if ( !surfaces.empty() ) firstEnsembleSurface = surfaces.front();
}
RimSurfaceIntersectionBand* objectToSelect = nullptr;
const double defaultOpacity = 0.6;
const auto colors = RiaColorTables::structuralUncertaintyColors();
if ( firstEnsembleSurface )
{
const double defaultOpacity = 0.6;
auto colors = RiaColorTables::structuralUncertaintyColors();
// Create min/max band
{
auto surf1 = firstEnsembleSurface->findStatisticsSurface( RigSurfaceStatisticsCalculator::StatisticsType::MIN );
@@ -120,6 +98,27 @@ void RicCreateSurfaceIntersectionBandFeature::onActionTriggered( bool isChecked
}
}
}
else
{
auto band = intersection->addIntersectionBand();
auto surfColl = RimTools::surfaceCollection();
auto surfaces = surfColl->surfaces();
if ( surfaces.size() > 1 )
{
band->setSurfaces( surfaces[0], surfaces[1] );
}
auto color = colors.cycledColor3f( 1 );
band->setBandColor( color );
band->setBandOpacity( defaultOpacity );
band->setPolygonOffsetUnit( 0.1 );
band->lineAppearance()->setColor( color );
objectToSelect = band;
}
intersection->rebuildGeometryAndScheduleCreateDisplayModel();
intersection->updateAllRequiredEditors();