From c0217a68a4f89f86cfb5550528f001714a5590e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 27 Apr 2015 14:06:42 +0200 Subject: [PATCH] First odb file read and displayed --- ApplicationCode/ProjectDataModel/RimGeoMechView.cpp | 3 ++- ApplicationCode/UserInterface/RiuViewer.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index 1625807f5c..af94589423 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -247,9 +247,10 @@ void RimGeoMechView::createDisplayModelAndRedraw() cvf::ref scene = new cvf::Scene; scene->addModel(cvfModel.p()); + scene->updateBoundingBoxesRecursive(); m_viewer->setMainScene(scene.p()); - + m_viewer->zoomAll(); m_viewer->update(); } RiuMainWindow::instance()->refreshAnimationActions(); diff --git a/ApplicationCode/UserInterface/RiuViewer.cpp b/ApplicationCode/UserInterface/RiuViewer.cpp index dc6fd634ed..60dc664fa5 100644 --- a/ApplicationCode/UserInterface/RiuViewer.cpp +++ b/ApplicationCode/UserInterface/RiuViewer.cpp @@ -531,7 +531,12 @@ void RiuViewer::pickPointAndFace(int winPosX, int winPosY, cvf::Vec3d* localInte { CVF_ASSERT(hitItems.count() > 0); - double characteristicCellSize = m_reservoirView->eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize(); + double characteristicCellSize = 5.0; + if (m_reservoirView && m_reservoirView->eclipseCase()) + { + characteristicCellSize = m_reservoirView->eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize(); + } + double pickDepthThresholdSquared = characteristicCellSize / 100.0; pickDepthThresholdSquared = pickDepthThresholdSquared * pickDepthThresholdSquared;