Wellcollection can control if well head label is positioned at top active cell for IJ column or top Z of active cells bounding box

p4#: 22190
This commit is contained in:
Magne Sjaastad
2013-08-22 07:55:21 +02:00
parent cbbc5ae80b
commit 627211685d
3 changed files with 53 additions and 6 deletions

View File

@@ -110,18 +110,44 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
// Compute well head based on the z position of the top of the K column the well head is part of
cvf::Vec3d whEndPos = whStartPos;
if (m_rimReservoirView->wellCollection()->wellHeadPosition() == RimWellCollection::WELLHEAD_POS_TOP_COLUMN)
{
// Position well head at top active cell of IJ-column
size_t i, j, k;
rigReservoir->mainGrid()->ijkFromCellIndex(whCell.mainGridCellIndex(), &i, &j, &k);
size_t topCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, 0);
const RigCell& topCell = rigReservoir->mainGrid()->cell(topCellIndex);
cvf::Vec3d topCellPos = topCell.faceCenter(cvf::StructGridInterface::NEG_K);
size_t kIndexWellHeadCell = k;
k = 0;
size_t topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
while(k < kIndexWellHeadCell && !m_rimReservoirView->currentActiveCellInfo()->isActive(topActiveCellIndex))
{
k++;
topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
}
const RigCell& topActiveCell = rigReservoir->mainGrid()->cell(topActiveCellIndex);
cvf::Vec3d topCellPos = topActiveCell.faceCenter(cvf::StructGridInterface::NEG_K);
topCellPos -= rigReservoir->mainGrid()->displayModelOffset();
topCellPos.transformPoint(m_scaleTransform->worldTransform());
whEndPos.z() = topCellPos.z();
// Modify position if top active cell is closer to sea than well head
if (kIndexWellHeadCell > k)
{
whEndPos.z() = topCellPos.z() + characteristicCellSize;
}
}
else
{
// Position well head at top of active cells bounding box
cvf::Vec3d activeCellsBoundingBoxMax = m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max();
activeCellsBoundingBoxMax -= rigReservoir->mainGrid()->displayModelOffset();
activeCellsBoundingBoxMax.transformPoint(m_scaleTransform->worldTransform());
whEndPos.z() = activeCellsBoundingBoxMax.z();
}
cvf::Vec3d arrowPosition = whEndPos;