#2552 Minor refactoring

This commit is contained in:
Jacob Støren 2018-03-12 12:36:39 +01:00
parent 543c99371b
commit e314450e2e
3 changed files with 14 additions and 2 deletions

View File

@ -104,6 +104,8 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
m_rimWell->calculateWellPipeStaticCenterLine(m_pipeBranchesCLCoords, pipeBranchesCellIds);
double pipeRadius = m_rimWell->pipeRadius();
int crossSectionVertexCount = m_rimWell->pipeCrossSectionVertexCount();
cvf::ref<caf::DisplayCoordTransform> displayCoordXf = m_rimReservoirView->displayCoordTransform();
for (size_t brIdx = 0; brIdx < pipeBranchesCellIds.size(); ++brIdx)
{
@ -117,13 +119,12 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
pbd.m_pipeGeomGenerator = new RivPipeGeometryGenerator;
pbd.m_pipeGeomGenerator->setRadius(pipeRadius);
pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(m_rimReservoirView->wellCollection()->pipeCrossSectionVertexCount());
pbd.m_pipeGeomGenerator->setCrossSectionVertexCount(crossSectionVertexCount);
cvf::ref<cvf::Vec3dArray> cvfCoords = new cvf::Vec3dArray;
cvfCoords->assign(m_pipeBranchesCLCoords[brIdx]);
// Scale the centerline coordinates using the Z-scale transform of the grid and correct for the display offset.
cvf::ref<caf::DisplayCoordTransform> displayCoordXf = m_rimReservoirView->displayCoordTransform();
for (size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx)
{

View File

@ -281,6 +281,16 @@ double RimSimWellInView::pipeRadius()
return pipeRadius;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimSimWellInView::pipeCrossSectionVertexCount()
{
RimSimWellInViewCollection* simWellCollection = nullptr;
this->firstAncestorOrThisOfTypeAsserted(simWellCollection);
return simWellCollection->pipeCrossSectionVertexCount();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -72,6 +72,7 @@ public:
void wellHeadTopBottomPosition(int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom);
double pipeRadius();
int pipeCrossSectionVertexCount();
void schedule2dIntersectionViewUpdate();