#2552 Use displayCoordTransform and redability changes

This commit is contained in:
Jacob Støren 2018-03-12 11:33:22 +01:00
parent 06b619cd17
commit 543c99371b
2 changed files with 11 additions and 8 deletions

View File

@ -50,6 +50,7 @@
#include "cvfRay.h"
#include "cvfScalarMapperDiscreteLinear.h"
#include "cvfTransform.h"
#include "cafDisplayCoordTransform.h"
//--------------------------------------------------------------------------------------------------
@ -122,14 +123,11 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
cvfCoords->assign(m_pipeBranchesCLCoords[brIdx]);
// Scale the centerline coordinates using the Z-scale transform of the grid and correct for the display offset.
const RigMainGrid* mainGrid = m_rimReservoirView->mainGrid();
cvf::ref<caf::DisplayCoordTransform> displayCoordXf = m_rimReservoirView->displayCoordTransform();
for (size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx)
{
cvf::Vec4d transfCoord = m_scaleTransform->worldTransform()* cvf::Vec4d((*cvfCoords)[cIdx] - mainGrid->displayModelOffset(), 1);
(*cvfCoords)[cIdx][0] = transfCoord[0];
(*cvfCoords)[cIdx][1] = transfCoord[1];
(*cvfCoords)[cIdx][2] = transfCoord[2];
(*cvfCoords)[cIdx] = displayCoordXf->transformToDisplayCoord((*cvfCoords)[cIdx]);
}
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());

View File

@ -40,7 +40,8 @@ RivWellPathsPartMgr::~RivWellPathsPartMgr() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, double characteristicCellSize,
void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
{
@ -72,7 +73,8 @@ void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model, const QDateTime& timeStamp,
void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
@ -83,7 +85,10 @@ void RivWellPathsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
for (auto& partMgr : m_wellPatshsPartMgrs)
{
partMgr->appendDynamicGeometryPartsToModel(model, timeStamp, characteristicCellSize, wellPathClipBoundingBox,
partMgr->appendDynamicGeometryPartsToModel(model,
timeStamp,
characteristicCellSize,
wellPathClipBoundingBox,
displayCoordTransform);
}
}