( m_viewDef.p() );
+ if ( seisView ) return caseInfoText( seisView );
+
return "";
}
@@ -394,6 +406,36 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimGeoMechView* geoMechView )
return infoText;
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+QString Rim3dOverlayInfoConfig::caseInfoText( RimSeismicView* seisView )
+{
+ QString infoText;
+
+ if ( seisView )
+ {
+ auto seisData = seisView->seismicData();
+
+ if ( seisData )
+ {
+ QString depthRange = QString( "%1 to %2" ).arg( seisData->zMin() ).arg( seisData->zMax() );
+ QString zScale = QString::number( seisView->scaleZ() );
+ QString ilineRange = QString( "%1 to %2" ).arg( seisData->inlineMin() ).arg( seisData->inlineMax() );
+ QString xlineRange = QString( "%1 to %2" ).arg( seisData->xlineMin() ).arg( seisData->xlineMax() );
+ QString seisName = QString::fromStdString( seisData->userDescription() );
+
+ infoText = QString( "-- %1 --
"
+ "Depth Range: %2 Z-Scale: %3
"
+ "Inline Range: %4
"
+ "Xline Range: %5
" )
+ .arg( seisName, depthRange, zScale, ilineRange, xlineRange );
+ }
+ }
+
+ return infoText;
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -669,7 +711,8 @@ QString Rim3dOverlayInfoConfig::resultInfoText( const RigHistogramData& histData
//--------------------------------------------------------------------------------------------------
void Rim3dOverlayInfoConfig::showStatisticsInfoDialog( bool raise )
{
- if ( m_viewDef )
+ auto gridView = dynamic_cast( m_viewDef.p() );
+ if ( gridView )
{
RicGridStatisticsDialog* dialog = getOrCreateGridStatisticsDialog();
// Show dialog before setting data due to text edit auto height setting
@@ -677,7 +720,7 @@ void Rim3dOverlayInfoConfig::showStatisticsInfoDialog( bool raise )
dialog->show();
dialog->setLabel( "Grid statistics" );
- dialog->updateFromRimView( m_viewDef );
+ dialog->updateFromRimView( gridView );
if ( raise )
{
@@ -735,7 +778,6 @@ void Rim3dOverlayInfoConfig::update3DInfo()
}
RimGeoMechView* geoMechView = dynamic_cast( m_viewDef.p() );
-
if ( geoMechView )
{
m_showVolumeWeightedMean = false;
@@ -746,6 +788,15 @@ void Rim3dOverlayInfoConfig::update3DInfo()
getOrCreateGridStatisticsDialog()->updateFromRimView( geoMechView );
}
+ RimSeismicView* seisView = dynamic_cast( m_viewDef.p() );
+ if ( seisView )
+ {
+ m_showVolumeWeightedMean = false;
+ m_showAnimProgress = false;
+
+ updateSeismicInfo( seisView );
+ }
+
update3DInfoIn2dViews();
}
@@ -764,6 +815,17 @@ void Rim3dOverlayInfoConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
{
caf::PdmUiGroup* visGroup = uiOrdering.addNewGroup( "Visibility" );
+ RimSeismicView* seisView = dynamic_cast( m_viewDef.p() );
+ if ( seisView )
+ {
+ visGroup->add( &m_showCaseInfo );
+ visGroup->add( &m_showHistogram );
+ visGroup->add( &m_showVersionInfo );
+
+ uiOrdering.skipRemainingFields( true );
+ return;
+ }
+
RimEclipseView* eclipseView = dynamic_cast( m_viewDef.p() );
RimEclipseContourMapView* contourMap = dynamic_cast( eclipseView );
RimGeoMechView* geoMechView = dynamic_cast( m_viewDef.p() );
@@ -816,7 +878,7 @@ void Rim3dOverlayInfoConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void Rim3dOverlayInfoConfig::setReservoirView( RimGridView* ownerReservoirView )
+void Rim3dOverlayInfoConfig::setReservoirView( Rim3dView* ownerReservoirView )
{
m_viewDef = ownerReservoirView;
}
@@ -911,6 +973,41 @@ void Rim3dOverlayInfoConfig::updateGeoMech3DInfo( RimGeoMechView* geoMechView )
}
}
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void Rim3dOverlayInfoConfig::updateSeismicInfo( RimSeismicView* seisView )
+{
+ RigHistogramData histData;
+
+ if ( m_showResultInfo() || m_showHistogram() )
+ {
+ histData = seisView->histogramData();
+ }
+
+ // Compose text
+
+ QString infoText;
+
+ if ( m_showCaseInfo() )
+ {
+ infoText = caseInfoText( seisView );
+ }
+
+ seisView->viewer()->setInfoText( infoText );
+
+ // Populate histogram
+
+ if ( m_showHistogram() )
+ {
+ if ( histData.isHistogramVectorValid() )
+ {
+ seisView->viewer()->showHistogram( true );
+ seisView->viewer()->setHistogram( histData.min, histData.max, histData.histogram );
+ }
+ }
+}
+
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1009,11 +1106,13 @@ void Rim3dOverlayInfoConfig::displayPropertyFilteredStatisticsMessage( bool show
//--------------------------------------------------------------------------------------------------
bool Rim3dOverlayInfoConfig::hasInvalidStatisticsCombination()
{
- if ( m_viewDef->propertyFilterCollection() && m_viewDef->propertyFilterCollection()->hasActiveDynamicFilters() &&
+ auto gridView = dynamic_cast( m_viewDef.p() );
+
+ if ( gridView && gridView->propertyFilterCollection() && gridView->propertyFilterCollection()->hasActiveDynamicFilters() &&
m_statisticsCellRange() == RimHistogramCalculator::StatisticsCellRangeType::VISIBLE_CELLS &&
m_statisticsTimeRange() == RimHistogramCalculator::StatisticsTimeRangeType::ALL_TIMESTEPS )
{
- RimEclipseView* eclipseView = dynamic_cast( m_viewDef.p() );
+ RimEclipseView* eclipseView = dynamic_cast( gridView );
if ( !( eclipseView && eclipseView->cellResult()->isFlowDiagOrInjectionFlooding() ) ) // If
// isFlowDiagOrInjFlooding
// then skip this check as
diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.h b/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.h
index 7bfdc7cfa1..81a47d0eee 100644
--- a/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.h
+++ b/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.h
@@ -39,8 +39,9 @@ class RimGeoMechContourMapView;
class RimEclipseContourMapView;
class RimEclipseView;
class RimGeoMechView;
-class RimGridView;
+class Rim3dView;
class RicGridStatisticsDialog;
+class RimSeismicView;
//==================================================================================================
///
@@ -56,7 +57,7 @@ public:
void update3DInfo();
- void setReservoirView( RimGridView* ownerView );
+ void setReservoirView( Rim3dView* ownerView );
void setPosition( cvf::Vec2ui position );
@@ -82,11 +83,13 @@ private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void updateEclipse3DInfo( RimEclipseView* reservoirView );
void updateGeoMech3DInfo( RimGeoMechView* geoMechView );
+ void updateSeismicInfo( RimSeismicView* seisView );
void update3DInfoIn2dViews() const;
QString timeStepText( RimEclipseView* eclipseView );
QString timeStepText( RimGeoMechView* geoMechView );
QString caseInfoText( RimEclipseView* eclipseView );
QString caseInfoText( RimGeoMechView* geoMechView );
+ QString caseInfoText( RimSeismicView* seisView );
QString resultInfoText( const RigHistogramData& histData, RimEclipseView* eclipseView, bool showVolumeWeightedMean );
QString resultInfoText( const RigHistogramData& histData, RimGeoMechView* geoMechView );
@@ -107,8 +110,8 @@ private:
caf::PdmField> m_statisticsTimeRange;
caf::PdmField> m_statisticsCellRange;
- caf::PdmPointer m_viewDef;
- cvf::Vec2ui m_position;
+ caf::PdmPointer m_viewDef;
+ cvf::Vec2ui m_position;
std::unique_ptr m_histogramCalculator;
diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp
index 0636e4140f..ec37eb8060 100644
--- a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp
@@ -30,12 +30,15 @@
#include "RicfCommandObject.h"
#include "Rim3dWellLogCurve.h"
+#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimCase.h"
#include "RimCellFilterCollection.h"
#include "RimGridView.h"
+#include "RimLegendConfig.h"
#include "RimMainPlotCollection.h"
#include "RimMeasurement.h"
+#include "RimOilField.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimViewController.h"
@@ -164,7 +167,7 @@ Rim3dView::Rim3dView()
m_cellfilterPartManager = new RivCellFilterPartMgr( this );
m_measurementPartManager = new RivMeasurementPartMgr( this );
- setAs3DViewMdiWindow();
+ this->setAs3DViewMdiWindow();
// Every timer tick, send a signal for updating animations.
// Any animation is supposed to connect to this signal
@@ -198,9 +201,9 @@ Rim3dView::~Rim3dView()
}
}
- if ( isMasterView() )
+ if ( this->isMasterView() )
{
- RimViewLinker* viewLinker = assosiatedViewLinker();
+ RimViewLinker* viewLinker = this->assosiatedViewLinker();
viewLinker->setMasterView( nullptr );
delete proj->viewLinkerCollection->viewLinker();
@@ -209,7 +212,7 @@ Rim3dView::~Rim3dView()
proj->uiCapability()->updateConnectedEditors();
}
- RimViewController* vController = viewController();
+ RimViewController* vController = this->viewController();
if ( vController )
{
vController->setManagedView( nullptr );
@@ -359,7 +362,7 @@ QWidget* Rim3dView::createViewWidget( QWidget* mainWindowParent )
cvf::String yLabel;
cvf::String zLabel;
- defineAxisLabels( &xLabel, &yLabel, &zLabel );
+ this->defineAxisLabels( &xLabel, &yLabel, &zLabel );
m_viewer->setAxisLabels( xLabel, yLabel, zLabel );
updateZScaleLabel();
@@ -400,7 +403,7 @@ void Rim3dView::setId( int id )
{
m_id = id;
QString viewIdTooltip = QString( "View id: %1" ).arg( m_id );
- setUiToolTip( viewIdTooltip );
+ this->setUiToolTip( viewIdTooltip );
}
//--------------------------------------------------------------------------------------------------
@@ -441,7 +444,7 @@ void Rim3dView::updateMdiWindowTitle()
//--------------------------------------------------------------------------------------------------
RimViewLinker* Rim3dView::assosiatedViewLinker() const
{
- RimViewLinker* viewLinker = viewLinkerIfMasterView();
+ RimViewLinker* viewLinker = this->viewLinkerIfMasterView();
if ( !viewLinker )
{
RimViewController* viewController = this->viewController();
@@ -502,7 +505,7 @@ void Rim3dView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOr
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Grid Appearance" );
gridGroup->add( &m_scaleZ );
- m_scaleZ.uiCapability()->setUiReadOnly( !isScaleZEditable() );
+ m_scaleZ.uiCapability()->setUiReadOnly( !this->isScaleZEditable() );
gridGroup->add( &meshMode );
gridGroup->add( &surfaceMode );
@@ -533,9 +536,9 @@ QImage Rim3dView::snapshotWindowContent()
void Rim3dView::scheduleCreateDisplayModelAndRedraw()
{
RiaViewRedrawScheduler::instance()->scheduleDisplayModelUpdateAndRedraw( this );
- if ( isMasterView() )
+ if ( this->isMasterView() )
{
- RimViewLinker* viewLinker = assosiatedViewLinker();
+ RimViewLinker* viewLinker = this->assosiatedViewLinker();
if ( viewLinker )
{
viewLinker->scheduleCreateDisplayModelAndRedrawForDependentViews();
@@ -579,7 +582,7 @@ std::set Rim3dView::viewsUsingThisAsComparisonView()
//--------------------------------------------------------------------------------------------------
bool Rim3dView::isScaleZEditable()
{
- return ( viewsUsingThisAsComparisonView().empty() || ( viewController() && viewController()->isCameraLinked() ) );
+ return ( this->viewsUsingThisAsComparisonView().empty() || ( this->viewController() && this->viewController()->isCameraLinked() ) );
}
//--------------------------------------------------------------------------------------------------
@@ -610,7 +613,7 @@ bool Rim3dView::isTimeStepDependentDataVisibleInThisOrComparisonView() const
//--------------------------------------------------------------------------------------------------
size_t Rim3dView::timeStepCount()
{
- return onTimeStepCountRequested();
+ return this->onTimeStepCountRequested();
}
//--------------------------------------------------------------------------------------------------
@@ -618,9 +621,9 @@ size_t Rim3dView::timeStepCount()
//--------------------------------------------------------------------------------------------------
QString Rim3dView::timeStepName( int frameIdx ) const
{
- if ( ownerCase() )
+ if ( this->ownerCase() )
{
- return ownerCase()->timeStepName( frameIdx );
+ return this->ownerCase()->timeStepName( frameIdx );
}
return QString( "" );
}
@@ -638,7 +641,7 @@ void Rim3dView::setCurrentTimeStep( int frameIndex )
if ( m_currentTimeStep != oldTimeStep )
{
RiuTimeStepChangedHandler::instance()->handleTimeStepChanged( this );
- onClearReservoirCellVisibilitiesIfNecessary();
+ this->onClearReservoirCellVisibilitiesIfNecessary();
}
}
@@ -660,7 +663,7 @@ void Rim3dView::updateDisplayModelForCurrentTimeStepAndRedraw()
if ( nativeOrOverrideViewer() )
{
- onUpdateDisplayModelForCurrentTimeStep();
+ this->onUpdateDisplayModelForCurrentTimeStep();
appendAnnotationsToModel();
appendMeasurementToModel();
appendCellFiltersToModel();
@@ -680,7 +683,7 @@ void Rim3dView::updateDisplayModelForCurrentTimeStepAndRedraw()
m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw = true;
- std::set containerViews = viewsUsingThisAsComparisonView();
+ std::set containerViews = this->viewsUsingThisAsComparisonView();
if ( !containerViews.empty() && !isUsingOverrideViewer() )
{
for ( auto view : containerViews )
@@ -701,7 +704,7 @@ void Rim3dView::createDisplayModelAndRedraw()
{
if ( nativeOrOverrideViewer() )
{
- onClampCurrentTimestep();
+ this->onClampCurrentTimestep();
onUpdateScaleTransform();
@@ -774,7 +777,7 @@ void Rim3dView::setDefaultView()
{
if ( m_viewer )
{
- m_viewer->setDefaultView();
+ m_viewer->setDefaultView( -cvf::Vec3d::Z_AXIS, cvf::Vec3d::Y_AXIS );
}
}
@@ -783,7 +786,7 @@ void Rim3dView::setDefaultView()
//--------------------------------------------------------------------------------------------------
void Rim3dView::endAnimation()
{
- onUpdateStaticCellColors();
+ this->onUpdateStaticCellColors();
}
//--------------------------------------------------------------------------------------------------
@@ -936,7 +939,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
RiuMainWindow::instance()->updateScaleValue();
- RimViewLinker* viewLinker = assosiatedViewLinker();
+ RimViewLinker* viewLinker = this->assosiatedViewLinker();
if ( viewLinker )
{
viewLinker->updateScaleZ( this, scaleZ() );
@@ -995,8 +998,8 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
fontHolder->updateFonts();
}
}
- applyBackgroundColorAndFontChanges();
- updateConnectedEditors();
+ this->applyBackgroundColorAndFontChanges();
+ this->updateConnectedEditors();
}
else if ( changedField == &maximumFrameRate )
{
@@ -1024,15 +1027,15 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox )
+void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
+ const cvf::BoundingBox& wellPathClipBoundingBox,
+ double characteristicCellSize )
{
- if ( !ownerCase() ) return;
-
cvf::ref transForm = displayCoordTransform();
m_wellPathsPartManager->appendStaticGeometryPartsToModel( wellPathModelBasicList,
transForm.p(),
- ownerCase()->characteristicCellSize(),
+ characteristicCellSize,
wellPathClipBoundingBox );
wellPathModelBasicList->updateBoundingBoxesRecursive();
@@ -1041,17 +1044,17 @@ void Rim3dView::addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox )
+void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
+ const cvf::BoundingBox& wellPathClipBoundingBox,
+ double characteristicCellSize )
{
- if ( !ownerCase() ) return;
-
cvf::ref transForm = displayCoordTransform();
size_t timeStepIndex = currentTimeStep();
m_wellPathsPartManager->appendDynamicGeometryPartsToModel( wellPathModelBasicList,
timeStepIndex,
transForm.p(),
- ownerCase()->characteristicCellSize(),
+ characteristicCellSize,
wellPathClipBoundingBox );
wellPathModelBasicList->updateBoundingBoxesRecursive();
@@ -1062,18 +1065,14 @@ void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBa
//--------------------------------------------------------------------------------------------------
void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* annotationsModel )
{
- if ( !ownerCase() ) return;
-
auto annotationCollections = descendantsIncludingThisOfType();
- if ( annotationCollections.empty() || !annotationCollections.front()->isActive() )
- {
- m_annotationsPartManager->clearGeometryCache();
- }
- else
+ m_annotationsPartManager->clearGeometryCache();
+
+ if ( !annotationCollections.empty() && annotationCollections.front()->isActive() )
{
cvf::ref transForm = displayCoordTransform();
- m_annotationsPartManager->appendGeometryPartsToModel( annotationsModel, transForm.p(), ownerCase()->allCellsBoundingBox() );
+ m_annotationsPartManager->appendGeometryPartsToModel( annotationsModel, transForm.p(), domainBoundingBox() );
}
annotationsModel->updateBoundingBoxesRecursive();
@@ -1084,7 +1083,7 @@ void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* annotationsModel )
//--------------------------------------------------------------------------------------------------
void Rim3dView::addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel )
{
- if ( !ownerCase() ) return;
+ if ( !this->ownerCase() ) return;
cvf::ref transForm = displayCoordTransform();
m_cellfilterPartManager->appendGeometryPartsToModel( cellFilterModel, transForm.p(), ownerCase()->allCellsBoundingBox() );
@@ -1097,7 +1096,7 @@ void Rim3dView::addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel )
//--------------------------------------------------------------------------------------------------
void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
{
- if ( !ownerCase() ) return;
+ if ( !this->ownerCase() ) return;
RimMeasurement* measurement = RimProject::current()->measurement();
@@ -1124,7 +1123,7 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
//---------------------------------------------------- ----------------------------------------------
bool Rim3dView::isMasterView() const
{
- RimViewLinker* viewLinker = assosiatedViewLinker();
+ RimViewLinker* viewLinker = this->assosiatedViewLinker();
return viewLinker && this == viewLinker->masterView();
}
@@ -1197,7 +1196,7 @@ void Rim3dView::setScaleZAndUpdate( double scalingFactor )
{
if ( scaleZ() != scalingFactor )
{
- m_scaleZ.setValueWithFieldChanged( scalingFactor );
+ this->m_scaleZ.setValueWithFieldChanged( scalingFactor );
}
}
@@ -1230,8 +1229,8 @@ void Rim3dView::updateScaling()
dir = viewer()->mainCamera()->direction();
up = viewer()->mainCamera()->up();
- eye[2] = poi[2] * m_scaleZ() / scaleTransform()->worldTransform()( 2, 2 ) + ( eye[2] - poi[2] );
- poi[2] = poi[2] * m_scaleZ() / scaleTransform()->worldTransform()( 2, 2 );
+ eye[2] = poi[2] * m_scaleZ() / this->scaleTransform()->worldTransform()( 2, 2 ) + ( eye[2] - poi[2] );
+ poi[2] = poi[2] * m_scaleZ() / this->scaleTransform()->worldTransform()( 2, 2 );
viewer()->mainCamera()->setFromLookAt( eye, eye + dir, up );
viewer()->setPointOfInterest( poi );
@@ -1246,7 +1245,7 @@ void Rim3dView::updateScaling()
updateGridBoxData();
updateZScaleLabel();
- scheduleCreateDisplayModelAndRedraw();
+ this->scheduleCreateDisplayModelAndRedraw();
}
//--------------------------------------------------------------------------------------------------
@@ -1355,7 +1354,7 @@ void Rim3dView::applyBackgroundColorAndFontChanges()
updateConnectedEditors();
onUpdateLegends();
- scheduleCreateDisplayModelAndRedraw();
+ this->scheduleCreateDisplayModelAndRedraw();
}
//--------------------------------------------------------------------------------------------------
@@ -1431,7 +1430,7 @@ void Rim3dView::updateDisplayModelVisibility()
viewer()->setEnableMask( mask, false );
viewer()->setEnableMask( mask, true );
- onUpdateDisplayModelVisibility();
+ this->onUpdateDisplayModelVisibility();
viewer()->update();
}
@@ -1627,7 +1626,7 @@ void Rim3dView::appendAnnotationsToModel()
if ( frameScene )
{
cvf::String name = "Annotations";
- removeModelByName( frameScene, name );
+ this->removeModelByName( frameScene, name );
cvf::ref model = new cvf::ModelBasicList;
model->setName( name );
@@ -1649,7 +1648,7 @@ void Rim3dView::appendCellFiltersToModel()
if ( frameScene )
{
cvf::String name = "CellFilters";
- removeModelByName( frameScene, name );
+ this->removeModelByName( frameScene, name );
cvf::ref model = new cvf::ModelBasicList;
model->setName( name );
@@ -1671,7 +1670,7 @@ void Rim3dView::appendMeasurementToModel()
if ( frameScene )
{
cvf::String name = "Measurement";
- removeModelByName( frameScene, name );
+ this->removeModelByName( frameScene, name );
cvf::ref model = new cvf::ModelBasicList;
model->setName( name );
@@ -1748,3 +1747,78 @@ RimViewLinker* Rim3dView::viewLinkerIfMasterView() const
return nullptr;
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void Rim3dView::onResetLegendsInViewer()
+{
+ for ( auto legendConfig : legendConfigs() )
+ {
+ if ( legendConfig ) legendConfig->recreateLegend();
+ }
+
+ auto viewer = nativeOrOverrideViewer();
+ if ( viewer ) viewer->removeAllColorLegends();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void Rim3dView::onUpdateScaleTransform()
+{
+ if ( scaleTransform() )
+ {
+ cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
+ scale( 2, 2 ) = scaleZ();
+
+ scaleTransform()->setLocalTransform( scale );
+
+ if ( nativeOrOverrideViewer() ) nativeOrOverrideViewer()->updateCachedValuesInScene();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void Rim3dView::updateSurfacesInViewTreeItems()
+{
+ // default is to do nothing
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+double Rim3dView::characteristicCellSize() const
+{
+ if ( ownerCase() )
+ {
+ return ownerCase()->characteristicCellSize();
+ }
+
+ return 1.0;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimAnnotationInViewCollection* Rim3dView::annotationCollection() const
+{
+ return m_annotationCollection;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void Rim3dView::syncronizeLocalAnnotationsFromGlobal()
+{
+ RimProject* proj = RimProject::current();
+ if ( proj && proj->activeOilField() )
+ {
+ RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
+ if ( annotColl && annotationCollection() )
+ {
+ annotationCollection()->onGlobalCollectionChanged( annotColl );
+ }
+ }
+}
diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.h b/ApplicationLibCode/ProjectDataModel/Rim3dView.h
index af1ca70e7f..e87831424f 100644
--- a/ApplicationLibCode/ProjectDataModel/Rim3dView.h
+++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.h
@@ -44,6 +44,7 @@
class RimCase;
class RimLegendConfig;
class RimWellPathCollection;
+class RimAnnotationInViewCollection;
class RiuViewer;
class RivAnnotationsPartMgr;
class RivMeasurementPartMgr;
@@ -117,14 +118,15 @@ public:
virtual RiaDefines::View3dContent viewContent() const = 0;
- void setMeshOnlyDrawstyle();
- void setMeshSurfDrawstyle();
- void setSurfOnlyDrawstyle();
- void setFaultMeshSurfDrawstyle();
- void setSurfaceDrawstyle();
- void setShowGridBox( bool showGridBox );
- virtual bool isShowingActiveCellsOnly();
- virtual bool isGridVisualizationMode() const = 0;
+ void setMeshOnlyDrawstyle();
+ void setMeshSurfDrawstyle();
+ void setSurfOnlyDrawstyle();
+ void setFaultMeshSurfDrawstyle();
+ void setSurfaceDrawstyle();
+ void setShowGridBox( bool showGridBox );
+ virtual bool isShowingActiveCellsOnly();
+ virtual bool isGridVisualizationMode() const = 0;
+ virtual double characteristicCellSize() const;
void setBackgroundColor( const cvf::Color3f& newBackgroundColor );
cvf::Color3f backgroundColor() const override; // Implementation of RiuViewerToViewInterface
@@ -165,11 +167,11 @@ public:
void updateDisplayModelForCurrentTimeStepAndRedraw();
void createHighlightAndGridBoxDisplayModelAndRedraw();
void createMeasurementDisplayModelAndRedraw();
- void updateGridBoxData();
void updateAnnotationItems();
void resetLegends();
- cvf::BoundingBox domainBoundingBox();
+ virtual void updateGridBoxData();
+ virtual cvf::BoundingBox domainBoundingBox();
void setScaleZ( double scaleZ );
void setScaleZAndUpdate( double scaleZ );
@@ -187,6 +189,11 @@ public:
RimViewLinker* assosiatedViewLinker() const override;
RimViewController* viewController() const override;
+ virtual void updateSurfacesInViewTreeItems();
+
+ RimAnnotationInViewCollection* annotationCollection() const;
+ void syncronizeLocalAnnotationsFromGlobal();
+
protected:
static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName );
@@ -203,8 +210,12 @@ protected:
RimWellPathCollection* wellPathCollection() const;
- void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox );
- void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox );
+ void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
+ const cvf::BoundingBox& wellPathClipBoundingBox,
+ double characteristicCellSize );
+ void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
+ const cvf::BoundingBox& wellPathClipBoundingBox,
+ double characteristicCellSize );
void addAnnotationsToModel( cvf::ModelBasicList* annotationsModel );
void addMeasurementToModel( cvf::ModelBasicList* measureModel );
void addCellFiltersToModel( cvf::ModelBasicList* cellFilterModel );
@@ -218,22 +229,23 @@ protected:
// Abstract methods to implement in subclasses
+ virtual void onUpdateDisplayModelVisibility(){};
+ virtual void onClearReservoirCellVisibilitiesIfNecessary(){};
+ virtual void onResetLegendsInViewer();
+ virtual void onUpdateScaleTransform();
+
virtual void onCreateDisplayModel() = 0;
virtual void onUpdateDisplayModelForCurrentTimeStep() = 0;
- virtual void onUpdateDisplayModelVisibility(){};
- virtual void onClampCurrentTimestep() = 0;
- virtual size_t onTimeStepCountRequested() = 0;
+ virtual void onClampCurrentTimestep() = 0;
+ virtual size_t onTimeStepCountRequested() = 0;
- virtual void onClearReservoirCellVisibilitiesIfNecessary(){};
virtual bool isTimeStepDependentDataVisible() const = 0;
virtual void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
virtual void onCreatePartCollectionFromSelection( cvf::Collection* parts ) = 0;
virtual void onUpdateStaticCellColors() = 0;
- virtual void onResetLegendsInViewer() = 0;
virtual void onUpdateLegends() = 0;
- virtual void onUpdateScaleTransform() = 0;
- virtual cvf::Transform* scaleTransform() = 0;
+ virtual cvf::Transform* scaleTransform() = 0;
protected:
caf::PdmFieldHandle* userDescriptionField() override;
@@ -259,10 +271,13 @@ protected:
cvf::ref m_wellPathPipeVizModel;
cvf::ref m_seismicVizModel;
cvf::ref m_wellPathsPartManager;
+ cvf::ref m_highlightVizModel;
caf::PdmField m_scaleZ;
caf::PdmField m_customScaleZ;
+ caf::PdmChildField m_annotationCollection;
+
private:
friend class RimProject;
@@ -288,9 +303,9 @@ private:
// Pure private methods
void createHighlightAndGridBoxDisplayModel();
- void appendAnnotationsToModel();
void appendMeasurementToModel();
void appendCellFiltersToModel();
+ void appendAnnotationsToModel();
// Pure private methods : Override viewer and comparison view
@@ -320,7 +335,6 @@ private:
caf::PdmField m_fontSize;
// 3D display model data
- cvf::ref m_highlightVizModel;
cvf::ref m_annotationsPartManager;
cvf::ref m_measurementPartManager;
cvf::ref m_cellfilterPartManager;
diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp
index ed48aed30d..446137c388 100644
--- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp
@@ -116,6 +116,7 @@
#include "RimSeismicData.h"
#include "RimSeismicDataCollection.h"
#include "RimSeismicSectionCollection.h"
+#include "RimSeismicViewCollection.h"
#include "RimSimWellFracture.h"
#include "RimSimWellInView.h"
#include "RimSimWellInViewCollection.h"
@@ -1055,6 +1056,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicImportSeismicFeature";
}
+ else if ( dynamic_cast( firstUiItem ) )
+ {
+ menuBuilder << "RicNewSeismicViewFeature";
+ }
else if ( dynamic_cast( firstUiItem ) || dynamic_cast( firstUiItem ) )
{
menuBuilder << "RicCreateTextAnnotationFeature";
@@ -1245,6 +1250,8 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
}
else if ( dynamic_cast( firstUiItem ) )
{
+ menuBuilder << "RicNewSeismicViewFeature";
+ menuBuilder.addSeparator();
menuBuilder << "RicNewSeismicDifferenceFeature";
}
else if ( dynamic_cast( firstUiItem ) )
diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp
index cb5b5fe691..e008ae6365 100644
--- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp
@@ -613,7 +613,7 @@ void RimEclipseView::onCreateDisplayModel()
// as the fracture geometry depends on the StimPlan legend colors
fractureColors()->updateLegendData();
- addWellPathsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox() );
+ addWellPathsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox(), ownerCase()->characteristicCellSize() );
m_wellPathsPartManager->appendStaticFracturePartsToModel( m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox() );
m_wellPathPipeVizModel->updateBoundingBoxesRecursive();
@@ -936,7 +936,9 @@ void RimEclipseView::appendWellsAndFracturesToModel()
cvf::ref wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName( name );
- addDynamicWellPathsToModel( wellPathModelBasicList.p(), currentActiveCellInfo()->geometryBoundingBox() );
+ addDynamicWellPathsToModel( wellPathModelBasicList.p(),
+ currentActiveCellInfo()->geometryBoundingBox(),
+ ownerCase()->characteristicCellSize() );
frameScene->addModel( wellPathModelBasicList.p() );
}
@@ -1599,22 +1601,6 @@ void RimEclipseView::syncronizeWellsWithResults()
}
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimEclipseView::syncronizeLocalAnnotationsFromGlobal()
-{
- RimProject* proj = RimProject::current();
- if ( proj && proj->activeOilField() )
- {
- RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
- if ( annotColl && annotationCollection() )
- {
- annotationCollection()->onGlobalCollectionChanged( annotColl );
- }
- }
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -2059,22 +2045,6 @@ void RimEclipseView::setCurrentCellResultData( const std::vector& values
}
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-void RimEclipseView::onResetLegendsInViewer()
-{
- for ( auto legendConfig : legendConfigs() )
- {
- if ( legendConfig )
- {
- legendConfig->recreateLegend();
- }
- }
-
- nativeOrOverrideViewer()->removeAllColorLegends();
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.h b/ApplicationLibCode/ProjectDataModel/RimEclipseView.h
index 17a2c7b12b..a7d5218d05 100644
--- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.h
+++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.h
@@ -160,8 +160,6 @@ public:
std::vector legendConfigs() const override;
cvf::Color4f colorFromCellCategory( RivCellSetEnum geometryType ) const;
- void syncronizeLocalAnnotationsFromGlobal();
-
std::vector additionalResultsForResultInfo() const;
protected:
@@ -203,7 +201,6 @@ private:
RimEclipseResultDefinition* eclResDef,
int timeStepIndex );
- void onResetLegendsInViewer() override;
void updateVirtualConnectionLegendRanges();
void updateFaultColors();
diff --git a/ApplicationLibCode/ProjectDataModel/RimGridView.cpp b/ApplicationLibCode/ProjectDataModel/RimGridView.cpp
index 1fb994045b..eebb57a5af 100644
--- a/ApplicationLibCode/ProjectDataModel/RimGridView.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimGridView.cpp
@@ -19,7 +19,6 @@
#include "RimGridView.h"
#include "Rim3dOverlayInfoConfig.h"
-#include "RimAnnotationInViewCollection.h"
#include "RimCellFilterCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultDefinition.h"
@@ -235,14 +234,6 @@ const RimCellFilterCollection* RimGridView::cellFilterCollection() const
}
}
-//--------------------------------------------------------------------------------------------------
-///
-//--------------------------------------------------------------------------------------------------
-RimAnnotationInViewCollection* RimGridView::annotationCollection() const
-{
- return m_annotationCollection;
-}
-
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/RimGridView.h b/ApplicationLibCode/ProjectDataModel/RimGridView.h
index 58d3cea41b..f3115e2f34 100644
--- a/ApplicationLibCode/ProjectDataModel/RimGridView.h
+++ b/ApplicationLibCode/ProjectDataModel/RimGridView.h
@@ -22,7 +22,6 @@
#include "cvfArray.h"
-class RimAnnotationInViewCollection;
class RimEclipseContourMapProjection;
class Rim3dOverlayInfoConfig;
class RimIntersectionCollection;
@@ -53,7 +52,6 @@ public:
virtual RimSurfaceInViewCollection* surfaceInViewCollection() const;
RimIntersectionResultsDefinitionCollection* separateIntersectionResultsCollection() const;
RimIntersectionResultsDefinitionCollection* separateSurfaceResultsCollection() const;
- RimAnnotationInViewCollection* annotationCollection() const;
RimWellMeasurementInViewCollection* measurementCollection() const;
RimSeismicSectionCollection* seismicSectionCollection() const;
@@ -70,7 +68,7 @@ public:
bool isGridVisualizationMode() const override;
void updateWellMeasurements();
- void updateSurfacesInViewTreeItems();
+ void updateSurfacesInViewTreeItems() override;
protected:
virtual void updateViewFollowingCellFilterUpdates();
@@ -101,7 +99,6 @@ protected:
caf::PdmChildField m_overlayInfoConfig;
caf::PdmChildField m_gridCollection;
- caf::PdmChildField m_annotationCollection;
caf::PdmChildField m_wellMeasurementCollection;
caf::PdmChildField m_surfaceCollection;
caf::PdmChildField m_cellFilterCollection;
diff --git a/ApplicationLibCode/ProjectDataModel/RimOilField.cpp b/ApplicationLibCode/ProjectDataModel/RimOilField.cpp
index cba9663526..f0f421c609 100644
--- a/ApplicationLibCode/ProjectDataModel/RimOilField.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimOilField.cpp
@@ -30,6 +30,7 @@
#include "RimMeasurement.h"
#include "RimObservedDataCollection.h"
#include "RimSeismicDataCollection.h"
+#include "RimSeismicViewCollection.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSurfaceCollection.h"
#include "RimWellPathCollection.h"
@@ -65,8 +66,11 @@ RimOilField::RimOilField()
surfaceCollection = new RimSurfaceCollection();
surfaceCollection->setAsTopmostFolder();
- CAF_PDM_InitFieldNoDefault( &seismicCollection, "SeismicCollection", "Seismic Data" );
- seismicCollection = new RimSeismicDataCollection();
+ CAF_PDM_InitFieldNoDefault( &seismicDataCollection, "SeismicCollection", "Seismic Data" );
+ seismicDataCollection = new RimSeismicDataCollection();
+
+ CAF_PDM_InitFieldNoDefault( &seismicViewCollection, "SeismicViewCollection", "Seismic Views" );
+ seismicViewCollection = new RimSeismicViewCollection();
completionTemplateCollection = new RimCompletionTemplateCollection;
analysisModels = new RimEclipseCaseCollection();
diff --git a/ApplicationLibCode/ProjectDataModel/RimOilField.h b/ApplicationLibCode/ProjectDataModel/RimOilField.h
index e8429123af..a45ed80936 100644
--- a/ApplicationLibCode/ProjectDataModel/RimOilField.h
+++ b/ApplicationLibCode/ProjectDataModel/RimOilField.h
@@ -38,6 +38,7 @@ class RimWellPathCollection;
class RimAnnotationCollection;
class RimMeasurement;
class RimSeismicDataCollection;
+class RimSeismicViewCollection;
class RimSurfaceCollection;
class RimEnsembleWellLogsCollection;
@@ -69,7 +70,8 @@ public:
caf::PdmChildField annotationCollection;
caf::PdmChildField measurement;
caf::PdmChildField surfaceCollection;
- caf::PdmChildField seismicCollection;
+ caf::PdmChildField seismicDataCollection;
+ caf::PdmChildField seismicViewCollection;
caf::PdmChildField ensembleWellLogsCollection;
protected:
diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp
index 5d1d3539fc..43e5fccfc0 100644
--- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp
@@ -73,6 +73,8 @@
#include "RimSaturationPressurePlotCollection.h"
#include "RimScriptCollection.h"
#include "RimSeismicDataCollection.h"
+#include "RimSeismicView.h"
+#include "RimSeismicViewCollection.h"
#include "RimStimPlanModelPlotCollection.h"
#include "RimSummaryCalculation.h"
#include "RimSummaryCalculationCollection.h"
@@ -811,6 +813,18 @@ void RimProject::allViews( std::vector& views ) const
}
}
}
+
+ for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
+ {
+ RimOilField* oilField = oilFields[oilFieldIdx];
+ if ( !oilField ) continue;
+ if ( !oilField->seismicViewCollection() ) continue;
+
+ for ( auto seisview : oilField->seismicViewCollection()->views() )
+ {
+ views.push_back( seisview );
+ }
+ }
}
//--------------------------------------------------------------------------------------------------
@@ -869,6 +883,11 @@ void RimProject::scheduleCreateDisplayModelAndRedrawAllViews()
views[viewIdx]->scheduleCreateDisplayModelAndRedraw();
}
}
+
+ for ( auto seisview : activeOilField()->seismicViewCollection()->views() )
+ {
+ seisview->scheduleCreateDisplayModelAndRedraw();
+ }
}
//--------------------------------------------------------------------------------------------------
@@ -1520,7 +1539,12 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q
if ( oilField->geoMechModels() ) uiTreeOrdering.add( oilField->geoMechModels() );
if ( oilField->wellPathCollection() ) uiTreeOrdering.add( oilField->wellPathCollection() );
if ( oilField->surfaceCollection() ) uiTreeOrdering.add( oilField->surfaceCollection() );
- if ( oilField->seismicCollection() ) uiTreeOrdering.add( oilField->seismicCollection() );
+ if ( oilField->seismicDataCollection() )
+ {
+ auto child = uiTreeOrdering.add( "Seismic", ":/Seismic16x16.png" );
+ child->add( oilField->seismicDataCollection() );
+ child->add( oilField->seismicViewCollection() );
+ }
if ( oilField->formationNamesCollection() ) uiTreeOrdering.add( oilField->formationNamesCollection() );
if ( oilField->completionTemplateCollection() ) uiTreeOrdering.add( oilField->completionTemplateCollection() );
if ( oilField->annotationCollection() ) uiTreeOrdering.add( oilField->annotationCollection() );
diff --git a/ApplicationLibCode/ProjectDataModel/RimTools.cpp b/ApplicationLibCode/ProjectDataModel/RimTools.cpp
index 4c6bc5f180..46c1622456 100644
--- a/ApplicationLibCode/ProjectDataModel/RimTools.cpp
+++ b/ApplicationLibCode/ProjectDataModel/RimTools.cpp
@@ -384,7 +384,7 @@ void RimTools::seismicDataOptionItems( QList* options )
RimProject* proj = RimProject::current();
if ( proj )
{
- const auto& coll = proj->activeOilField()->seismicCollection().p();
+ const auto& coll = proj->activeOilField()->seismicDataCollection().p();
for ( auto* c : coll->seismicData() )
{
@@ -403,7 +403,7 @@ void RimTools::seismicDataOptionItems( QList* options, c
RimProject* proj = RimProject::current();
if ( proj )
{
- const auto& coll = proj->activeOilField()->seismicCollection().p();
+ const auto& coll = proj->activeOilField()->seismicDataCollection().p();
for ( auto* c : coll->seismicData() )
{
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Seismic/CMakeLists_files.cmake
index 3fde3e6ed6..0cfb1872c9 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/CMakeLists_files.cmake
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/CMakeLists_files.cmake
@@ -7,6 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimSeismicSection.h
${CMAKE_CURRENT_LIST_DIR}/RimSeismicAlphaMapper.h
${CMAKE_CURRENT_LIST_DIR}/RimSEGYConvertOptions.h
+ ${CMAKE_CURRENT_LIST_DIR}/RimSeismicViewCollection.h
+ ${CMAKE_CURRENT_LIST_DIR}/RimSeismicView.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -18,6 +20,8 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimSEGYConvertOptions.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSeismicDataInterface.cpp
${CMAKE_CURRENT_LIST_DIR}/RimSeismicDifferenceData.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/RimSeismicViewCollection.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/RimSeismicView.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.cpp
index db62e81096..8e50260143 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicData.cpp
@@ -59,7 +59,7 @@ RimSeismicData::RimSeismicData()
, m_fileDataRange( 0, 0 )
, m_activeDataRange( 0, 0 )
{
- CAF_PDM_InitObject( "SeismicData", ":/Seismic16x16.png" );
+ CAF_PDM_InitObject( "SeismicData", ":/SeismicData24x24.png" );
CAF_PDM_InitFieldNoDefault( &m_userDescription, "SeismicUserDecription", "Name" );
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataCollection.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataCollection.cpp
index 0ec1089931..76f7523d59 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataCollection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataCollection.cpp
@@ -37,7 +37,7 @@ CAF_PDM_SOURCE_INIT( RimSeismicDataCollection, "SeismicDataCollection", "Seismic
//--------------------------------------------------------------------------------------------------
RimSeismicDataCollection::RimSeismicDataCollection()
{
- CAF_PDM_InitObject( "Seismic", ":/Seismic16x16.png" );
+ CAF_PDM_InitObject( "Data", ":/SeismicData24x24.png" );
CAF_PDM_InitFieldNoDefault( &m_seismicData, "SeismicData", "Seismic Data" );
m_seismicData.uiCapability()->setUiTreeHidden( true );
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.cpp
index 7afc20c106..1e1661913d 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.cpp
@@ -21,6 +21,8 @@
#include "RimRegularLegendConfig.h"
#include "RimSeismicAlphaMapper.h"
+#include "RigPolyLinesData.h"
+
#include "cvfBoundingBox.h"
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimSeismicDataInterface, "SeismicDataInterface" ); // Abstract class.
@@ -137,3 +139,53 @@ std::vector RimSeismicDataInterface::alphaValues() const
{
return m_clippedAlphaValues;
}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+double RimSeismicDataInterface::inlineSpacing()
+{
+ if ( !hasValidData() ) return 1.0;
+
+ cvf::Vec3d world1 = convertToWorldCoords( inlineMin(), xlineMin(), zMin() );
+ cvf::Vec3d world2 = convertToWorldCoords( inlineMin() + 1, xlineMin(), zMin() );
+
+ return world1.pointDistance( world2 );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicDataInterface::addSeismicOutline( RigPolyLinesData* pld )
+{
+ if ( pld == nullptr ) return;
+
+ auto outline = worldOutline();
+ if ( outline.size() == 8 )
+ {
+ // seismic bounding box could be all the way up to the sea surface,
+ // make sure to skip bounding box check in drawing code
+ pld->setSkipBoundingBoxCheck( true );
+
+ std::vector box;
+
+ for ( auto i : { 4, 0, 1, 3, 2, 0 } )
+ box.push_back( outline[i] );
+ pld->addPolyLine( box );
+ box.clear();
+
+ for ( auto i : { 1, 5, 4, 6, 7, 5 } )
+ box.push_back( outline[i] );
+ pld->addPolyLine( box );
+ box.clear();
+
+ box.push_back( outline[2] );
+ box.push_back( outline[6] );
+ pld->addPolyLine( box );
+ box.clear();
+
+ box.push_back( outline[3] );
+ box.push_back( outline[7] );
+ pld->addPolyLine( box );
+ }
+}
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.h b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.h
index acf8a02485..4b990003a4 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.h
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDataInterface.h
@@ -32,6 +32,7 @@
class RimSeismicAlphaMapper;
class RimRegularLegendConfig;
+class RigPolyLinesData;
namespace cvf
{
@@ -56,6 +57,9 @@ public:
virtual bool gridIsEqual( RimSeismicDataInterface* other );
virtual RimRegularLegendConfig* legendConfig() const;
virtual RimSeismicAlphaMapper* alphaValueMapper() const;
+ virtual double inlineSpacing();
+
+ void addSeismicOutline( RigPolyLinesData* pld );
// interface to be implemented by subclasses
public:
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp
index df9c9242b1..a472caba85 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicDifferenceData.cpp
@@ -506,7 +506,7 @@ QList RimSeismicDifferenceData::calculateValueOptions( c
RimProject* proj = RimProject::current();
if ( ( proj != nullptr ) && ( m_seismicData1() != nullptr ) )
{
- const auto& coll = proj->activeOilField()->seismicCollection().p();
+ const auto& coll = proj->activeOilField()->seismicDataCollection().p();
for ( auto seisData : coll->seismicData() )
{
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSection.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSection.cpp
index 32ffe7c986..9c89a1fe37 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSection.cpp
@@ -68,7 +68,7 @@ CAF_PDM_SOURCE_INIT( RimSeismicSection, "SeismicSection" );
RimSeismicSection::RimSeismicSection()
: m_pickTargetsEventHandler( new RicPolylineTargetsPickEventHandler( this ) )
{
- CAF_PDM_InitObject( "Seismic Section", ":/Seismic16x16.png" );
+ CAF_PDM_InitObject( "Seismic Section", ":/SeismicSection16x16.png" );
CAF_PDM_InitFieldNoDefault( &m_userDescription, "UserDescription", "Description" );
@@ -478,34 +478,7 @@ cvf::ref RimSeismicSection::polyLinesData() const
if ( m_showSeismicOutline() && m_seismicData != nullptr )
{
- auto outline = m_seismicData->worldOutline();
- if ( outline.size() == 8 )
- {
- // seismic bounding box could be all the way up to the sea surface,
- // make sure to skip bounding box check in drawing code
- pld->setSkipBoundingBoxCheck( true );
-
- std::vector box;
-
- for ( auto i : { 4, 0, 1, 3, 2, 0 } )
- box.push_back( outline[i] );
- pld->addPolyLine( box );
- box.clear();
-
- for ( auto i : { 1, 5, 4, 6, 7, 5 } )
- box.push_back( outline[i] );
- pld->addPolyLine( box );
- box.clear();
-
- box.push_back( outline[2] );
- box.push_back( outline[6] );
- pld->addPolyLine( box );
- box.clear();
-
- box.push_back( outline[3] );
- box.push_back( outline[7] );
- pld->addPolyLine( box );
- }
+ m_seismicData->addSeismicOutline( pld.p() );
}
pld->setLineAppearance( m_lineThickness, m_lineColor, false );
@@ -752,6 +725,8 @@ void RimSeismicSection::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel
}
else if ( changedField == &m_showImage )
{
+ if ( m_seismicData == nullptr ) return;
+
QDialog w;
QLabel l;
QHBoxLayout layout;
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSectionCollection.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSectionCollection.cpp
index 9e57e36389..09bbe122bb 100644
--- a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSectionCollection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicSectionCollection.cpp
@@ -72,7 +72,7 @@ RimSeismicSection* RimSeismicSectionCollection::addNewSection( RiaDefines::Seism
RimProject* proj = RimProject::current();
if ( proj )
{
- const auto& coll = proj->activeOilField()->seismicCollection().p();
+ const auto& coll = proj->activeOilField()->seismicDataCollection().p();
for ( auto* c : coll->seismicData() )
{
if ( c->boundingBox()->intersects( view->domainBoundingBox() ) )
@@ -266,5 +266,5 @@ bool RimSeismicSectionCollection::shouldBeVisibleInTree() const
RimProject* proj = RimProject::current();
if ( proj == nullptr ) return false;
- return !proj->activeOilField()->seismicCollection()->isEmpty();
+ return !proj->activeOilField()->seismicDataCollection()->isEmpty();
}
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.cpp
new file mode 100644
index 0000000000..c02e59e305
--- /dev/null
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.cpp
@@ -0,0 +1,580 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2023 Equinor ASA
+//
+// ResInsight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU General Public License at
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#include "RimSeismicView.h"
+
+#include "RigPolyLinesData.h"
+
+#include "Rim3dOverlayInfoConfig.h"
+#include "RimAnnotationCollection.h"
+#include "RimAnnotationInViewCollection.h"
+#include "RimLegendConfig.h"
+#include "RimOilField.h"
+#include "RimProject.h"
+#include "RimRegularLegendConfig.h"
+#include "RimSeismicData.h"
+#include "RimSeismicSection.h"
+#include "RimSeismicSectionCollection.h"
+#include "RimSurfaceCollection.h"
+#include "RimSurfaceInViewCollection.h"
+#include "RimTools.h"
+
+#include "Riu3DMainWindowTools.h"
+#include "RiuViewer.h"
+
+#include "RivPolylinePartMgr.h"
+
+#include "cafPdmUiTreeOrdering.h"
+
+#include "cafDisplayCoordTransform.h"
+#include "cvfModelBasicList.h"
+#include "cvfPart.h"
+#include "cvfScene.h"
+#include "cvfString.h"
+#include "cvfTransform.h"
+
+CAF_PDM_SOURCE_INIT( RimSeismicView, "RimSeismicView", "SeismicView" );
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicView::RimSeismicView()
+{
+ CAF_PDM_InitObject( "Seismic View", ":/SeismicView24x24.png" );
+
+ CAF_PDM_InitFieldNoDefault( &m_seismicData, "SeismicData", "Seismic Data" );
+
+ CAF_PDM_InitFieldNoDefault( &m_surfaceCollection, "SurfaceInViewCollection", "Surface Collection Field" );
+ m_surfaceCollection.uiCapability()->setUiTreeHidden( true );
+
+ CAF_PDM_InitFieldNoDefault( &m_seismicSectionCollection, "SeismicSectionCollection", "Seismic Collection Field" );
+ m_seismicSectionCollection.uiCapability()->setUiTreeHidden( true );
+ m_seismicSectionCollection = new RimSeismicSectionCollection();
+
+ CAF_PDM_InitFieldNoDefault( &m_annotationCollection, "AnnotationCollection", "Annotations" );
+ m_annotationCollection.uiCapability()->setUiTreeHidden( true );
+ m_annotationCollection = new RimAnnotationInViewCollection;
+
+ CAF_PDM_InitFieldNoDefault( &m_overlayInfoConfig, "OverlayInfoConfig", "Info Box" );
+ m_overlayInfoConfig = new Rim3dOverlayInfoConfig();
+ m_overlayInfoConfig->setReservoirView( this );
+ m_overlayInfoConfig.uiCapability()->setUiTreeHidden( true );
+
+ m_scaleTransform = new cvf::Transform();
+
+ m_surfaceVizModel = new cvf::ModelBasicList;
+ m_surfaceVizModel->setName( "SurfaceModel" );
+
+ setDeletable( true );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicView::~RimSeismicView()
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::setSeismicData( RimSeismicData* data )
+{
+ m_seismicData = data;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicData* RimSeismicView::seismicData() const
+{
+ return m_seismicData;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::addSlice( RiaDefines::SeismicSectionType sectionType )
+{
+ auto section = m_seismicSectionCollection->addNewSection( sectionType );
+ section->setSeismicData( m_seismicData );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSurfaceInViewCollection* RimSeismicView::surfaceInViewCollection() const
+{
+ return m_surfaceCollection;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicSectionCollection* RimSeismicView::seismicSectionCollection() const
+{
+ return m_seismicSectionCollection;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimCase* RimSeismicView::ownerCase() const
+{
+ return nullptr;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RiaDefines::View3dContent RimSeismicView::viewContent() const
+{
+ return RiaDefines::View3dContent::SEISMIC;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimSeismicView::isGridVisualizationMode() const
+{
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimSeismicView::isUsingFormationNames() const
+{
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::vector RimSeismicView::legendConfigs() const
+{
+ std::vector legends;
+
+ if ( m_surfaceCollection )
+ {
+ for ( auto legendConfig : m_surfaceCollection->legendConfigs() )
+ {
+ legends.push_back( legendConfig );
+ }
+ }
+
+ for ( auto section : seismicSectionCollection()->seismicSections() )
+ {
+ legends.push_back( section->legendConfig() );
+ }
+
+ legends.erase( std::remove( legends.begin(), legends.end(), nullptr ), legends.end() );
+
+ return legends;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::scheduleGeometryRegen( RivCellSetEnum geometryType )
+{
+ // no need do do anything here
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+cvf::BoundingBox RimSeismicView::domainBoundingBox()
+{
+ cvf::BoundingBox bb;
+
+ if ( m_seismicData )
+ {
+ bb.add( *m_seismicData->boundingBox() );
+ }
+ return bb;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
+{
+ if ( changedField == &m_seismicData )
+ {
+ updateGridBoxData();
+ scheduleCreateDisplayModelAndRedraw();
+ }
+ else
+ {
+ Rim3dView::fieldChangedByUi( changedField, oldValue, newValue );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
+{
+ auto genGrp = uiOrdering.addNewGroup( "General" );
+
+ genGrp->add( userDescriptionField() );
+ genGrp->add( &m_seismicData );
+
+ uiOrdering.skipRemainingFields( true );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
+{
+ uiTreeOrdering.add( m_overlayInfoConfig() );
+ uiTreeOrdering.add( seismicSectionCollection() );
+ if ( surfaceInViewCollection() ) uiTreeOrdering.add( surfaceInViewCollection() );
+ uiTreeOrdering.add( annotationCollection() );
+
+ uiTreeOrdering.skipRemainingChildren( true );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onCreateDisplayModel()
+{
+ if ( nativeOrOverrideViewer() == nullptr ) return;
+
+ if ( !m_seismicData ) return;
+
+ // Remove all existing frames from the viewer.
+ nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
+
+ // Set the Main scene in the viewer.
+ cvf::ref mainScene = new cvf::Scene;
+
+ // Seismic sections
+
+ cvf::ref transform = displayCoordTransform();
+ m_seismicVizModel->removeAllParts();
+
+ if ( m_polylinePartMgr.isNull() ) m_polylinePartMgr = new RivPolylinePartMgr( this, this, this );
+ m_polylinePartMgr->appendDynamicGeometryPartsToModel( m_seismicVizModel.p(), transform.p(), domainBoundingBox() );
+
+ m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), domainBoundingBox() );
+ mainScene->addModel( m_seismicVizModel.p() );
+ nativeOrOverrideViewer()->setMainScene( mainScene.p(), isUsingOverrideViewer() );
+
+ // Well path model
+
+ m_wellPathPipeVizModel->removeAllParts();
+ addWellPathsToModel( m_wellPathPipeVizModel.p(), domainBoundingBox(), m_seismicData->inlineSpacing() );
+ nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
+
+ // Surfaces
+
+ m_surfaceVizModel->removeAllParts();
+ if ( m_surfaceCollection )
+ {
+ bool nativeOnly = true;
+ m_surfaceCollection->appendPartsToModel( m_surfaceVizModel.p(), scaleTransform(), nativeOnly );
+ nativeOrOverrideViewer()->addStaticModelOnce( m_surfaceVizModel.p(), isUsingOverrideViewer() );
+ }
+
+ // Annotations
+
+ cvf::ref model = new cvf::ModelBasicList;
+ model->setName( "Annotations" );
+ addAnnotationsToModel( model.p() );
+ mainScene->addModel( model.p() );
+
+ onUpdateLegends();
+ if ( m_surfaceCollection )
+ {
+ m_surfaceCollection->applySingleColorEffect();
+ }
+
+ if ( m_seismicData ) nativeOrOverrideViewer()->setPointOfInterest( m_seismicData->boundingBox()->center() );
+
+ m_overlayInfoConfig()->update3DInfo();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onUpdateDisplayModelForCurrentTimeStep()
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onClampCurrentTimestep()
+{
+ m_currentTimeStep = 0;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+size_t RimSeismicView::onTimeStepCountRequested()
+{
+ return 1;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimSeismicView::isTimeStepDependentDataVisible() const
+{
+ return false;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
+{
+ *xLabel = "E(x)";
+ *yLabel = "N(y)";
+ *zLabel = "Z";
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onCreatePartCollectionFromSelection( cvf::Collection* parts )
+{
+ // no action needed, might be needed if we want to hilite something later
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onUpdateStaticCellColors()
+{
+ // no action needed
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onUpdateLegends()
+{
+ if ( nativeOrOverrideViewer() )
+ {
+ if ( !isUsingOverrideViewer() )
+ {
+ nativeOrOverrideViewer()->removeAllColorLegends();
+ }
+ else
+ {
+ std::vector legendConfs = this->legendConfigs();
+
+ for ( auto legendConf : legendConfs )
+ {
+ nativeOrOverrideViewer()->removeColorLegend( legendConf->titledOverlayFrame() );
+ }
+ }
+ }
+
+ if ( !nativeOrOverrideViewer() )
+ {
+ return;
+ }
+
+ if ( m_surfaceCollection && m_surfaceCollection->isChecked() )
+ {
+ m_surfaceCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
+ }
+
+ if ( m_seismicSectionCollection->isChecked() )
+ {
+ m_seismicSectionCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::onLoadDataAndUpdate()
+{
+ updateSurfacesInViewTreeItems();
+ syncronizeLocalAnnotationsFromGlobal();
+ onUpdateScaleTransform();
+
+ updateMdiWindowVisibility();
+
+ if ( m_surfaceCollection ) m_surfaceCollection->loadData();
+
+ scheduleCreateDisplayModelAndRedraw();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::selectOverlayInfoConfig()
+{
+ Riu3DMainWindowTools::selectAsCurrentItem( m_overlayInfoConfig );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+cvf::Transform* RimSeismicView::scaleTransform()
+{
+ return m_scaleTransform.p();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+QString RimSeismicView::createAutoName() const
+{
+ if ( m_seismicData != nullptr )
+ {
+ return QString::fromStdString( m_seismicData->userDescription() );
+ }
+
+ return "Seismic View";
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::updateGridBoxData()
+{
+ if ( viewer() )
+ {
+ viewer()->updateGridBoxData( m_scaleZ(), cvf::Vec3d::ZERO, backgroundColor(), domainBoundingBox(), fontSize() );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::updateSurfacesInViewTreeItems()
+{
+ RimProject* proj = RimProject::current();
+ RimSurfaceCollection* surfColl = proj->activeOilField()->surfaceCollection();
+
+ if ( surfColl && surfColl->containsSurface() )
+ {
+ if ( !m_surfaceCollection() )
+ {
+ m_surfaceCollection = new RimSurfaceInViewCollection();
+ }
+
+ m_surfaceCollection->setSurfaceCollection( surfColl );
+ m_surfaceCollection->updateFromSurfaceCollection();
+ }
+ else
+ {
+ delete m_surfaceCollection;
+ }
+
+ updateConnectedEditors();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+cvf::ref RimSeismicView::polyLinesData() const
+{
+ cvf::ref pld = new RigPolyLinesData;
+
+ if ( m_seismicData != nullptr )
+ {
+ m_seismicData->addSeismicOutline( pld.p() );
+ pld->setLineAppearance( 1, { 255, 255, 255 }, false );
+ pld->setZPlaneLock( false, 0.0 );
+ pld->setVisibility( true, false );
+ }
+ else
+ {
+ pld->setVisibility( false, false );
+ }
+
+ return pld;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+void RimSeismicView::setDefaultView()
+{
+ if ( viewer() )
+ {
+ viewer()->setDefaultView( cvf::Vec3d::Y_AXIS, cvf::Vec3d::Z_AXIS );
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+QList RimSeismicView::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
+{
+ QList options;
+
+ if ( fieldNeedingOptions == &m_seismicData )
+ {
+ RimTools::seismicDataOptionItems( &options, domainBoundingBox() );
+ }
+
+ return options;
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+double RimSeismicView::characteristicCellSize() const
+{
+ if ( m_seismicData != nullptr )
+ {
+ return m_seismicData->inlineSpacing();
+ }
+
+ return Rim3dView::characteristicCellSize();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RigHistogramData RimSeismicView::histogramData()
+{
+ RigHistogramData histData;
+
+ if ( m_seismicData )
+ {
+ auto xvals = m_seismicData->histogramXvalues();
+ auto yvals = m_seismicData->histogramYvalues();
+
+ histData.min = xvals.front();
+ histData.max = xvals.back();
+ histData.mean = 0.0;
+ histData.sum = 0.0;
+
+ histData.histogram.resize( yvals.size() );
+
+ int i = 0;
+ for ( auto val : yvals )
+ {
+ histData.histogram[i++] = (size_t)val;
+ }
+ }
+ return histData;
+}
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.h b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.h
new file mode 100644
index 0000000000..20685ee92e
--- /dev/null
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicView.h
@@ -0,0 +1,107 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2023 Equinor ASA
+//
+// ResInsight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU General Public License at
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+#pragma once
+
+#include "RiaSeismicDefines.h"
+
+#include "Rim3dView.h"
+#include "RimPolylinesDataInterface.h"
+
+#include "cafPdmField.h"
+
+#include "cafPdmObject.h"
+
+class RimCase;
+class RimSeismicData;
+class RimSurfaceInViewCollection;
+class RimSeismicSectionCollection;
+class Rim3dOverlayInfoConfig;
+class RivPolylinePartMgr;
+class RigHistogramData;
+class RimAnnotationInViewCollection;
+
+class RimSeismicView : public Rim3dView, public RimPolylinesDataInterface
+{
+ CAF_PDM_HEADER_INIT;
+
+public:
+ RimSeismicView();
+ ~RimSeismicView() override;
+
+ void setSeismicData( RimSeismicData* data );
+ RimSeismicData* seismicData() const;
+
+ void addSlice( RiaDefines::SeismicSectionType sectionType );
+
+ RimSurfaceInViewCollection* surfaceInViewCollection() const;
+ RimSeismicSectionCollection* seismicSectionCollection() const;
+
+ RimCase* ownerCase() const override;
+ RiaDefines::View3dContent viewContent() const override;
+ bool isGridVisualizationMode() const override;
+ bool isUsingFormationNames() const override;
+ std::vector legendConfigs() const override;
+ void scheduleGeometryRegen( RivCellSetEnum geometryType ) override;
+
+ cvf::BoundingBox domainBoundingBox() override;
+ void updateGridBoxData() override;
+ double characteristicCellSize() const override;
+ RigHistogramData histogramData();
+
+ cvf::ref polyLinesData() const override;
+
+protected:
+ void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
+ void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
+ void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
+ QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
+
+ void onCreateDisplayModel() override;
+ void onUpdateDisplayModelForCurrentTimeStep() override;
+ void onClampCurrentTimestep() override;
+ size_t onTimeStepCountRequested() override;
+ bool isTimeStepDependentDataVisible() const override;
+ void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
+ void onCreatePartCollectionFromSelection( cvf::Collection* parts ) override;
+ void onUpdateStaticCellColors() override;
+ void onUpdateLegends() override;
+
+ void onLoadDataAndUpdate() override;
+ void selectOverlayInfoConfig() override;
+
+ cvf::Transform* scaleTransform() override;
+
+ QString createAutoName() const override;
+
+ void setDefaultView() override;
+
+ void updateSurfacesInViewTreeItems() override;
+
+private:
+ caf::PdmChildField m_surfaceCollection;
+ caf::PdmChildField m_seismicSectionCollection;
+
+ caf::PdmChildField m_overlayInfoConfig;
+
+ caf::PdmPtrField m_seismicData;
+
+ cvf::ref m_surfaceVizModel;
+ cvf::ref m_polylinePartMgr;
+
+ cvf::ref m_scaleTransform;
+};
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.cpp
new file mode 100644
index 0000000000..3517715d6b
--- /dev/null
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.cpp
@@ -0,0 +1,81 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2023 Equinor ASA
+//
+// ResInsight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU General Public License at
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+
+#include "RimSeismicViewCollection.h"
+
+#include "RiaLogging.h"
+
+#include "Rim3dView.h"
+#include "RimGridView.h"
+#include "RimProject.h"
+#include "RimSeismicView.h"
+
+CAF_PDM_SOURCE_INIT( RimSeismicViewCollection, "SeismicViewCollection", "SeismicViewCollection" );
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicViewCollection::RimSeismicViewCollection()
+{
+ CAF_PDM_InitObject( "Views", ":/SeismicViews24x24.png" );
+
+ CAF_PDM_InitFieldNoDefault( &m_views, "Views", "Seismic Views" );
+ m_views.uiCapability()->setUiTreeHidden( true );
+
+ setDeletable( false );
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicViewCollection::~RimSeismicViewCollection()
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+std::vector RimSeismicViewCollection::views() const
+{
+ return m_views.childrenByType();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+bool RimSeismicViewCollection::isEmpty()
+{
+ return !m_views.hasChildren();
+}
+
+//--------------------------------------------------------------------------------------------------
+///
+//--------------------------------------------------------------------------------------------------
+RimSeismicView* RimSeismicViewCollection::addView( RimSeismicData* data, RiaDefines::SeismicSectionType defaultSection )
+{
+ RimSeismicView* view = new RimSeismicView();
+
+ view->setSeismicData( data );
+ view->loadDataAndUpdate();
+
+ view->addSlice( defaultSection );
+
+ m_views.push_back( view );
+
+ return view;
+}
diff --git a/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.h b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.h
new file mode 100644
index 0000000000..bfb625758a
--- /dev/null
+++ b/ApplicationLibCode/ProjectDataModel/Seismic/RimSeismicViewCollection.h
@@ -0,0 +1,48 @@
+/////////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2023 Equinor ASA
+//
+// ResInsight is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.
+//
+// See the GNU General Public License at
+// for more details.
+//
+/////////////////////////////////////////////////////////////////////////////////
+#pragma once
+
+#include "RiaSeismicDefines.h"
+
+#include "cafPdmField.h"
+
+#include "cafPdmChildArrayField.h"
+#include "cafPdmObject.h"
+
+#include
+
+class RimSeismicView;
+class RimSeismicData;
+
+class RimSeismicViewCollection : public caf::PdmObject
+{
+ CAF_PDM_HEADER_INIT;
+
+public:
+ RimSeismicViewCollection();
+ ~RimSeismicViewCollection() override;
+
+ bool isEmpty();
+
+ RimSeismicView* addView( RimSeismicData* data, RiaDefines::SeismicSectionType defaultSection );
+
+ std::vector views() const;
+
+private:
+ caf::PdmChildArrayField m_views;
+};
diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp
index e36bcd231b..fbecda8977 100644
--- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp
@@ -299,18 +299,15 @@ void RimSurfaceCollection::updateViews( const std::vector& surfsToR
{
RimProject* proj = RimProject::current();
+ // Make sure the tree items are synchronized
std::vector views;
proj->allViews( views );
-
- // Make sure the tree items are synchronized
-
for ( auto view : views )
{
- auto gridView = dynamic_cast( view );
- if ( gridView ) gridView->updateSurfacesInViewTreeItems();
+ view->updateSurfacesInViewTreeItems();
}
- std::set viewsNeedingUpdate;
+ std::set viewsNeedingUpdate;
for ( auto surf : surfsToReload )
{
@@ -320,7 +317,7 @@ void RimSurfaceCollection::updateViews( const std::vector& surfsToR
surfInView->clearGeometry();
surfInView->surfaceResultDefinition()->legendConfig()->setShowLegend( showLegend );
- auto gridView = surfInView->firstAncestorOrThisOfType();
+ auto gridView = surfInView->firstAncestorOrThisOfType();
if ( gridView ) viewsNeedingUpdate.insert( gridView );
}
}
@@ -346,9 +343,9 @@ void RimSurfaceCollection::updateViews( const std::vector& surfsToR
//--------------------------------------------------------------------------------------------------
void RimSurfaceCollection::updateViews()
{
- RimProject* proj = RimProject::current();
- std::vector views;
- proj->allVisibleGridViews( views );
+ RimProject* proj = RimProject::current();
+ std::vector views;
+ proj->allViews( views );
// Make sure the tree items are synchronized
diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp
index 4f4c18f55c..95bfb8be9e 100644
--- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.cpp
@@ -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();
+ auto ownerView = firstAncestorOrThisOfTypeAsserted();
ownerView->scheduleCreateDisplayModelAndRedraw();
}
}
@@ -242,8 +256,12 @@ void RimSurfaceInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
//--------------------------------------------------------------------------------------------------
RimIntersectionResultsDefinitionCollection* RimSurfaceInView::findSeparateResultsCollection()
{
- auto view = firstAncestorOrThisOfTypeAsserted();
- return view->separateSurfaceResultsCollection();
+ auto view = firstAncestorOrThisOfType();
+ if ( view )
+ {
+ return view->separateSurfaceResultsCollection();
+ }
+ return nullptr;
}
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h
index 205c8a8a90..a94dbd5ca7 100644
--- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h
+++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInView.h
@@ -53,6 +53,7 @@ public:
void clearGeometry();
RivSurfacePartMgr* surfacePartMgr();
+ RivSurfacePartMgr* nativeSurfacePartMgr();
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
void loadDataAndUpdate();
diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp
index 247726762f..0d7db550ba 100644
--- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp
+++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp
@@ -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();
+ auto ownerView = firstAncestorOrThisOfTypeAsserted();
ownerView->scheduleCreateDisplayModelAndRedraw();
}
}
diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h
index aeb25fe83e..494b772867 100644
--- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h
+++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h
@@ -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();
diff --git a/ApplicationLibCode/UserInterface/RiuViewer.cpp b/ApplicationLibCode/UserInterface/RiuViewer.cpp
index e6d99204af..0631d1a31c 100644
--- a/ApplicationLibCode/UserInterface/RiuViewer.cpp
+++ b/ApplicationLibCode/UserInterface/RiuViewer.cpp
@@ -252,7 +252,7 @@ void RiuViewer::clearRimView()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
-void RiuViewer::setDefaultView()
+void RiuViewer::setDefaultView( const cvf::Vec3d& dir, const cvf::Vec3d& up )
{
cvf::BoundingBox bb = m_mainRendering->boundingBox();
if ( !bb.isValid() )
@@ -273,7 +273,7 @@ void RiuViewer::setDefaultView()
}
}
- m_mainCamera->fitView( bb, -cvf::Vec3d::Z_AXIS, cvf::Vec3d::Y_AXIS );
+ m_mainCamera->fitView( bb, dir, up );
}
//--------------------------------------------------------------------------------------------------
diff --git a/ApplicationLibCode/UserInterface/RiuViewer.h b/ApplicationLibCode/UserInterface/RiuViewer.h
index 0e55dfe9ac..c22fc0cfd2 100644
--- a/ApplicationLibCode/UserInterface/RiuViewer.h
+++ b/ApplicationLibCode/UserInterface/RiuViewer.h
@@ -79,7 +79,7 @@ public:
RiuViewer( const RiuViewer& ) = delete;
void clearRimView();
- void setDefaultView();
+ void setDefaultView( const cvf::Vec3d& dir, const cvf::Vec3d& up );
cvf::Vec3d pointOfInterest();
void setPointOfInterest( cvf::Vec3d poi );
void setOwnerReservoirView( RiuViewerToViewInterface* owner );
diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp
index 84d07f1b40..8c37f592d3 100644
--- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp
+++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp
@@ -60,7 +60,9 @@
#include "RimLegendConfig.h"
#include "RimPerforationInterval.h"
#include "RimProject.h"
+#include "RimSeismicDataInterface.h"
#include "RimSeismicSection.h"
+#include "RimSeismicView.h"
#include "RimSimWellInView.h"
#include "RimStimPlanFractureTemplate.h"
#include "RimSurfaceInView.h"
@@ -171,6 +173,8 @@ void RiuViewerCommands::addCompareToViewMenu( caf::CmdFeatureMenuBuilder* menuBu
RimProject::current()->allViews( views );
for ( auto view : views )
{
+ if ( dynamic_cast( view ) ) continue;
+
if ( view != mainGridView )
{
validComparisonViews.push_back( view );
@@ -263,6 +267,13 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
// Check type of view
+ RimSeismicView* seisView = dynamic_cast( mainOrComparisonView );
+ if ( seisView )
+ {
+ // no context menu support in seismic views, yet
+ return;
+ }
+
RimGridView* gridView = dynamic_cast( mainOrComparisonView );
Rim2dIntersectionView* int2dView = dynamic_cast( mainOrComparisonView );
@@ -1211,7 +1222,15 @@ bool RiuViewerCommands::handleOverlayItemPicking( int winPosX, int winPosY )
{
if ( legendConfig && legendConfig->titledOverlayFrame() == pickedOverlayItem )
{
- RiuMainWindow::instance()->selectAsCurrentItem( legendConfig );
+ auto seisInterface = legendConfig->firstAncestorOfType();
+ if ( seisInterface != nullptr )
+ {
+ RiuMainWindow::instance()->selectAsCurrentItem( seisInterface );
+ }
+ else
+ {
+ RiuMainWindow::instance()->selectAsCurrentItem( legendConfig );
+ }
return true;
}