Removed invalid cells from bbox search tree.

Improving performance on startup and avoid possible stack exhaust error.
This commit is contained in:
Jacob Støren 2015-12-15 13:50:59 +01:00
parent cd4c9e6ee0
commit 7737a713c5

View File

@ -474,6 +474,9 @@ void RigMainGrid::buildCellSearchTree()
for (size_t cIdx = 0; cIdx < cellCount; ++cIdx)
{
const caf::SizeTArray8& cellIndices = m_cells[cIdx].cornerIndices();
if (m_cells[cIdx].isInvalid()) continue;
cvf::BoundingBox& cellBB = cellBoundingBoxes[cIdx];
cellBB.add(m_nodes[cellIndices[0]]);
cellBB.add(m_nodes[cellIndices[1]]);