#5358, #5317, #5019 Fix several issues regarding separate results definitions

This commit is contained in:
Jacob Støren 2020-01-21 15:13:29 +01:00
parent 2adefbcb04
commit 27737b51bc
10 changed files with 157 additions and 18 deletions

View File

@ -102,7 +102,7 @@ void RivSurfacePartMgr::updateCellResultColor( size_t timeStepIndex )
if ( m_intersectionFaces.notNull() )
{
RivIntersectionResultsColoringTools::calculateIntersectionResultColors( timeStepIndex,
false,
true,
m_surfaceInView,
m_intersectionGenerator.p(),
nullptr,

View File

@ -1232,7 +1232,17 @@ void RimEclipseView::onUpdateLegends()
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateIntersectionResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
sepInterResDef->updateLegendRangesTextAndVisibility( "Intersection Results:\n",
nativeOrOverrideViewer(),
isUsingOverrideViewer() );
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->updateLegendRangesTextAndVisibility( "Surface Results:\n",
nativeOrOverrideViewer(),
isUsingOverrideViewer() );
}
if ( this->cellEdgeResult()->legendConfig()->showLegend() )
@ -1843,6 +1853,16 @@ bool RimEclipseView::isTimeStepDependentDataVisible() const
if ( this->faultResultSettings()->customFaultResult()->isTernarySaturationSelected() ) return true;
}
if ( this->intersectionCollection()->hasAnyActiveSeparateResults() )
{
return true;
}
if ( this->surfaceInViewCollection()->hasAnyActiveSeparateResults() )
{
return true;
}
if ( this->wellPathCollection() && this->wellPathCollection()->anyWellsContainingPerforationIntervals() )
return true;
@ -1884,6 +1904,13 @@ void RimEclipseView::onResetLegendsInViewer()
sepInterResDef->ternaryLegendConfig()->recreateLegend();
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->regularLegendConfig()->recreateLegend();
sepInterResDef->ternaryLegendConfig()->recreateLegend();
}
for ( RimWellMeasurementInView* wellMeasurement : m_wellMeasurementCollection->measurements() )
{
wellMeasurement->legendConfig()->recreateLegend();
@ -2044,6 +2071,13 @@ std::vector<RimLegendConfig*> RimEclipseView::legendConfigs() const
absLegends.push_back( sepInterResDef->ternaryLegendConfig() );
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
absLegends.push_back( sepInterResDef->regularLegendConfig() );
absLegends.push_back( sepInterResDef->ternaryLegendConfig() );
}
for ( RimWellMeasurementInView* wellMeasurement : m_wellMeasurementCollection->measurements() )
{
absLegends.push_back( wellMeasurement->legendConfig() );

View File

@ -321,6 +321,7 @@ void RimGeoMechView::onCreateDisplayModel()
onUpdateLegends();
m_vizLogic->updateStaticCellColors( -1 );
m_intersectionCollection->applySingleColorEffect();
m_surfaceCollection->applySingleColorEffect();
m_overlayInfoConfig()->update3DInfo();
}
@ -450,6 +451,13 @@ void RimGeoMechView::onResetLegendsInViewer()
sepInterResDef->ternaryLegendConfig()->recreateLegend();
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->regularLegendConfig()->recreateLegend();
sepInterResDef->ternaryLegendConfig()->recreateLegend();
}
for ( RimWellMeasurementInView* wellMeasurement : m_wellMeasurementCollection->measurements() )
{
wellMeasurement->legendConfig()->recreateLegend();
@ -490,7 +498,17 @@ void RimGeoMechView::onUpdateLegends()
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateIntersectionResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
sepInterResDef->updateLegendRangesTextAndVisibility( "Intersection Results:\n",
nativeOrOverrideViewer(),
isUsingOverrideViewer() );
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
sepInterResDef->updateLegendRangesTextAndVisibility( "Surface Results:\n",
nativeOrOverrideViewer(),
isUsingOverrideViewer() );
}
if ( tensorResults()->showTensors() )
@ -618,6 +636,12 @@ std::vector<RimLegendConfig*> RimGeoMechView::legendConfigs() const
absLegendConfigs.push_back( sepInterResDef->regularLegendConfig() );
}
for ( RimIntersectionResultDefinition* sepInterResDef :
this->separateSurfaceResultsCollection()->intersectionResultsDefinitions() )
{
absLegendConfigs.push_back( sepInterResDef->regularLegendConfig() );
}
for ( RimWellMeasurementInView* wellMeasurement : m_wellMeasurementCollection->measurements() )
{
absLegendConfigs.push_back( wellMeasurement->legendConfig() );
@ -747,10 +771,22 @@ bool RimGeoMechView::isTimeStepDependentDataVisible() const
{
return true;
}
if ( this->hasVisibleTimeStepDependent3dWellLogCurves() )
{
return true;
}
if ( this->intersectionCollection()->hasAnyActiveSeparateResults() )
{
return true;
}
if ( this->surfaceInViewCollection()->hasAnyActiveSeparateResults() )
{
return true;
}
if ( m_wellMeasurementCollection->isChecked() )
{
return true;

View File

@ -106,9 +106,10 @@ void RimIntersectionCollection::updateCellResultColor( bool hasGeneralCellResult
{
if ( cs->isActive() )
{
bool hasSeparateInterResult = cs->activeSeparateResultDefinition() &&
cs->activeSeparateResultDefinition()->hasResult();
if ( hasSeparateInterResult || hasGeneralCellResult )
bool showResults = cs->activeSeparateResultDefinition() ? cs->activeSeparateResultDefinition()->hasResult()
: hasGeneralCellResult;
if ( showResults )
{
cs->intersectionPartMgr()->updateCellResultColor( timeStepIndex, nullptr, nullptr );
}
@ -137,6 +138,31 @@ void RimIntersectionCollection::updateCellResultColor( bool hasGeneralCellResult
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionCollection::hasAnyActiveSeparateResults()
{
if ( !this->isActive() ) return false;
for ( RimExtrudedCurveIntersection* cs : m_intersections )
{
if ( cs->isActive() && cs->activeSeparateResultDefinition() && cs->activeSeparateResultDefinition()->hasResult() )
{
return true;
}
}
for ( RimBoxIntersection* cs : m_intersectionBoxes )
{
if ( cs->isActive() && cs->activeSeparateResultDefinition() && cs->activeSeparateResultDefinition()->hasResult() )
{
return true;
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -59,6 +59,7 @@ public:
void appendIntersectionBoxNoUpdate( RimBoxIntersection* intersectionBox );
bool hasActiveIntersectionForSimulationWell( const RimSimWellInView* simWell ) const;
bool hasAnyActiveSeparateResults();
void updateIntersectionBoxGeometry();

View File

@ -226,8 +226,9 @@ RimGeoMechResultDefinition* RimIntersectionResultDefinition::geoMechResultDefini
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer,
bool isUsingOverrideViewer )
void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( const QString& title,
RiuViewer* nativeOrOverrideViewer,
bool isUsingOverrideViewer )
{
if ( !this->isInAction() ) return;
@ -257,7 +258,7 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( RiuVi
this->ternaryLegendConfig(),
this->timeStep() );
eclResultDef->updateLegendTitle( this->regularLegendConfig(), "Intersection Results:\n" );
eclResultDef->updateLegendTitle( this->regularLegendConfig(), title );
if ( this->regularLegendConfig()->showLegend() && eclResultDef->hasResult() )
{
@ -268,16 +269,14 @@ void RimIntersectionResultDefinition::updateLegendRangesTextAndVisibility( RiuVi
eclResultDef->currentGridCellResults()->maxTimeStepCount() > 1 &&
this->ternaryLegendConfig()->showLegend() && this->ternaryLegendConfig()->titledOverlayFrame() )
{
this->ternaryLegendConfig()->setTitle( "Intersection Results: \n" );
this->ternaryLegendConfig()->setTitle( title );
nativeOrOverrideViewer->addColorLegendToBottomLeftCorner( this->ternaryLegendConfig()->titledOverlayFrame(),
isUsingOverrideViewer );
}
}
else
{
this->geoMechResultDefinition()->updateLegendTextAndRanges( this->regularLegendConfig(),
"Intersection Results:\n",
this->timeStep() );
this->geoMechResultDefinition()->updateLegendTextAndRanges( this->regularLegendConfig(), title, this->timeStep() );
if ( this->geoMechResultDefinition()->hasResult() && this->regularLegendConfig()->showLegend() )
{

View File

@ -54,7 +54,9 @@ public:
RimEclipseResultDefinition* eclipseResultDefinition() const;
RimGeoMechResultDefinition* geoMechResultDefinition() const;
void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer );
void updateLegendRangesTextAndVisibility( const QString& title,
RiuViewer* nativeOrOverrideViewer,
bool isUsingOverrideViewer );
protected:
virtual caf::PdmFieldHandle* userDescriptionField() override;

View File

@ -100,7 +100,7 @@ void RimSurfaceInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField
const QVariant& oldValue,
const QVariant& newValue )
{
if ( changedField == &m_isActive )
if ( changedField == &m_isActive || changedField == &m_useSeparateDataSource || changedField == &m_separateDataSource )
{
RimGridView* ownerView;
this->firstAncestorOrThisOfTypeAsserted( ownerView );

View File

@ -20,6 +20,7 @@
#include "RiaApplication.h"
#include "RimGridView.h"
#include "RimIntersectionResultDefinition.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSurfaceCollection.h"
@ -160,9 +161,11 @@ void RimSurfaceInViewCollection::updateCellResultColor( bool hasGeneralCellResul
{
if ( surf->isActive() )
{
bool hasSeparateInterResult = false; // surf->activeSeparateResultDefinition() &&
// surf->activeSeparateResultDefinition()->hasResult();
if ( hasSeparateInterResult || hasGeneralCellResult )
bool showResults = surf->activeSeparateResultDefinition()
? surf->activeSeparateResultDefinition()->hasResult()
: hasGeneralCellResult;
if ( showResults )
{
surf->surfacePartMgr()->updateCellResultColor( timeStepIndex );
}
@ -173,3 +176,38 @@ void RimSurfaceInViewCollection::updateCellResultColor( bool hasGeneralCellResul
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSurfaceInViewCollection::applySingleColorEffect()
{
if ( !this->m_isActive() ) return;
for ( RimSurfaceInView* surf : m_surfacesInView )
{
if ( surf->isActive() )
{
surf->surfacePartMgr()->applySingleColor();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSurfaceInViewCollection::hasAnyActiveSeparateResults()
{
if ( !this->m_isActive() ) return false;
for ( RimSurfaceInView* surf : m_surfacesInView )
{
if ( surf->isActive() && surf->activeSeparateResultDefinition() &&
surf->activeSeparateResultDefinition()->hasResult() )
{
return true;
}
}
return false;
}

View File

@ -43,6 +43,9 @@ public:
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform );
void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex );
void applySingleColorEffect();
bool hasAnyActiveSeparateResults();
private:
caf::PdmFieldHandle* objectToggleField() override;