mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixed missing intersection colors when cellresults are turned off
This commit is contained in:
@@ -102,15 +102,6 @@ void RicAppendSeparateIntersectionResultFeatureCmd::redo()
|
|||||||
m_intersectionCollection->appendIntersectionResultDefinition( intersectionResDef );
|
m_intersectionCollection->appendIntersectionResultDefinition( intersectionResDef );
|
||||||
|
|
||||||
m_intersectionCollection->updateConnectedEditors();
|
m_intersectionCollection->updateConnectedEditors();
|
||||||
|
|
||||||
// if ( m_intersectionCollection->intersectionResultsDefinitions().size() < 2 ) // New default created. Possible
|
|
||||||
//{
|
|
||||||
// RimGridView* gridView;
|
|
||||||
// m_intersectionCollection->firstAncestorOrThisOfTypeAsserted( gridView );
|
|
||||||
//
|
|
||||||
// gridView->scheduleCreateDisplayModelAndRedraw();
|
|
||||||
// gridView->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -172,11 +172,8 @@ void RivIntersectionResultsColoringTools::updateEclipseCellResultColors(
|
|||||||
|
|
||||||
cvf::ref<RigResultAccessor> resultAccessor;
|
cvf::ref<RigResultAccessor> resultAccessor;
|
||||||
|
|
||||||
if ( RiaDefines::isPerCellFaceResult( eclipseResDef->resultVariable() ) )
|
if ( !RiaDefines::isPerCellFaceResult( eclipseResDef->resultVariable() ) )
|
||||||
{
|
|
||||||
resultAccessor = new RigHugeValResultAccessor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData,
|
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData,
|
||||||
0,
|
0,
|
||||||
@@ -184,6 +181,11 @@ void RivIntersectionResultsColoringTools::updateEclipseCellResultColors(
|
|||||||
eclipseResDef );
|
eclipseResDef );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( resultAccessor.isNull() )
|
||||||
|
{
|
||||||
|
resultAccessor = new RigHugeValResultAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( intersectionFacesTextureCoords,
|
RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( intersectionFacesTextureCoords,
|
||||||
triangleToCellIndexMapping,
|
triangleToCellIndexMapping,
|
||||||
resultAccessor.p(),
|
resultAccessor.p(),
|
||||||
|
|||||||
@@ -792,15 +792,10 @@ void RimEclipseView::updateVisibleGeometriesAndCellColors()
|
|||||||
|
|
||||||
this->updateFaultColors();
|
this->updateFaultColors();
|
||||||
|
|
||||||
if ( ( this->hasUserRequestedAnimation() && this->cellResult()->hasResult() ) ||
|
m_intersectionCollection->updateCellResultColor( ( this->hasUserRequestedAnimation() &&
|
||||||
this->cellResult()->isTernarySaturationSelected() )
|
this->cellResult()->hasResult() ) ||
|
||||||
{
|
this->cellResult()->isTernarySaturationSelected(),
|
||||||
m_intersectionCollection->updateCellResultColor( m_currentTimeStep );
|
m_currentTimeStep );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_intersectionCollection->applySingleColorEffect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -383,19 +383,13 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
|||||||
else
|
else
|
||||||
m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
|
m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
|
||||||
|
|
||||||
if ( this->cellResult()->hasResult() )
|
m_intersectionCollection->updateCellResultColor( this->cellResult()->hasResult(), m_currentTimeStep );
|
||||||
{
|
|
||||||
m_intersectionCollection->updateCellResultColor( m_currentTimeStep );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_intersectionCollection->applySingleColorEffect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_vizLogic->updateStaticCellColors( -1 );
|
m_vizLogic->updateStaticCellColors( -1 );
|
||||||
m_intersectionCollection->applySingleColorEffect();
|
|
||||||
|
m_intersectionCollection->updateCellResultColor( false, m_currentTimeStep );
|
||||||
|
|
||||||
nativeOrOverrideViewer()->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
nativeOrOverrideViewer()->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "RivBoxIntersectionPartMgr.h"
|
#include "RivBoxIntersectionPartMgr.h"
|
||||||
#include "RivExtrudedCurveIntersectionPartMgr.h"
|
#include "RivExtrudedCurveIntersectionPartMgr.h"
|
||||||
|
|
||||||
|
#include "RimIntersectionResultDefinition.h"
|
||||||
#include "cvfModelBasicList.h"
|
#include "cvfModelBasicList.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "CrossSectionCollection" );
|
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "CrossSectionCollection" );
|
||||||
@@ -97,24 +98,42 @@ void RimIntersectionCollection::applySingleColorEffect()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimIntersectionCollection::updateCellResultColor( size_t timeStepIndex )
|
void RimIntersectionCollection::updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex )
|
||||||
{
|
{
|
||||||
if ( !this->isActive() ) return;
|
if ( !this->isActive() ) return;
|
||||||
|
|
||||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||||
{
|
{
|
||||||
if ( cs->isActive() )
|
if ( cs->isActive() )
|
||||||
|
{
|
||||||
|
bool hasSeparateInterResult = cs->activeSeparateResultDefinition() &&
|
||||||
|
cs->activeSeparateResultDefinition()->hasResult();
|
||||||
|
if ( hasSeparateInterResult || hasGeneralCellResult )
|
||||||
{
|
{
|
||||||
cs->intersectionPartMgr()->updateCellResultColor( timeStepIndex, nullptr, nullptr );
|
cs->intersectionPartMgr()->updateCellResultColor( timeStepIndex, nullptr, nullptr );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cs->intersectionPartMgr()->applySingleColorEffect();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( RimBoxIntersection* cs : m_intersectionBoxes )
|
for ( RimBoxIntersection* cs : m_intersectionBoxes )
|
||||||
{
|
{
|
||||||
if ( cs->isActive() )
|
if ( cs->isActive() )
|
||||||
|
{
|
||||||
|
bool hasSeparateInterResult = cs->activeSeparateResultDefinition() &&
|
||||||
|
cs->activeSeparateResultDefinition()->hasResult();
|
||||||
|
if ( hasSeparateInterResult || hasGeneralCellResult )
|
||||||
{
|
{
|
||||||
cs->intersectionBoxPartMgr()->updateCellResultColor( timeStepIndex );
|
cs->intersectionBoxPartMgr()->updateCellResultColor( timeStepIndex );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cs->intersectionBoxPartMgr()->applySingleColorEffect();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
// Visualization interface
|
// Visualization interface
|
||||||
|
|
||||||
void applySingleColorEffect();
|
void applySingleColorEffect();
|
||||||
void updateCellResultColor( size_t timeStepIndex );
|
void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex );
|
||||||
void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
|
void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
|
||||||
void rebuildGeometry();
|
void rebuildGeometry();
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,13 @@ QString RimIntersectionResultDefinition::autoName() const
|
|||||||
QString timestepName;
|
QString timestepName;
|
||||||
QString caseName = "Default undefined source";
|
QString caseName = "Default undefined source";
|
||||||
|
|
||||||
|
if ( !m_case )
|
||||||
|
{
|
||||||
|
RimCase* ownerCase = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType( ownerCase );
|
||||||
|
const_cast<RimIntersectionResultDefinition*>( this )->setActiveCase( ownerCase );
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_case )
|
if ( m_case )
|
||||||
{
|
{
|
||||||
QStringList timestepNames = m_case->timeStepStrings();
|
QStringList timestepNames = m_case->timeStepStrings();
|
||||||
@@ -133,6 +140,19 @@ RimCase* RimIntersectionResultDefinition::activeCase() const
|
|||||||
return m_case();
|
return m_case();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimIntersectionResultDefinition::setActiveCase( RimCase* activeCase )
|
||||||
|
{
|
||||||
|
m_case = activeCase;
|
||||||
|
|
||||||
|
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
|
||||||
|
m_geomResultDefinition->setGeoMechCase( geomCase );
|
||||||
|
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_case.value() );
|
||||||
|
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -141,6 +161,21 @@ int RimIntersectionResultDefinition::timeStep() const
|
|||||||
return m_timeStep();
|
return m_timeStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RimIntersectionResultDefinition::hasResult()
|
||||||
|
{
|
||||||
|
if ( isEclipseResultDefinition() )
|
||||||
|
{
|
||||||
|
return m_eclipseResultDefinition->hasResult() || m_eclipseResultDefinition->isTernarySaturationSelected();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return m_geomResultDefinition->hasResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ public:
|
|||||||
bool isInAction() const;
|
bool isInAction() const;
|
||||||
QString autoName() const;
|
QString autoName() const;
|
||||||
RimCase* activeCase() const;
|
RimCase* activeCase() const;
|
||||||
|
void setActiveCase( RimCase* activeCase );
|
||||||
bool isEclipseResultDefinition();
|
bool isEclipseResultDefinition();
|
||||||
int timeStep() const;
|
int timeStep() const;
|
||||||
|
bool hasResult();
|
||||||
|
|
||||||
RimRegularLegendConfig* regularLegendConfig() const;
|
RimRegularLegendConfig* regularLegendConfig() const;
|
||||||
RimTernaryLegendConfig* ternaryLegendConfig() const;
|
RimTernaryLegendConfig* ternaryLegendConfig() const;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||||
|
|
||||||
|
#include "RimCase.h"
|
||||||
#include "RimGridView.h"
|
#include "RimGridView.h"
|
||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
#include "RimIntersectionResultDefinition.h"
|
#include "RimIntersectionResultDefinition.h"
|
||||||
@@ -48,7 +49,7 @@ RimIntersectionResultsDefinitionCollection::~RimIntersectionResultsDefinitionCol
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimIntersectionResultsDefinitionCollection::isActive()
|
bool RimIntersectionResultsDefinitionCollection::isActive() const
|
||||||
{
|
{
|
||||||
return m_isActive();
|
return m_isActive();
|
||||||
}
|
}
|
||||||
@@ -56,7 +57,8 @@ bool RimIntersectionResultsDefinitionCollection::isActive()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector<RimIntersectionResultDefinition*> RimIntersectionResultsDefinitionCollection::intersectionResultsDefinitions()
|
std::vector<RimIntersectionResultDefinition*>
|
||||||
|
RimIntersectionResultsDefinitionCollection::intersectionResultsDefinitions() const
|
||||||
{
|
{
|
||||||
return m_intersectionResultsDefs.childObjects();
|
return m_intersectionResultsDefs.childObjects();
|
||||||
}
|
}
|
||||||
@@ -68,6 +70,13 @@ void RimIntersectionResultsDefinitionCollection::appendIntersectionResultDefinit
|
|||||||
RimIntersectionResultDefinition* interResDef )
|
RimIntersectionResultDefinition* interResDef )
|
||||||
{
|
{
|
||||||
m_intersectionResultsDefs.push_back( interResDef );
|
m_intersectionResultsDefs.push_back( interResDef );
|
||||||
|
|
||||||
|
if ( interResDef->activeCase() == nullptr )
|
||||||
|
{
|
||||||
|
RimCase* ownerCase = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType( ownerCase );
|
||||||
|
interResDef->setActiveCase( ownerCase );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ public:
|
|||||||
RimIntersectionResultsDefinitionCollection();
|
RimIntersectionResultsDefinitionCollection();
|
||||||
~RimIntersectionResultsDefinitionCollection() override;
|
~RimIntersectionResultsDefinitionCollection() override;
|
||||||
|
|
||||||
bool isActive();
|
bool isActive() const;
|
||||||
|
|
||||||
std::vector<RimIntersectionResultDefinition*> intersectionResultsDefinitions();
|
std::vector<RimIntersectionResultDefinition*> intersectionResultsDefinitions() const;
|
||||||
|
|
||||||
void appendIntersectionResultDefinition( RimIntersectionResultDefinition* interResDef );
|
void appendIntersectionResultDefinition( RimIntersectionResultDefinition* interResDef );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user