mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5316 Prototype of results mapping on native surface nodes only
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
#include "RimGridView.h"
|
||||
#include "RimSurface.h"
|
||||
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
#include "RivSurfacePartMgr.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimSurfaceInView, "SurfaceInView" );
|
||||
@@ -134,3 +138,53 @@ caf::PdmFieldHandle* RimSurfaceInView::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RivIntersectionHexGridInterface> RimSurfaceInView::createHexGridInterface()
|
||||
{
|
||||
// RimIntersectionResultDefinition* resDef = activeSeparateResultDefinition();
|
||||
// if ( resDef && resDef->activeCase() )
|
||||
//{
|
||||
// // Eclipse case
|
||||
//
|
||||
// RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( resDef->activeCase() );
|
||||
// if ( eclipseCase && eclipseCase->eclipseCaseData() )
|
||||
// {
|
||||
// return new RivEclipseIntersectionGrid( eclipseCase->eclipseCaseData()->mainGrid(),
|
||||
// eclipseCase->eclipseCaseData()->activeCellInfo(
|
||||
// resDef->eclipseResultDefinition()->porosityModel() ),
|
||||
// this->isInactiveCellsVisible() );
|
||||
// }
|
||||
//
|
||||
// // Geomech case
|
||||
//
|
||||
// RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( resDef->activeCase() );
|
||||
//
|
||||
// if ( geomCase && geomCase->geoMechData() && geomCase->geoMechData()->femParts() )
|
||||
// {
|
||||
// RigFemPart* femPart = geomCase->geoMechData()->femParts()->part( 0 );
|
||||
// return new RivFemIntersectionGrid( femPart );
|
||||
// }
|
||||
//}
|
||||
|
||||
RimEclipseView* eclipseView;
|
||||
this->firstAncestorOrThisOfType( eclipseView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
RigMainGrid* grid = eclipseView->mainGrid();
|
||||
return new RivEclipseIntersectionGrid( grid, eclipseView->currentActiveCellInfo(), true );
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
this->firstAncestorOrThisOfType( geoView );
|
||||
if ( geoView && geoView->femParts() && geoView->femParts()->partCount() )
|
||||
{
|
||||
RigFemPart* femPart = geoView->femParts()->part( 0 );
|
||||
|
||||
return new RivFemIntersectionGrid( femPart );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
class RimSurface;
|
||||
class RivSurfacePartMgr;
|
||||
class RivIntersectionHexGridInterface;
|
||||
|
||||
class RimSurfaceInView : public caf::PdmObject
|
||||
{
|
||||
@@ -45,10 +46,12 @@ public:
|
||||
void clearGeometry();
|
||||
RivSurfacePartMgr* surfacePartMgr();
|
||||
|
||||
cvf::ref<RivIntersectionHexGridInterface> createHexGridInterface();
|
||||
|
||||
private:
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
|
||||
|
||||
@@ -147,3 +147,28 @@ caf::PdmFieldHandle* RimSurfaceInViewCollection::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurfaceInViewCollection::updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex )
|
||||
{
|
||||
if ( !this->m_isActive() ) return;
|
||||
|
||||
for ( RimSurfaceInView* surf : m_surfacesInView )
|
||||
{
|
||||
if ( surf->isActive() )
|
||||
{
|
||||
bool hasSeparateInterResult = false; // surf->activeSeparateResultDefinition() &&
|
||||
// surf->activeSeparateResultDefinition()->hasResult();
|
||||
if ( hasSeparateInterResult || hasGeneralCellResult )
|
||||
{
|
||||
surf->surfacePartMgr()->updateCellResultColor( timeStepIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
surf->surfacePartMgr()->applySingleColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
void updateFromSurfaceCollection();
|
||||
|
||||
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform );
|
||||
void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex );
|
||||
|
||||
private:
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
|
||||
Reference in New Issue
Block a user