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:
@@ -116,6 +116,8 @@ void RigMainGrid::computeCachedData()
|
|||||||
{
|
{
|
||||||
initAllSubGridsParentGridPointer();
|
initAllSubGridsParentGridPointer();
|
||||||
initAllSubCellsMainGridCellIndex();
|
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
|
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())
|
if (m_cellSearchTree.isNull())
|
||||||
{
|
{
|
||||||
@@ -476,8 +488,6 @@ void RigMainGrid::findIntersectingCells(const cvf::BoundingBox& inputBB, std::ve
|
|||||||
m_cellSearchTree = new cvf::BoundingBoxTree;
|
m_cellSearchTree = new cvf::BoundingBoxTree;
|
||||||
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
|
m_cellSearchTree->buildTreeFromBoundingBoxes(cellBoundingBoxes, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cellSearchTree->findIntersections(inputBB, cellIndices);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -69,11 +69,13 @@ public:
|
|||||||
|
|
||||||
void setFlipAxis(bool flipXAxis, bool flipYAxis);
|
void setFlipAxis(bool flipXAxis, bool flipYAxis);
|
||||||
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const;
|
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* cellIndices) const;
|
||||||
|
|
||||||
cvf::BoundingBox boundingBox() const;
|
cvf::BoundingBox boundingBox() const;
|
||||||
private:
|
private:
|
||||||
void initAllSubGridsParentGridPointer();
|
void initAllSubGridsParentGridPointer();
|
||||||
void initAllSubCellsMainGridCellIndex();
|
void initAllSubCellsMainGridCellIndex();
|
||||||
void computeActiveAndValidCellRanges();
|
void computeActiveAndValidCellRanges();
|
||||||
|
void buildCellSearchTree();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
std::vector<cvf::Vec3d> m_nodes; ///< Global vertex table
|
||||||
@@ -87,7 +89,7 @@ private:
|
|||||||
cvf::ref<RigFaultsPrCellAccumulator> m_faultsPrCellAcc;
|
cvf::ref<RigFaultsPrCellAccumulator> m_faultsPrCellAcc;
|
||||||
|
|
||||||
cvf::Vec3d m_displayModelOffset;
|
cvf::Vec3d m_displayModelOffset;
|
||||||
mutable cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
|
cvf::ref<cvf::BoundingBoxTree> m_cellSearchTree;
|
||||||
mutable cvf::BoundingBox m_boundingBox;
|
mutable cvf::BoundingBox m_boundingBox;
|
||||||
|
|
||||||
bool m_flipXAxis;
|
bool m_flipXAxis;
|
||||||
|
|||||||
Reference in New Issue
Block a user