mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user