mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2663 Zoom All : Check if completions intersects bounding box of model
This commit is contained in:
@@ -88,7 +88,43 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model)
|
||||
bool RivWellPathPartMgr::isWellPathWithinBoundingBox(const cvf::BoundingBox& wellPathClipBoundingBox) const
|
||||
{
|
||||
if (!m_rimWellPath->wellPathGeometry()) return false;
|
||||
|
||||
const std::vector<cvf::Vec3d>& wellpathCenterLine = m_rimWellPath->wellPathGeometry()->m_wellPathPoints;
|
||||
if (wellpathCenterLine.size() < 2) return false;
|
||||
|
||||
// Skip visualization if outside the domain of this case
|
||||
{
|
||||
cvf::Vec3d casemax = wellPathClipBoundingBox.max();
|
||||
cvf::Vec3d casemin = wellPathClipBoundingBox.min();
|
||||
cvf::Vec3d caseext = wellPathClipBoundingBox.extent();
|
||||
|
||||
// Add up to the sealevel
|
||||
cvf::BoundingBox relevantWellpathBBox = wellPathClipBoundingBox;
|
||||
relevantWellpathBBox.add(cvf::Vec3d(casemax.x(), casemax.y(), 0.0));
|
||||
|
||||
// Add some sideways leeway
|
||||
|
||||
cvf::Vec3d addSize = 3.0*cvf::Vec3d(caseext.x(), caseext.y(), 0.0);
|
||||
relevantWellpathBBox.add(casemax + addSize);
|
||||
relevantWellpathBBox.add(casemin - addSize);
|
||||
|
||||
if (!RigWellPath::isPolylineTouchingBBox(wellpathCenterLine, relevantWellpathBBox))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox)
|
||||
{
|
||||
if (m_rimView.isNull()) return;
|
||||
|
||||
@@ -97,6 +133,8 @@ void RivWellPathPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* m
|
||||
|
||||
if (!m_rimWellPath || !m_rimWellPath->showWellPath() || !m_rimWellPath->fractureCollection()->isChecked()) return;
|
||||
|
||||
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
|
||||
|
||||
for (RimWellPathFracture* f : m_rimWellPath->fractureCollection()->fractures())
|
||||
{
|
||||
CVF_ASSERT(f);
|
||||
@@ -307,28 +345,6 @@ void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* di
|
||||
|
||||
std::vector<cvf::Vec3d> clippedWellPathCenterLine;
|
||||
|
||||
// Skip visualization if outside the domain of this case
|
||||
{
|
||||
cvf::Vec3d casemax = wellPathClipBoundingBox.max();
|
||||
cvf::Vec3d casemin = wellPathClipBoundingBox.min();
|
||||
cvf::Vec3d caseext = wellPathClipBoundingBox.extent();
|
||||
|
||||
// Add up to the sealevel
|
||||
cvf::BoundingBox relevantWellpathBBox = wellPathClipBoundingBox;
|
||||
relevantWellpathBBox.add(cvf::Vec3d(casemax.x(), casemax.y(), 0.0));
|
||||
|
||||
// Add some sideways leeway
|
||||
|
||||
cvf::Vec3d addSize = 3.0*cvf::Vec3d(caseext.x(), caseext.y(), 0.0);
|
||||
relevantWellpathBBox.add(casemax + addSize);
|
||||
relevantWellpathBBox.add(casemin - addSize);
|
||||
|
||||
if ( !RigWellPath::isPolylineTouchingBBox(wellpathCenterLine, relevantWellpathBBox) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the well path geometry as a line and pipe structure
|
||||
|
||||
m_pipeGeomGenerator = new RivPipeGeometryGenerator;
|
||||
@@ -464,6 +480,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
|
||||
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false )
|
||||
return;
|
||||
|
||||
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
|
||||
|
||||
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
|
||||
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox, false);
|
||||
|
||||
@@ -494,6 +512,8 @@ void RivWellPathPartMgr::appendFlattenedStaticGeometryPartsToModel(cvf::ModelBas
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox)
|
||||
{
|
||||
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
|
||||
|
||||
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
|
||||
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox, true);
|
||||
|
||||
@@ -536,6 +556,8 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList*
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
|
||||
|
||||
appendPerforationsToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize, false);
|
||||
appendVirtualTransmissibilitiesToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize);
|
||||
|
||||
@@ -562,6 +584,8 @@ void RivWellPathPartMgr::appendFlattenedDynamicGeometryPartsToModel(cvf::ModelBa
|
||||
|
||||
if (m_rimWellPath.isNull()) return;
|
||||
|
||||
if (!isWellPathWithinBoundingBox(wellPathClipBoundingBox)) return;
|
||||
|
||||
appendPerforationsToModel(model, timeStepIndex, displayCoordTransform, characteristicCellSize, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox);
|
||||
|
||||
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
|
||||
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model, const cvf::BoundingBox& wellPathClipBoundingBox);
|
||||
|
||||
private:
|
||||
void appendFishboneSubsPartsToModel(cvf::ModelBasicList* model,
|
||||
@@ -113,6 +113,8 @@ private:
|
||||
inline RimWellPathCollection* wellPathCollection();
|
||||
inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection);
|
||||
|
||||
bool isWellPathWithinBoundingBox(const cvf::BoundingBox& wellPathClipBoundingBox) const;
|
||||
|
||||
private:
|
||||
caf::PdmPointer<RimWellPath> m_rimWellPath;
|
||||
caf::PdmPointer<Rim3dView> m_rimView;
|
||||
|
||||
@@ -61,7 +61,8 @@ void RivWellPathsPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model)
|
||||
void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList* model,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox)
|
||||
{
|
||||
if (!isWellPathVisible()) return;
|
||||
|
||||
@@ -69,7 +70,7 @@ void RivWellPathsPartMgr::appendStaticFracturePartsToModel(cvf::ModelBasicList*
|
||||
|
||||
for (auto& partMgr : m_wellPathsPartMgrs)
|
||||
{
|
||||
partMgr->appendStaticFracturePartsToModel(model);
|
||||
partMgr->appendStaticFracturePartsToModel(model, wellPathClipBoundingBox);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
const caf::DisplayCoordTransform* displayCoordTransform,
|
||||
double characteristicCellSize,
|
||||
const cvf::BoundingBox& wellPathClipBoundingBox);
|
||||
|
||||
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model);
|
||||
|
||||
void appendStaticFracturePartsToModel(cvf::ModelBasicList* model, const cvf::BoundingBox& wellPathClipBoundingBox);
|
||||
|
||||
private:
|
||||
void clearGeometryCache();
|
||||
|
||||
@@ -511,7 +511,7 @@ void RimEclipseView::createDisplayModel()
|
||||
|
||||
addWellPathsToModel(m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox());
|
||||
|
||||
m_wellPathsPartManager->appendStaticFracturePartsToModel(m_wellPathPipeVizModel.p());
|
||||
m_wellPathsPartManager->appendStaticFracturePartsToModel(m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox());
|
||||
m_wellPathPipeVizModel->updateBoundingBoxesRecursive();
|
||||
m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user