From 3922d51790cf2d14ea44a9ceb8919e5a1f72b56b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 7 Dec 2016 14:41:48 +0100 Subject: [PATCH] #1025 Use DisplayCoordTransform for coordinate transformations --- .../ModelVisualization/RivWellSpheresPartMgr.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivWellSpheresPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellSpheresPartMgr.cpp index dd6f6bd035..c32ab52019 100644 --- a/ApplicationCode/ModelVisualization/RivWellSpheresPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellSpheresPartMgr.cpp @@ -25,6 +25,7 @@ #include "RimEclipseView.h" #include "RimEclipseWell.h" +#include "cafDisplayCoordTransform.h" #include "cafEffectGenerator.h" #include "cafPdmFieldCvfColor.h" #include "cafPdmFieldCvfMat4d.h" @@ -37,8 +38,6 @@ #include "cvfPart.h" - - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -93,15 +92,10 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicLis } } - + cvf::ref transForm = m_rimReservoirView->displayCoordTransform(); for (cvf::Vec3d c : cellCenters) { - cvf::Vec4d transfCoord = m_scaleTransform->worldTransform() * cvf::Vec4d(c - mainGrid->displayModelOffset(), 1); - - cvf::Vec3d displayCoord; - displayCoord[0] = transfCoord[0]; - displayCoord[1] = transfCoord[1]; - displayCoord[2] = transfCoord[2]; + cvf::Vec3d displayCoord = transForm->transformToDisplayCoord(c); cvf::ref geo = createSphere(10, displayCoord); cvf::ref part = createPart(geo.p());