mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use the top and bottom layer of active cells to compute the geometry bounding box
This commit is contained in:
@@ -656,12 +656,20 @@ void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Use the top and bottom layer of active cells to compute the bounding box
|
||||||
|
|
||||||
|
auto [minBB, maxBB] = activeInfos[acIdx]->ijkBoundingBox();
|
||||||
|
|
||||||
|
for ( auto k : { minBB.z(), maxBB.z() } )
|
||||||
|
{
|
||||||
|
for ( size_t i = minBB.x(); i <= maxBB.x(); i++ )
|
||||||
|
{
|
||||||
|
for ( size_t j = minBB.y(); j <= maxBB.y(); j++ )
|
||||||
|
{
|
||||||
|
size_t cellIndex = m_mainGrid->cellIndexFromIJK( i, j, k );
|
||||||
|
|
||||||
std::array<cvf::Vec3d, 8> hexCorners;
|
std::array<cvf::Vec3d, 8> hexCorners;
|
||||||
for ( size_t i = 0; i < m_mainGrid->cellCount(); i++ )
|
m_mainGrid->cellCornerVertices( cellIndex, hexCorners.data() );
|
||||||
{
|
|
||||||
if ( activeInfos[acIdx]->isActive( i ) )
|
|
||||||
{
|
|
||||||
m_mainGrid->cellCornerVertices( i, hexCorners.data() );
|
|
||||||
for ( const auto& corner : hexCorners )
|
for ( const auto& corner : hexCorners )
|
||||||
{
|
{
|
||||||
bb.add( corner );
|
bb.add( corner );
|
||||||
@@ -669,6 +677,7 @@ void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
activeInfos[acIdx]->setGeometryBoundingBox( bb );
|
activeInfos[acIdx]->setGeometryBoundingBox( bb );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user