mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crashes when scene in one view is empty
This commit is contained in:
@@ -53,8 +53,13 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Source bounding box in global coordinates including scaleZ
|
// Source bounding box in global coordinates including scaleZ
|
||||||
cvf::BoundingBox sourceSceneBB = sourceView->viewer()->currentScene()->boundingBox();
|
cvf::BoundingBox sourceSceneBB;
|
||||||
{
|
{
|
||||||
|
if ( sourceView->viewer()->currentScene() )
|
||||||
|
{
|
||||||
|
sourceSceneBB = sourceView->viewer()->currentScene()->boundingBox();
|
||||||
|
}
|
||||||
|
|
||||||
cvf::Vec3d offset = cvf::Vec3d::ZERO;
|
cvf::Vec3d offset = cvf::Vec3d::ZERO;
|
||||||
RimCase* sourceOwnerCase = sourceView->ownerCase();
|
RimCase* sourceOwnerCase = sourceView->ownerCase();
|
||||||
if ( sourceOwnerCase )
|
if ( sourceOwnerCase )
|
||||||
@@ -84,7 +89,12 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView*
|
|||||||
destinationViewer->enableParallelProjection( !sourceView->isPerspectiveView );
|
destinationViewer->enableParallelProjection( !sourceView->isPerspectiveView );
|
||||||
|
|
||||||
// Destination bounding box in global coordinates including scaleZ
|
// Destination bounding box in global coordinates including scaleZ
|
||||||
cvf::BoundingBox destSceneBB = destinationViewer->currentScene()->boundingBox();
|
cvf::BoundingBox destSceneBB;
|
||||||
|
if ( destinationViewer->currentScene() )
|
||||||
|
{
|
||||||
|
destSceneBB = destinationViewer->currentScene()->boundingBox();
|
||||||
|
}
|
||||||
|
|
||||||
cvf::Vec3d destinationCamEye = sourceCamGlobalEye;
|
cvf::Vec3d destinationCamEye = sourceCamGlobalEye;
|
||||||
cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint;
|
cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint;
|
||||||
cvf::Vec3d offset = cvf::Vec3d::ZERO;
|
cvf::Vec3d offset = cvf::Vec3d::ZERO;
|
||||||
|
|||||||
Reference in New Issue
Block a user