mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
|
||||
void clearGeometry();
|
||||
RivSurfacePartMgr* surfacePartMgr();
|
||||
RivSurfacePartMgr* nativeSurfacePartMgr();
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user