mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#700) Build bounding box search tree when grid is loaded
This commit is contained in:
parent
47bb20368a
commit
4713014d26
@ -116,6 +116,8 @@ void RigMainGrid::computeCachedData()
|
||||
{
|
||||
initAllSubGridsParentGridPointer();
|
||||
initAllSubCellsMainGridCellIndex();
|
||||
|
||||
buildCellSearchTree();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -449,6 +451,16 @@ const RigFault* RigMainGrid::findFaultFromCellIndexAndCellFace(size_t reservoirC
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const
|
||||
{
|
||||
CVF_ASSERT(m_cellSearchTree.notNull());
|
||||
|
||||
m_cellSearchTree->findIntersections(inputBB, cellIndices);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigMainGrid::buildCellSearchTree()
|
||||
{
|
||||
if (m_cellSearchTree.isNull())
|
||||
{
|
||||
@ -476,8 +488,6 @@ void RigMainGrid::findIntersectingCells(const cvf::BoundingBox& inputBB, std::ve
|
||||
m_cellSearchTree = new cvf::BoundingBoxTree;
|
||||
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
|
||||
}
|
||||
|
||||
m_cellSearchTree->findIntersections(inputBB, cellIndices);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -69,11 +69,13 @@ public:
|
||||
|
||||
void setFlipAxis(bool flipXAxis, bool flipYAxis);
|
||||
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const;
|
||||
cvf::BoundingBox boundingBox() const;
|
||||
|
||||
cvf::BoundingBox boundingBox() const;
|
||||
private:
|
||||
void initAllSubGridsParentGridPointer();
|
||||
void initAllSubCellsMainGridCellIndex();
|
||||
void computeActiveAndValidCellRanges();
|
||||
void buildCellSearchTree();
|
||||
|
||||
private:
|
||||
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
||||
@ -87,7 +89,7 @@ private:
|
||||
cvf::ref<RigFaultsPrCellAccumulator> m_faultsPrCellAcc;
|
||||
|
||||
cvf::Vec3d m_displayModelOffset;
|
||||
mutable cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
|
||||
cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
|
||||
mutable cvf::BoundingBox m_boundingBox;
|
||||
|
||||
bool m_flipXAxis;
|
||||
|
Loading…
Reference in New Issue
Block a user