mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#4849 Co-visualization: Simple use of the comparison view support in the Viewer classes
The feature is ready for testing.
This commit is contained in:
1 parent
aee42f403b
commit
b0f8dfa9e6
13 files changed
+523
-178
No files matched your search
@@ -188,7 +188,7 @@ void RimGeoMechView::updateScaleTransform()
|
||||
|
||||
this->scaleTransform()->setLocalTransform( scale );
|
||||
|
||||
if ( m_viewer ) m_viewer->updateCachedValuesInScene();
|
||||
if ( nativeOrOverrideViewer() ) nativeOrOverrideViewer()->updateCachedValuesInScene();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -233,7 +233,7 @@ QString RimGeoMechView::createAutoName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::createDisplayModel()
|
||||
{
|
||||
if ( m_viewer.isNull() ) return;
|
||||
if ( nativeOrOverrideViewer() == nullptr ) return;
|
||||
|
||||
if ( !( m_geomechCase && m_geomechCase->geoMechData() && m_geomechCase->geoMechData()->femParts() ) ) return;
|
||||
|
||||
@@ -244,25 +244,26 @@ void RimGeoMechView::createDisplayModel()
|
||||
// Remove all existing animation frames from the viewer.
|
||||
// The parts are still cached in the RivReservoir geometry and friends
|
||||
|
||||
m_viewer->removeAllFrames();
|
||||
nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
|
||||
|
||||
if ( isTimeStepDependentDataVisible() )
|
||||
if ( isTimeStepDependentDataVisibleInThisOrComparisonView() )
|
||||
{
|
||||
// Create empty frames in the viewer
|
||||
|
||||
int frameCount = geoMechCase()->geoMechData()->femPartResults()->frameCount();
|
||||
for ( int frameIndex = 0; frameIndex < frameCount; frameIndex++ )
|
||||
{
|
||||
cvf::ref<cvf::Scene> scene = new cvf::Scene;
|
||||
scene->addModel( new cvf::ModelBasicList );
|
||||
m_viewer->addFrame( scene.p() );
|
||||
cvf::ref<cvf::Scene> scene = new cvf::Scene;
|
||||
cvf::ref<cvf::ModelBasicList> emptyModel = new cvf::ModelBasicList;
|
||||
emptyModel->setName( "EmptyModel" );
|
||||
scene->addModel( emptyModel.p() );
|
||||
nativeOrOverrideViewer()->addFrame( scene.p(), isUsingOverrideViewer() );
|
||||
}
|
||||
}
|
||||
|
||||
// Set the Main scene in the viewer. Used when the animation is in "Stopped" state
|
||||
|
||||
cvf::ref<cvf::Scene> mainScene = new cvf::Scene;
|
||||
m_viewer->setMainScene( mainScene.p() );
|
||||
|
||||
// Grid model
|
||||
cvf::ref<cvf::ModelBasicList> mainSceneGridVizModel = new cvf::ModelBasicList;
|
||||
@@ -271,6 +272,7 @@ void RimGeoMechView::createDisplayModel()
|
||||
|
||||
mainSceneGridVizModel->updateBoundingBoxesRecursive();
|
||||
mainScene->addModel( mainSceneGridVizModel.p() );
|
||||
nativeOrOverrideViewer()->setMainScene( mainScene.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Well path model
|
||||
|
||||
@@ -279,19 +281,19 @@ void RimGeoMechView::createDisplayModel()
|
||||
m_wellPathPipeVizModel->removeAllParts();
|
||||
addWellPathsToModel( m_wellPathPipeVizModel.p(), femBBox );
|
||||
|
||||
m_viewer->addStaticModelOnce( m_wellPathPipeVizModel.p() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Cross sections
|
||||
|
||||
m_crossSectionVizModel->removeAllParts();
|
||||
m_crossSectionCollection->appendPartsToModel( *this, m_crossSectionVizModel.p(), scaleTransform() );
|
||||
m_viewer->addStaticModelOnce( m_crossSectionVizModel.p() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_crossSectionVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
// If the animation was active before recreating everything, make viewer view current frame
|
||||
|
||||
if ( isTimeStepDependentDataVisible() )
|
||||
if ( isTimeStepDependentDataVisibleInThisOrComparisonView() )
|
||||
{
|
||||
m_viewer->setCurrentFrame( m_currentTimeStep );
|
||||
if ( viewer() ) viewer()->setCurrentFrame( m_currentTimeStep );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -318,11 +320,11 @@ void RimGeoMechView::updateCurrentTimeStep()
|
||||
{
|
||||
updateLegends();
|
||||
|
||||
if ( this->isTimeStepDependentDataVisible() )
|
||||
if ( this->isTimeStepDependentDataVisibleInThisOrComparisonView() )
|
||||
{
|
||||
if ( m_viewer )
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
cvf::Scene* frameScene = m_viewer->frame( m_currentTimeStep );
|
||||
cvf::Scene* frameScene = nativeOrOverrideViewer()->frame( m_currentTimeStep, isUsingOverrideViewer() );
|
||||
if ( frameScene )
|
||||
{
|
||||
{
|
||||
@@ -391,7 +393,7 @@ void RimGeoMechView::updateCurrentTimeStep()
|
||||
m_vizLogic->updateStaticCellColors( -1 );
|
||||
m_crossSectionCollection->applySingleColorEffect();
|
||||
|
||||
m_viewer->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||
nativeOrOverrideViewer()->animationControl()->slotPause(); // To avoid animation timer spinning in the background
|
||||
}
|
||||
|
||||
m_overlayInfoConfig()->update3DInfo();
|
||||
@@ -421,8 +423,8 @@ void RimGeoMechView::resetLegendsInViewer()
|
||||
{
|
||||
this->cellResult()->legendConfig->recreateLegend();
|
||||
|
||||
m_viewer->removeAllColorLegends();
|
||||
m_viewer->addColorLegendToBottomLeftCorner( this->cellResult()->legendConfig->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeAllColorLegends();
|
||||
nativeOrOverrideViewer()->addColorLegendToBottomLeftCorner( this->cellResult()->legendConfig->titledOverlayFrame() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -430,15 +432,23 @@ void RimGeoMechView::resetLegendsInViewer()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechView::updateLegends()
|
||||
{
|
||||
if ( m_viewer )
|
||||
if ( nativeOrOverrideViewer() )
|
||||
{
|
||||
m_viewer->removeAllColorLegends();
|
||||
if ( !isUsingOverrideViewer() )
|
||||
{
|
||||
nativeOrOverrideViewer()->removeAllColorLegends();
|
||||
}
|
||||
else
|
||||
{
|
||||
nativeOrOverrideViewer()->removeColorLegend( cellResult()->legendConfig->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->removeColorLegend( m_tensorResults->arrowColorLegendConfig->titledOverlayFrame() );
|
||||
}
|
||||
|
||||
this->updateLegendTextAndRanges( cellResult()->legendConfig(), m_currentTimeStep() );
|
||||
|
||||
if ( cellResult()->hasResult() && cellResult()->legendConfig()->showLegend() )
|
||||
{
|
||||
m_viewer->addColorLegendToBottomLeftCorner( cellResult()->legendConfig->titledOverlayFrame() );
|
||||
nativeOrOverrideViewer()->addColorLegendToBottomLeftCorner( cellResult()->legendConfig->titledOverlayFrame() );
|
||||
}
|
||||
|
||||
if ( tensorResults()->showTensors() )
|
||||
@@ -448,7 +458,7 @@ void RimGeoMechView::updateLegends()
|
||||
if ( tensorResults()->vectorColors() == RimTensorResults::RESULT_COLORS &&
|
||||
tensorResults()->arrowColorLegendConfig()->showLegend() )
|
||||
{
|
||||
m_viewer->addColorLegendToBottomLeftCorner(
|
||||
nativeOrOverrideViewer()->addColorLegendToBottomLeftCorner(
|
||||
m_tensorResults->arrowColorLegendConfig->titledOverlayFrame() );
|
||||
}
|
||||
}
|
||||
@@ -678,10 +688,10 @@ void RimGeoMechView::convertCameraPositionFromOldProjectFiles()
|
||||
viewerToViewInterface->setCameraPointOfInterest( newPointOfInterest );
|
||||
}
|
||||
|
||||
if ( m_viewer )
|
||||
if ( viewer() )
|
||||
{
|
||||
m_viewer->mainCamera()->setViewMatrix( this->cameraPosition() );
|
||||
m_viewer->setPointOfInterest( this->cameraPointOfInterest() );
|
||||
viewer()->mainCamera()->setViewMatrix( this->cameraPosition() );
|
||||
viewer()->setPointOfInterest( this->cameraPointOfInterest() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user