Janitor : Remove confusing concept hasUserRequestedAnimation

This commit is contained in:
Magne Sjaastad 2021-10-05 11:07:50 +02:00
parent 4c01472fc1
commit f9c2bb4349
14 changed files with 19 additions and 69 deletions

View File

@ -302,8 +302,6 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMap(
eclipseCase->contourMapCollection()->push_back( contourMap );
contourMap->hasUserRequestedAnimation = true;
auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" );
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background
@ -386,8 +384,6 @@ RimGeoMechContourMapView* RicNewContourMapViewFeature::createGeoMechContourMap(
contourMap->setName( QString( "Contour Map %1" ).arg( i + 1 ) );
geoMechCase->contourMapCollection()->push_back( contourMap );
contourMap->hasUserRequestedAnimation = true;
auto col = RiuGuiTheme::getColorByVariableName( "backgroundColor2" );
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background

View File

@ -88,8 +88,6 @@ void RimPerforationCollection::appendPerforation( RimPerforationInterval* perfor
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
if ( activeView )
{
activeView->hasUserRequestedAnimation = true;
RimEclipseCase* eclipseCase = nullptr;
activeView->firstAncestorOrThisOfType( eclipseCase );
if ( eclipseCase )

View File

@ -411,12 +411,6 @@ void RimGeoMechResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
m_compactionRefLayer = m_compactionRefLayerUiField();
}
if ( m_geomCase->geoMechData() &&
m_geomCase->geoMechData()->femPartResults()->assertResultsLoaded( this->resultAddress() ) )
{
if ( view ) view->hasUserRequestedAnimation = true;
}
if ( propFilter )
{
propFilter->setToDefaultValues();

View File

@ -168,11 +168,8 @@ void RimGeoMechView::onLoadDataAndUpdate()
progress.setProgressDescription( "Reading Current Result" );
CVF_ASSERT( this->cellResult() != nullptr );
if ( this->hasUserRequestedAnimation() )
{
m_geomechCase->geoMechData()->femPartResults()->setNormalizationAirGap( this->cellResult()->normalizationAirGap() );
m_geomechCase->geoMechData()->femPartResults()->assertResultsLoaded( this->cellResult()->resultAddress() );
}
m_geomechCase->geoMechData()->femPartResults()->setNormalizationAirGap( this->cellResult()->normalizationAirGap() );
m_geomechCase->geoMechData()->femPartResults()->assertResultsLoaded( this->cellResult()->resultAddress() );
progress.incrementProgress();
progress.setProgressDescription( "Create Display model" );
@ -778,8 +775,7 @@ size_t RimGeoMechView::onTimeStepCountRequested()
//--------------------------------------------------------------------------------------------------
bool RimGeoMechView::isTimeStepDependentDataVisible() const
{
if ( this->hasUserRequestedAnimation() &&
( this->cellResult()->hasResult() || this->geoMechPropertyFilterCollection()->hasActiveFilters() ) )
if ( this->cellResult()->hasResult() || this->geoMechPropertyFilterCollection()->hasActiveFilters() )
{
return true;
}

View File

@ -92,8 +92,6 @@ Rim2dIntersectionView::Rim2dIntersectionView( void )
m_scaleTransform = new cvf::Transform();
m_intersectionVizModel = new cvf::ModelBasicList;
hasUserRequestedAnimation = true;
( (RiuViewerToViewInterface*)this )->setCameraPosition( sm_defaultViewMatrix );
disableGridBoxField();
@ -595,10 +593,7 @@ void Rim2dIntersectionView::onCreateDisplayModel()
m_intersectionVizModel->updateBoundingBoxesRecursive();
if ( this->hasUserRequestedAnimation() )
{
if ( viewer() ) viewer()->setCurrentFrame( m_currentTimeStep );
}
if ( viewer() ) viewer()->setCurrentFrame( m_currentTimeStep );
if ( this->viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix )
{
@ -670,7 +665,7 @@ void Rim2dIntersectionView::onUpdateDisplayModelForCurrentTimeStep()
}
}
if ( ( this->hasUserRequestedAnimation() && this->hasResults() ) )
if ( this->hasResults() )
{
m_flatIntersectionPartMgr->updateCellResultColor( m_currentTimeStep,
m_legendConfig->scalarMapper(),

View File

@ -432,7 +432,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData
}
else if ( eclipseView )
{
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
bool isResultsInfoRelevant = eclipseView->cellResult()->hasResult();
if ( eclipseView->cellResult()->isTernarySaturationSelected() )
{
@ -519,7 +519,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData
}
}
if ( eclipseView->hasUserRequestedAnimation() && eclipseView->cellEdgeResult()->hasResult() )
if ( eclipseView->cellEdgeResult()->hasResult() )
{
double min, max;
QString cellEdgeName = eclipseView->cellEdgeResult()->resultVariableUiShortName();
@ -552,8 +552,7 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData
{
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
RigGeoMechCaseData* caseData = geoMechCase ? geoMechCase->geoMechData() : nullptr;
bool isResultsInfoRelevant = caseData && geoMechView->hasUserRequestedAnimation() &&
geoMechView->cellResultResultDefinition()->hasResult();
bool isResultsInfoRelevant = caseData && geoMechView->cellResultResultDefinition()->hasResult();
if ( isResultsInfoRelevant )
{
@ -857,7 +856,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo( RimEclipseView* eclipseView )
if ( m_showHistogram() )
{
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
bool isResultsInfoRelevant = eclipseView->cellResult()->hasResult();
if ( isResultsInfoRelevant && histData.isHistogramVectorValid() )
{
@ -905,8 +904,7 @@ void Rim3dOverlayInfoConfig::updateGeoMech3DInfo( RimGeoMechView* geoMechView )
{
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
RigGeoMechCaseData* caseData = geoMechCase ? geoMechCase->geoMechData() : nullptr;
bool isResultsInfoRelevant = caseData && geoMechView->hasUserRequestedAnimation() &&
geoMechView->cellResultResultDefinition()->hasResult();
bool isResultsInfoRelevant = caseData && geoMechView->cellResultResultDefinition()->hasResult();
if ( isResultsInfoRelevant && histData.isHistogramVectorValid() )
{

View File

@ -128,8 +128,6 @@ Rim3dView::Rim3dView()
CAF_PDM_InitField( &maximumFrameRate, "MaximumFrameRate", 10, "Maximum Frame Rate", "", "", "" );
maximumFrameRate.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &hasUserRequestedAnimation, "AnimationMode", false, "Animation Mode", "", "", "" );
hasUserRequestedAnimation.uiCapability()->setUiHidden( true );
CAF_PDM_InitScriptableField( &m_currentTimeStep, "CurrentTimeStep", 0, "Current Time Step", "", "", "" );
m_currentTimeStep.uiCapability()->setUiHidden( true );
@ -556,8 +554,6 @@ void Rim3dView::setCurrentTimeStep( int frameIndex )
RiuTimeStepChangedHandler::instance()->handleTimeStepChanged( this );
this->onClearReservoirCellVisibilitiesIfNecessary();
}
this->hasUserRequestedAnimation = true;
}
//--------------------------------------------------------------------------------------------------
@ -703,7 +699,6 @@ void Rim3dView::setDefaultView()
//--------------------------------------------------------------------------------------------------
void Rim3dView::endAnimation()
{
this->hasUserRequestedAnimation = false;
this->onUpdateStaticCellColors();
}
@ -751,9 +746,6 @@ void Rim3dView::setupBeforeSave()
{
if ( m_viewer )
{
hasUserRequestedAnimation = m_viewer->isAnimationActive(); // JJS: This is not conceptually correct. The
// variable is updated as we go, and store the user
// intentions. But I guess that in practice...
m_cameraPosition = m_viewer->mainCamera()->viewMatrix();
m_cameraPointOfInterest = m_viewer->pointOfInterest();
}

View File

@ -96,7 +96,6 @@ public:
caf::PdmField<double> scaleZ;
caf::PdmField<bool> isPerspectiveView;
caf::PdmField<int> maximumFrameRate;
caf::PdmField<bool> hasUserRequestedAnimation;
// Draw style

View File

@ -302,8 +302,6 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault();
rimEclipseView->hasUserRequestedAnimation = true;
rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" );
rimEclipseView->cellEdgeResult()->setActive( false );
rimEclipseView->fractureColors()->setDefaultResultName();

View File

@ -104,11 +104,6 @@ void RimEclipseCellColors::fieldChangedByUi( const caf::PdmFieldHandle* changedF
changeLegendConfig( this->resultVariableUiName() );
}
if ( newValue != RiaResultNames::undefinedResultName() )
{
if ( m_reservoirView ) m_reservoirView->hasUserRequestedAnimation = true;
}
RimEclipseFaultColors* faultColors = dynamic_cast<RimEclipseFaultColors*>( this->parentField()->ownerObject() );
if ( faultColors )
{

View File

@ -785,7 +785,6 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews()
// It is usually not needed to create new display model, but if any derived geometry based on generated data
// (from Octave) a full display model rebuild is required
reservoirViews[i]->hasUserRequestedAnimation = true;
reservoirViews[i]->scheduleCreateDisplayModelAndRedraw();
reservoirViews[i]->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
}

View File

@ -638,7 +638,7 @@ void RimEclipseView::onCreateDisplayModel()
// If the animation was active before recreating everything, make viewer view current frame
if ( frameModels.size() > 1 && this->hasUserRequestedAnimation() )
if ( frameModels.size() > 1 )
{
if ( viewer() && !isUsingOverrideViewer() ) viewer()->setCurrentFrame( m_currentTimeStep );
}
@ -888,15 +888,14 @@ void RimEclipseView::updateVisibleCellColors()
for ( size_t i = 0; i < geometriesToRecolor.size(); ++i )
{
if ( this->hasUserRequestedAnimation() && this->cellEdgeResult()->hasResult() )
if ( this->cellEdgeResult()->hasResult() )
{
m_reservoirGridPartManager->updateCellEdgeResultColor( geometriesToRecolor[i],
m_currentTimeStep,
this->cellResult(),
this->cellEdgeResult() );
}
else if ( ( this->hasUserRequestedAnimation() && this->cellResult()->hasResult() ) ||
this->cellResult()->isTernarySaturationSelected() )
else if ( this->cellResult()->hasResult() || this->cellResult()->isTernarySaturationSelected() )
{
m_reservoirGridPartManager->updateCellResultColor( geometriesToRecolor[i],
m_currentTimeStep,
@ -910,8 +909,7 @@ void RimEclipseView::updateVisibleCellColors()
this->updateFaultColors();
bool hasGeneralCellResult = ( this->hasUserRequestedAnimation() && this->cellResult()->hasResult() ) ||
this->cellResult()->isTernarySaturationSelected();
bool hasGeneralCellResult = this->cellResult()->hasResult() || this->cellResult()->isTernarySaturationSelected();
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
if ( m_surfaceCollection ) m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
@ -1801,7 +1799,7 @@ void RimEclipseView::updateDisplayModelForWellResults()
onCreateDisplayModel();
updateDisplayModelVisibility();
if ( hasUserRequestedAnimation() && nativeOrOverrideViewer() )
if ( nativeOrOverrideViewer() )
{
nativeOrOverrideViewer()->animationControl()->setCurrentFrame( m_currentTimeStep );
}
@ -2007,7 +2005,7 @@ void RimEclipseView::updateFaultColors()
for ( RivCellSetEnum cellSetType : faultGeometriesToRecolor )
{
if ( this->hasUserRequestedAnimation() && this->cellEdgeResult()->hasResult() )
if ( this->cellEdgeResult()->hasResult() )
{
m_reservoirGridPartManager->updateFaultCellEdgeResultColor( cellSetType,
m_currentTimeStep,

View File

@ -131,8 +131,8 @@ RigHistogramData RimHistogramCalculator::histogramData( RimEclipseView*
{
if ( eclipseView )
{
RimEclipseResultDefinition* eclResultDefinition = eclipseView->cellResult();
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclResultDefinition->hasResult();
RimEclipseResultDefinition* eclResultDefinition = eclipseView->cellResult();
bool isResultsInfoRelevant = eclResultDefinition->hasResult();
if ( isResultsInfoRelevant )
{
@ -270,8 +270,7 @@ RigHistogramData RimHistogramCalculator::histogramData( RimGeoMechView*
{
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
RigGeoMechCaseData* caseData = geoMechCase ? geoMechCase->geoMechData() : nullptr;
bool isResultsInfoRelevant = caseData && geoMechView->hasUserRequestedAnimation() &&
geoMechView->cellResultResultDefinition()->hasResult();
bool isResultsInfoRelevant = caseData && geoMechView->cellResultResultDefinition()->hasResult();
if ( isResultsInfoRelevant )
{

View File

@ -366,13 +366,6 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( &isActive == changedField )
{
this->updateUiIconFromToggleField();
Rim3dView* view;
firstAncestorOrThisOfType( view );
if ( view )
{
view->hasUserRequestedAnimation = true;
}
}
if ( &m_showWellLabel == changedField )