Add seismic 3d view (#10472)

* Show seismic, surfaces, annotations and wellpaths in new view not requiring a grid loaded first.
This commit is contained in:
jonjenssen
2023-08-07 16:35:59 +02:00
committed by GitHub
parent 5bf2c2a89d
commit 2172199999
73 changed files with 1520 additions and 299 deletions

View File

@@ -299,18 +299,15 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
{
RimProject* proj = RimProject::current();
// Make sure the tree items are synchronized
std::vector<Rim3dView*> views;
proj->allViews( views );
// Make sure the tree items are synchronized
for ( auto view : views )
{
auto gridView = dynamic_cast<RimGridView*>( view );
if ( gridView ) gridView->updateSurfacesInViewTreeItems();
view->updateSurfacesInViewTreeItems();
}
std::set<RimGridView*> viewsNeedingUpdate;
std::set<Rim3dView*> viewsNeedingUpdate;
for ( auto surf : surfsToReload )
{
@@ -320,7 +317,7 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
surfInView->clearGeometry();
surfInView->surfaceResultDefinition()->legendConfig()->setShowLegend( showLegend );
auto gridView = surfInView->firstAncestorOrThisOfType<RimGridView>();
auto gridView = surfInView->firstAncestorOrThisOfType<Rim3dView>();
if ( gridView ) viewsNeedingUpdate.insert( gridView );
}
}
@@ -346,9 +343,9 @@ void RimSurfaceCollection::updateViews( const std::vector<RimSurface*>& surfsToR
//--------------------------------------------------------------------------------------------------
void RimSurfaceCollection::updateViews()
{
RimProject* proj = RimProject::current();
std::vector<RimGridView*> views;
proj->allVisibleGridViews( views );
RimProject* proj = RimProject::current();
std::vector<Rim3dView*> views;
proj->allViews( views );
// Make sure the tree items are synchronized

View File

@@ -141,6 +141,20 @@ RivSurfacePartMgr* RimSurfaceInView::surfacePartMgr()
return m_surfacePartMgr.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivSurfacePartMgr* RimSurfaceInView::nativeSurfacePartMgr()
{
bool nativeOnly = true;
if ( m_surfacePartMgr.isNull() || !m_surfacePartMgr->isNativePartMgr() )
{
m_surfacePartMgr = new RivSurfacePartMgr( this, nativeOnly );
}
return m_surfacePartMgr.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -221,7 +235,7 @@ void RimSurfaceInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField
if ( scheduleRedraw )
{
auto ownerView = firstAncestorOrThisOfTypeAsserted<RimGridView>();
auto ownerView = firstAncestorOrThisOfTypeAsserted<Rim3dView>();
ownerView->scheduleCreateDisplayModelAndRedraw();
}
}
@@ -242,8 +256,12 @@ void RimSurfaceInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
//--------------------------------------------------------------------------------------------------
RimIntersectionResultsDefinitionCollection* RimSurfaceInView::findSeparateResultsCollection()
{
auto view = firstAncestorOrThisOfTypeAsserted<RimGridView>();
return view->separateSurfaceResultsCollection();
auto view = firstAncestorOrThisOfType<RimGridView>();
if ( view )
{
return view->separateSurfaceResultsCollection();
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -53,6 +53,7 @@ public:
void clearGeometry();
RivSurfacePartMgr* surfacePartMgr();
RivSurfacePartMgr* nativeSurfacePartMgr();
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
void loadDataAndUpdate();

View File

@@ -18,6 +18,7 @@
#include "RimSurfaceInViewCollection.h"
#include "Rim3dView.h"
#include "RimEnsembleSurface.h"
#include "RimGridView.h"
#include "RimIntersectionResultDefinition.h"
@@ -51,7 +52,7 @@ RimSurfaceInViewCollection::RimSurfaceInViewCollection()
CAF_PDM_InitFieldNoDefault( &m_collectionsInView, "SurfacesInViewFieldCollections", "SurfacesInViewFieldCollections" );
m_collectionsInView.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "SurfacesInViewField" );
CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "Surfaces" );
m_surfacesInView.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitFieldNoDefault( &m_surfaceCollection, "SurfaceCollectionRef", "SurfaceCollection" );
@@ -279,7 +280,7 @@ void RimSurfaceInViewCollection::clearGeometry()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform, bool onlyNativeParts )
{
if ( !isChecked() ) return;
@@ -287,7 +288,7 @@ void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model,
{
if ( coll->isChecked() )
{
coll->appendPartsToModel( model, scaleTransform );
coll->appendPartsToModel( model, scaleTransform, onlyNativeParts );
}
}
@@ -295,7 +296,14 @@ void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model,
{
if ( surf->isActive() )
{
surf->surfacePartMgr()->appendIntersectionGeometryPartsToModel( model, scaleTransform );
if ( onlyNativeParts )
{
surf->nativeSurfacePartMgr()->appendNativeGeometryPartsToModel( model, scaleTransform );
}
else
{
surf->surfacePartMgr()->appendIntersectionGeometryPartsToModel( model, scaleTransform );
}
}
}
@@ -311,7 +319,7 @@ void RimSurfaceInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( changedField == &m_isChecked )
{
auto ownerView = firstAncestorOrThisOfTypeAsserted<RimGridView>();
auto ownerView = firstAncestorOrThisOfTypeAsserted<Rim3dView>();
ownerView->scheduleCreateDisplayModelAndRedraw();
}
}

View File

@@ -57,7 +57,7 @@ public:
void loadData();
void clearGeometry();
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform );
void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform, bool onlyNativeParts = false );
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
void applySingleColorEffect();