mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5351 from OPM/feature-reservoir-surface-results
Feature reservoir surface results
This commit is contained in:
@@ -544,7 +544,7 @@ void Rim2dIntersectionView::onCreateDisplayModel()
|
||||
|
||||
m_intersectionVizModel->removeAllParts();
|
||||
|
||||
m_flatIntersectionPartMgr->appendNativeIntersectionFacesToModel( m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_flatIntersectionPartMgr->appendIntersectionFacesToModel( m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_flatIntersectionPartMgr->appendMeshLinePartsToModel( m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_flatIntersectionPartMgr->appendPolylinePartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@ RimBoxIntersection::RimBoxIntersection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Intersection Box", ":/IntersectionBox16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_singlePlaneState,
|
||||
"singlePlaneState",
|
||||
caf::AppEnum<SinglePlaneState>( SinglePlaneState::PLANE_STATE_NONE ),
|
||||
@@ -100,6 +102,30 @@ RimBoxIntersection::~RimBoxIntersection()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimBoxIntersection::userDescriptionField()
|
||||
{
|
||||
return &m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimBoxIntersection::name() const
|
||||
{
|
||||
return m_name();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimBoxIntersection::setName( const QString& newName )
|
||||
{
|
||||
m_name = newName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -62,6 +62,9 @@ public:
|
||||
RimBoxIntersection();
|
||||
~RimBoxIntersection() override;
|
||||
|
||||
QString name() const override;
|
||||
void setName( const QString& newName );
|
||||
|
||||
cvf::Mat4d boxOrigin() const;
|
||||
cvf::Vec3d boxSize() const;
|
||||
SinglePlaneState singlePlaneState() const;
|
||||
@@ -76,6 +79,8 @@ public:
|
||||
void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position );
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override final;
|
||||
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
@@ -105,6 +110,8 @@ private:
|
||||
RiuViewer* viewer();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
|
||||
caf::PdmField<caf::AppEnum<SinglePlaneState>> m_singlePlaneState;
|
||||
|
||||
caf::PdmField<double> m_minXCoord;
|
||||
|
||||
@@ -803,10 +803,11 @@ void RimEclipseView::updateVisibleGeometriesAndCellColors()
|
||||
|
||||
this->updateFaultColors();
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( ( this->hasUserRequestedAnimation() &&
|
||||
this->cellResult()->hasResult() ) ||
|
||||
this->cellResult()->isTernarySaturationSelected(),
|
||||
m_currentTimeStep );
|
||||
bool hasGeneralCellResult = ( this->hasUserRequestedAnimation() && this->cellResult()->hasResult() ) ||
|
||||
this->cellResult()->isTernarySaturationSelected();
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
if ( m_surfaceCollection ) m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -890,6 +891,8 @@ void RimEclipseView::appendWellsAndFracturesToModel()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseView::onLoadDataAndUpdate()
|
||||
{
|
||||
this->updateSurfacesInViewTreeItems();
|
||||
|
||||
onUpdateScaleTransform();
|
||||
|
||||
if ( m_eclipseCase )
|
||||
@@ -1738,6 +1741,8 @@ void RimEclipseView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
uiTreeOrdering.add( cellEdgeResult() );
|
||||
uiTreeOrdering.add( faultResultSettings() );
|
||||
uiTreeOrdering.add( &m_intersectionResultDefCollection );
|
||||
uiTreeOrdering.add( &m_surfaceResultDefCollection );
|
||||
|
||||
uiTreeOrdering.add( wellCollection() );
|
||||
uiTreeOrdering.add( &m_wellMeasurementCollection );
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ CAF_PDM_SOURCE_INIT( RimExtrudedCurveIntersection, "CrossSection" );
|
||||
RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Intersection", ":/CrossSection16x16.png", "", "" );
|
||||
CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &type, "Type", "Type", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &direction, "Direction", "Direction", "", "", "" );
|
||||
@@ -139,6 +140,30 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimExtrudedCurveIntersection::~RimExtrudedCurveIntersection() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimExtrudedCurveIntersection::userDescriptionField()
|
||||
{
|
||||
return &m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimExtrudedCurveIntersection::name() const
|
||||
{
|
||||
return m_name();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::setName( const QString& newName )
|
||||
{
|
||||
m_name = newName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -81,6 +81,9 @@ public:
|
||||
caf::PdmField<bool> inputExtrusionPointsFromViewerEnabled;
|
||||
caf::PdmField<bool> inputTwoAzimuthPointsFromViewerEnabled;
|
||||
|
||||
QString name() const override;
|
||||
void setName( const QString& newName );
|
||||
|
||||
std::vector<std::vector<cvf::Vec3d>> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const;
|
||||
void appendPointToPolyLine( const cvf::Vec3d& point );
|
||||
|
||||
@@ -106,6 +109,7 @@ public:
|
||||
void rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override final;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
@@ -117,6 +121,8 @@ protected:
|
||||
bool* useOptionsOnly ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
|
||||
caf::PdmField<int> m_branchIndex;
|
||||
caf::PdmField<double> m_extentLength;
|
||||
caf::PdmField<double> m_azimuthAngle;
|
||||
|
||||
@@ -131,8 +131,11 @@ void RimGeoMechView::onLoadDataAndUpdate()
|
||||
{
|
||||
caf::ProgressInfo progress( 7, "" );
|
||||
progress.setNextProgressIncrement( 5 );
|
||||
|
||||
onUpdateScaleTransform();
|
||||
|
||||
this->updateSurfacesInViewTreeItems();
|
||||
|
||||
if ( m_geomechCase )
|
||||
{
|
||||
std::string errorMessage;
|
||||
@@ -395,13 +398,20 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
else
|
||||
m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( this->cellResult()->hasResult(), m_currentTimeStep );
|
||||
bool hasGeneralCellResult = this->cellResult()->hasResult();
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
if ( m_surfaceCollection )
|
||||
{
|
||||
m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vizLogic->updateStaticCellColors( -1 );
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( false, m_currentTimeStep );
|
||||
if ( m_surfaceCollection ) m_surfaceCollection->updateCellResultColor( false, m_currentTimeStep );
|
||||
|
||||
nativeOrOverrideViewer()->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||
}
|
||||
@@ -914,6 +924,7 @@ void RimGeoMechView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
uiTreeOrdering.add( cellResult() );
|
||||
uiTreeOrdering.add( m_tensorResults() );
|
||||
uiTreeOrdering.add( &m_intersectionResultDefCollection );
|
||||
uiTreeOrdering.add( &m_surfaceResultDefCollection );
|
||||
uiTreeOrdering.add( &m_wellMeasurementCollection );
|
||||
|
||||
uiTreeOrdering.add( m_intersectionCollection() );
|
||||
|
||||
@@ -87,6 +87,17 @@ RimGridView::RimGridView()
|
||||
m_intersectionResultDefCollection.uiCapability()->setUiTreeHidden( true );
|
||||
m_intersectionResultDefCollection = new RimIntersectionResultsDefinitionCollection;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfaceResultDefCollection,
|
||||
"ReservoirSurfaceResultDefColl",
|
||||
"Separate Surface Results",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
m_surfaceResultDefCollection.uiCapability()->setUiTreeHidden( true );
|
||||
m_surfaceResultDefCollection = new RimIntersectionResultsDefinitionCollection;
|
||||
m_surfaceResultDefCollection->uiCapability()->setUiName( "Separate Surface Results" );
|
||||
m_surfaceResultDefCollection->uiCapability()->setUiIcon( caf::QIconProvider( ":/ReservoirSurface16x16.png" ) );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gridCollection, "GridCollection", "GridCollection", "", "", "" );
|
||||
m_gridCollection.uiCapability()->setUiHidden( true );
|
||||
m_gridCollection = new RimGridCollection();
|
||||
@@ -208,6 +219,14 @@ RimIntersectionResultsDefinitionCollection* RimGridView::separateIntersectionRes
|
||||
return m_intersectionResultDefCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionResultsDefinitionCollection* RimGridView::separateSurfaceResultsCollection() const
|
||||
{
|
||||
return m_surfaceResultDefCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
RimIntersectionCollection* intersectionCollection() const;
|
||||
RimSurfaceInViewCollection* surfaceInViewCollection() const;
|
||||
RimIntersectionResultsDefinitionCollection* separateIntersectionResultsCollection() const;
|
||||
RimIntersectionResultsDefinitionCollection* separateSurfaceResultsCollection() const;
|
||||
RimAnnotationInViewCollection* annotationCollection() const;
|
||||
RimWellMeasurementInViewCollection* measurementCollection() const;
|
||||
|
||||
@@ -96,6 +97,7 @@ protected:
|
||||
caf::PdmChildField<RimIntersectionCollection*> m_intersectionCollection;
|
||||
|
||||
caf::PdmChildField<RimIntersectionResultsDefinitionCollection*> m_intersectionResultDefCollection;
|
||||
caf::PdmChildField<RimIntersectionResultsDefinitionCollection*> m_surfaceResultDefCollection;
|
||||
|
||||
caf::PdmChildField<Rim3dOverlayInfoConfig*> m_overlayInfoConfig;
|
||||
caf::PdmChildField<RimCellRangeFilterCollection*> m_rangeFilterCollection;
|
||||
|
||||
@@ -31,14 +31,13 @@
|
||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimIntersection, "RimIntersectionHandle" );
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT( RimIntersection, "RimIntersectionHandle" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersection::RimIntersection()
|
||||
{
|
||||
CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" );
|
||||
CAF_PDM_InitField( &m_isActive, "Active", true, "Active", "", "", "" );
|
||||
m_isActive.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "" );
|
||||
@@ -51,22 +50,6 @@ RimIntersection::RimIntersection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersection::~RimIntersection() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimIntersection::name() const
|
||||
{
|
||||
return m_name();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersection::setName( const QString& newName )
|
||||
{
|
||||
m_name = newName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -104,10 +87,9 @@ RimIntersectionResultDefinition* RimIntersection::activeSeparateResultDefinition
|
||||
|
||||
if ( !m_separateDataSource->isActive() ) return nullptr;
|
||||
|
||||
RimGridView* view;
|
||||
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||
if ( !findSeparateResultsCollection() ) return nullptr;
|
||||
|
||||
if ( !view->separateIntersectionResultsCollection()->isActive() ) return nullptr;
|
||||
if ( !findSeparateResultsCollection()->isActive() ) return nullptr;
|
||||
|
||||
return m_separateDataSource;
|
||||
}
|
||||
@@ -122,11 +104,8 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
||||
|
||||
if ( fieldNeedingOptions == &m_separateDataSource )
|
||||
{
|
||||
RimGridView* view;
|
||||
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||
|
||||
std::vector<RimIntersectionResultDefinition*> iResDefs =
|
||||
view->separateIntersectionResultsCollection()->intersectionResultsDefinitions();
|
||||
findSeparateResultsCollection()->intersectionResultsDefinitions();
|
||||
|
||||
for ( auto iresdef : iResDefs )
|
||||
{
|
||||
@@ -140,9 +119,11 @@ QList<caf::PdmOptionItemInfo> RimIntersection::calculateValueOptions( const caf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimIntersection::userDescriptionField()
|
||||
RimIntersectionResultsDefinitionCollection* RimIntersection::findSeparateResultsCollection()
|
||||
{
|
||||
return &m_name;
|
||||
RimGridView* view;
|
||||
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||
return view->separateIntersectionResultsCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -188,18 +169,12 @@ void RimIntersection::updateDefaultSeparateDataSource()
|
||||
{
|
||||
if ( m_separateDataSource() == nullptr )
|
||||
{
|
||||
RimGridView* view;
|
||||
this->firstAncestorOrThisOfType( view );
|
||||
std::vector<RimIntersectionResultDefinition*> iResDefs =
|
||||
findSeparateResultsCollection()->intersectionResultsDefinitions();
|
||||
|
||||
if ( view )
|
||||
if ( iResDefs.size() )
|
||||
{
|
||||
std::vector<RimIntersectionResultDefinition*> iResDefs =
|
||||
view->separateIntersectionResultsCollection()->intersectionResultsDefinitions();
|
||||
|
||||
if ( iResDefs.size() )
|
||||
{
|
||||
m_separateDataSource = iResDefs[0];
|
||||
}
|
||||
m_separateDataSource = iResDefs[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
class RimIntersectionResultDefinition;
|
||||
class RivIntersectionHexGridInterface;
|
||||
class RimIntersectionResultsDefinitionCollection;
|
||||
|
||||
class RimIntersection : public caf::PdmObject
|
||||
{
|
||||
@@ -35,17 +36,18 @@ public:
|
||||
RimIntersection();
|
||||
~RimIntersection() override;
|
||||
|
||||
QString name() const;
|
||||
void setName( const QString& newName );
|
||||
bool isActive() const;
|
||||
void setActive( bool isActive );
|
||||
bool isInactiveCellsVisible() const;
|
||||
virtual QString name() const = 0;
|
||||
|
||||
bool isActive() const;
|
||||
void setActive( bool isActive );
|
||||
bool isInactiveCellsVisible() const;
|
||||
|
||||
RimIntersectionResultDefinition* activeSeparateResultDefinition();
|
||||
cvf::ref<RivIntersectionHexGridInterface> createHexGridInterface();
|
||||
|
||||
protected:
|
||||
caf::PdmFieldHandle* userDescriptionField() override final;
|
||||
virtual RimIntersectionResultsDefinitionCollection* findSeparateResultsCollection();
|
||||
|
||||
caf::PdmFieldHandle* objectToggleField() override final;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
@@ -54,7 +56,6 @@ protected:
|
||||
void defineSeparateDataSourceUi( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
void updateDefaultSeparateDataSource();
|
||||
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmField<bool> m_showInactiveCells;
|
||||
caf::PdmField<bool> m_useSeparateDataSource;
|
||||
|
||||
@@ -150,7 +150,7 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view,
|
||||
{
|
||||
if ( cs->isActive() )
|
||||
{
|
||||
cs->intersectionPartMgr()->appendNativeIntersectionFacesToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendIntersectionFacesToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendMeshLinePartsToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
|
||||
}
|
||||
|
||||
@@ -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" );
|
||||
@@ -32,11 +36,9 @@ RimSurfaceInView::RimSurfaceInView()
|
||||
{
|
||||
CAF_PDM_InitObject( "Surface", ":/ReservoirSurface16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_isActive, "IsActive", true, "Visible", "", "", "" );
|
||||
m_isActive.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_name, "Name", "Name", "", "", "" );
|
||||
m_name.registerGetMethod( this, &RimSurfaceInView::name );
|
||||
m_name.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_surface, "SurfaceRef", "Surface", "", "", "" );
|
||||
m_surface.uiCapability()->setUiHidden( true );
|
||||
@@ -57,11 +59,6 @@ QString RimSurfaceInView::name() const
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurfaceInView::loadDataAndUpdate() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -78,14 +75,6 @@ void RimSurfaceInView::setSurface( RimSurface* surf )
|
||||
m_surface = surf;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSurfaceInView::isActive()
|
||||
{
|
||||
return m_isActive();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -117,6 +106,37 @@ void RimSurfaceInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
this->firstAncestorOrThisOfTypeAsserted( ownerView );
|
||||
ownerView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
else if ( changedField == &m_showInactiveCells )
|
||||
{
|
||||
m_surfacePartMgr = nullptr;
|
||||
RimGridView* ownerView;
|
||||
this->firstAncestorOrThisOfTypeAsserted( ownerView );
|
||||
ownerView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSurfaceInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_name );
|
||||
|
||||
uiOrdering.add( &m_showInactiveCells );
|
||||
|
||||
this->defineSeparateDataSourceUi( uiConfigName, uiOrdering );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimIntersectionResultsDefinitionCollection* RimSurfaceInView::findSeparateResultsCollection()
|
||||
{
|
||||
RimGridView* view;
|
||||
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||
return view->separateSurfaceResultsCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -126,11 +146,3 @@ caf::PdmFieldHandle* RimSurfaceInView::userDescriptionField()
|
||||
{
|
||||
return &m_name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimSurfaceInView::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
|
||||
@@ -24,10 +24,14 @@
|
||||
|
||||
#include "cvfObject.h"
|
||||
|
||||
class RimSurface;
|
||||
class RivSurfacePartMgr;
|
||||
#include "RimIntersection.h"
|
||||
|
||||
class RimSurfaceInView : public caf::PdmObject
|
||||
class RimSurface;
|
||||
|
||||
class RivSurfacePartMgr;
|
||||
class RivIntersectionHexGridInterface;
|
||||
|
||||
class RimSurfaceInView : public RimIntersection
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
@@ -35,25 +39,23 @@ public:
|
||||
RimSurfaceInView();
|
||||
~RimSurfaceInView() override;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
||||
QString name() const;
|
||||
QString name() const override;
|
||||
RimSurface* surface() const;
|
||||
void setSurface( RimSurface* surf );
|
||||
bool isActive();
|
||||
|
||||
void clearGeometry();
|
||||
RivSurfacePartMgr* surfacePartMgr();
|
||||
|
||||
private:
|
||||
virtual RimIntersectionResultsDefinitionCollection* findSeparateResultsCollection() override;
|
||||
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue ) override;
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
caf::PdmProxyValueField<QString> m_name;
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmPtrField<RimSurface*> m_surface;
|
||||
|
||||
cvf::ref<RivSurfacePartMgr> m_surfacePartMgr;
|
||||
|
||||
@@ -102,7 +102,8 @@ void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model,
|
||||
{
|
||||
if ( surf->isActive() )
|
||||
{
|
||||
surf->surfacePartMgr()->appendNativeGeometryPartsToModel( model, scaleTransform );
|
||||
// surf->surfacePartMgr()->appendNativeGeometryPartsToModel( model, scaleTransform );
|
||||
surf->surfacePartMgr()->appendIntersectionGeometryPartsToModel( model, scaleTransform );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,3 +148,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