mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 07:26:03 -06:00
(#676) Start intersections of well paths when the trajectory enters the active cells bounding box.
This commit is contained in:
parent
f8d3b85047
commit
9fff7825af
@ -259,6 +259,7 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
|
||||
if (wellPath())
|
||||
{
|
||||
lines.push_back(wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||
clipToReservoir(lines[0]);
|
||||
}
|
||||
}
|
||||
else if (type == CS_SIMULATION_WELL)
|
||||
@ -289,8 +290,6 @@ std::vector< std::vector <cvf::Vec3d> > RimCrossSection::polyLines() const
|
||||
{
|
||||
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
|
||||
addExtents(polyLine);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,3 +422,49 @@ void RimCrossSection::updateName()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCrossSection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const
|
||||
{
|
||||
RimCase* ownerCase = NULL;
|
||||
firstAnchestorOrThisOfType(ownerCase);
|
||||
|
||||
std::vector<cvf::Vec3d> clippedPolyLine;
|
||||
|
||||
if (ownerCase)
|
||||
{
|
||||
cvf::BoundingBox caseBB = ownerCase->activeCellsBoundingBox();
|
||||
bool hasEnteredReservoirBB = false;
|
||||
for (size_t vxIdx = 0 ; vxIdx < polyLine.size(); ++vxIdx)
|
||||
{
|
||||
if (!caseBB.contains(polyLine[vxIdx]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hasEnteredReservoirBB)
|
||||
{
|
||||
if (vxIdx > 0)
|
||||
{
|
||||
// clip line, and add vx to start
|
||||
cvf::Plane topPlane;
|
||||
topPlane.setFromPointAndNormal(caseBB.max(), cvf::Vec3d::Z_AXIS);
|
||||
cvf::Vec3d intersection;
|
||||
|
||||
if (topPlane.intersect(polyLine[vxIdx-1], polyLine[vxIdx], &intersection))
|
||||
{
|
||||
clippedPolyLine.push_back(intersection);
|
||||
}
|
||||
}
|
||||
|
||||
hasEnteredReservoirBB = true;
|
||||
}
|
||||
|
||||
clippedPolyLine.push_back(polyLine[vxIdx]);
|
||||
}
|
||||
}
|
||||
|
||||
polyLine.swap(clippedPolyLine);
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@ private:
|
||||
void updateWellCenterline() const;
|
||||
void updateWellExtentDefaultValue();
|
||||
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
||||
void clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const;
|
||||
void updateName();
|
||||
private:
|
||||
cvf::ref<RivCrossSectionPartMgr> m_crossSectionPartMgr;
|
||||
|
Loading…
Reference in New Issue
Block a user