mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2457 Make 2d intersection view length start at well start
This commit is contained in:
@@ -45,12 +45,14 @@ RivIntersectionGeometryGenerator::RivIntersectionGeometryGenerator( RimIntersect
|
|||||||
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||||
const cvf::Vec3d& extrusionDirection,
|
const cvf::Vec3d& extrusionDirection,
|
||||||
const RivIntersectionHexGridInterface* grid,
|
const RivIntersectionHexGridInterface* grid,
|
||||||
bool isFlattened)
|
bool isFlattened,
|
||||||
|
double horizontalLengthAlongWellToPolylineStart)
|
||||||
: m_crossSection(crossSection),
|
: m_crossSection(crossSection),
|
||||||
m_polyLines(polylines),
|
m_polyLines(polylines),
|
||||||
m_extrusionDirection(extrusionDirection),
|
m_extrusionDirection(extrusionDirection),
|
||||||
m_hexGrid(grid),
|
m_hexGrid(grid),
|
||||||
m_isFlattened(isFlattened)
|
m_isFlattened(isFlattened),
|
||||||
|
m_horizontalLengthAlongWellToPolylineStart(horizontalLengthAlongWellToPolylineStart)
|
||||||
{
|
{
|
||||||
m_triangleVxes = new cvf::Vec3fArray;
|
m_triangleVxes = new cvf::Vec3fArray;
|
||||||
m_cellBorderLineVxes = new cvf::Vec3fArray;
|
m_cellBorderLineVxes = new cvf::Vec3fArray;
|
||||||
@@ -109,7 +111,7 @@ void RivIntersectionGeometryGenerator::calculateSegementTransformPrLinePoint()
|
|||||||
|
|
||||||
m_segementTransformPrLinePoint.clear();
|
m_segementTransformPrLinePoint.clear();
|
||||||
|
|
||||||
double previousSectionFlattenedEndPosX = 0.0;
|
double previousSectionFlattenedEndPosX = m_horizontalLengthAlongWellToPolylineStart;
|
||||||
cvf::Vec3d previousSectionOrigo(cvf::Vec3d::ZERO);
|
cvf::Vec3d previousSectionOrigo(cvf::Vec3d::ZERO);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ public:
|
|||||||
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
std::vector<std::vector<cvf::Vec3d> > &polylines,
|
||||||
const cvf::Vec3d& extrusionDirection,
|
const cvf::Vec3d& extrusionDirection,
|
||||||
const RivIntersectionHexGridInterface* grid,
|
const RivIntersectionHexGridInterface* grid,
|
||||||
bool isFlattened );
|
bool isFlattened,
|
||||||
|
double horizontalLengthAlongWellToPolylineStart);
|
||||||
|
|
||||||
~RivIntersectionGeometryGenerator();
|
~RivIntersectionGeometryGenerator();
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ private:
|
|||||||
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
|
const std::vector<std::vector<cvf::Vec3d> > m_polyLines;
|
||||||
cvf::Vec3d m_extrusionDirection;
|
cvf::Vec3d m_extrusionDirection;
|
||||||
bool m_isFlattened;
|
bool m_isFlattened;
|
||||||
|
double m_horizontalLengthAlongWellToPolylineStart;
|
||||||
|
|
||||||
// Output arrays
|
// Output arrays
|
||||||
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
cvf::ref<cvf::Vec3fArray> m_triangleVxes;
|
||||||
|
|||||||
@@ -82,12 +82,19 @@ RivIntersectionPartMgr::RivIntersectionPartMgr(RimIntersection* rimCrossSection,
|
|||||||
|
|
||||||
m_crossSectionFacesTextureCoords = new cvf::Vec2fArray;
|
m_crossSectionFacesTextureCoords = new cvf::Vec2fArray;
|
||||||
|
|
||||||
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines();
|
double horizontalLengthAlongWellToPolylineStart;
|
||||||
|
|
||||||
|
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines(&horizontalLengthAlongWellToPolylineStart);
|
||||||
if (polyLines.size() > 0)
|
if (polyLines.size() > 0)
|
||||||
{
|
{
|
||||||
cvf::Vec3d direction = m_rimCrossSection->extrusionDirection();
|
cvf::Vec3d direction = m_rimCrossSection->extrusionDirection();
|
||||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = createHexGridInterface();
|
cvf::ref<RivIntersectionHexGridInterface> hexGrid = createHexGridInterface();
|
||||||
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(m_rimCrossSection, polyLines, direction, hexGrid.p(), m_isFlattened);
|
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(m_rimCrossSection,
|
||||||
|
polyLines,
|
||||||
|
direction,
|
||||||
|
hexGrid.p(),
|
||||||
|
m_isFlattened,
|
||||||
|
horizontalLengthAlongWellToPolylineStart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -392,15 +392,19 @@ void RimIntersection::updateAzimuthLine()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines() const
|
std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines(double * horizontalLengthAlongWellToPolylineStart) const
|
||||||
{
|
{
|
||||||
|
CVF_ASSERT(horizontalLengthAlongWellToPolylineStart != nullptr);
|
||||||
|
|
||||||
std::vector< std::vector <cvf::Vec3d> > lines;
|
std::vector< std::vector <cvf::Vec3d> > lines;
|
||||||
|
double horizontalProjectedLengthAlongWellPathToClipPoint = 0.0;
|
||||||
|
if (horizontalLengthAlongWellToPolylineStart) *horizontalLengthAlongWellToPolylineStart = 0.0;
|
||||||
if (type == CS_WELL_PATH)
|
if (type == CS_WELL_PATH)
|
||||||
{
|
{
|
||||||
if (wellPath() && wellPath->wellPathGeometry() )
|
if (wellPath() && wellPath->wellPathGeometry() )
|
||||||
{
|
{
|
||||||
lines.push_back(wellPath->wellPathGeometry()->m_wellPathPoints);
|
lines.push_back(wellPath->wellPathGeometry()->m_wellPathPoints);
|
||||||
clipToReservoir(lines[0]);
|
clipToReservoir(lines[0], &horizontalProjectedLengthAlongWellPathToClipPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == CS_SIMULATION_WELL)
|
else if (type == CS_SIMULATION_WELL)
|
||||||
@@ -436,6 +440,11 @@ std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines() const
|
|||||||
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
|
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
|
||||||
addExtents(polyLine);
|
addExtents(polyLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (horizontalLengthAlongWellToPolylineStart)
|
||||||
|
{
|
||||||
|
*horizontalLengthAlongWellToPolylineStart = horizontalProjectedLengthAlongWellPathToClipPoint - m_extentLength;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return lines;
|
return lines;
|
||||||
@@ -592,8 +601,11 @@ void RimIntersection::updateName()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimIntersection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const
|
void RimIntersection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine, double * horizontalLengthAlongWellToClipPoint) const
|
||||||
{
|
{
|
||||||
|
CVF_ASSERT(horizontalLengthAlongWellToClipPoint != nullptr);
|
||||||
|
|
||||||
|
*horizontalLengthAlongWellToClipPoint = 0.0;
|
||||||
RimCase* ownerCase = nullptr;
|
RimCase* ownerCase = nullptr;
|
||||||
firstAncestorOrThisOfType(ownerCase);
|
firstAncestorOrThisOfType(ownerCase);
|
||||||
|
|
||||||
@@ -607,6 +619,12 @@ void RimIntersection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const
|
|||||||
{
|
{
|
||||||
if (!caseBB.contains(polyLine[vxIdx]))
|
if (!caseBB.contains(polyLine[vxIdx]))
|
||||||
{
|
{
|
||||||
|
if (vxIdx > 0)
|
||||||
|
{
|
||||||
|
cvf::Vec3d segment = polyLine[vxIdx] - polyLine[vxIdx-1];
|
||||||
|
segment[2] = 0.0;
|
||||||
|
*horizontalLengthAlongWellToClipPoint += segment.length();
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,6 +639,10 @@ void RimIntersection::clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const
|
|||||||
|
|
||||||
if (topPlane.intersect(polyLine[vxIdx-1], polyLine[vxIdx], &intersection))
|
if (topPlane.intersect(polyLine[vxIdx-1], polyLine[vxIdx], &intersection))
|
||||||
{
|
{
|
||||||
|
cvf::Vec3d segment = intersection - polyLine[vxIdx-1];
|
||||||
|
segment[2] = 0.0;
|
||||||
|
*horizontalLengthAlongWellToClipPoint += segment.length();
|
||||||
|
|
||||||
clippedPolyLine.push_back(intersection);
|
clippedPolyLine.push_back(intersection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
caf::PdmField< bool > inputExtrusionPointsFromViewerEnabled;
|
caf::PdmField< bool > inputExtrusionPointsFromViewerEnabled;
|
||||||
caf::PdmField< bool > inputTwoAzimuthPointsFromViewerEnabled;
|
caf::PdmField< bool > inputTwoAzimuthPointsFromViewerEnabled;
|
||||||
|
|
||||||
std::vector< std::vector <cvf::Vec3d> > polyLines() const;
|
std::vector< std::vector <cvf::Vec3d> > polyLines(double * horizontalLengthAlongWellToPolylineStart = nullptr) const;
|
||||||
void appendPointToPolyLine(const cvf::Vec3d& point);
|
void appendPointToPolyLine(const cvf::Vec3d& point);
|
||||||
|
|
||||||
Rim2dIntersectionView* correspondingIntersectionView();
|
Rim2dIntersectionView* correspondingIntersectionView();
|
||||||
@@ -133,7 +133,7 @@ private:
|
|||||||
void updateWellCenterline() const;
|
void updateWellCenterline() const;
|
||||||
void updateWellExtentDefaultValue();
|
void updateWellExtentDefaultValue();
|
||||||
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
void addExtents(std::vector<cvf::Vec3d> &polyLine) const;
|
||||||
void clipToReservoir(std::vector<cvf::Vec3d> &polyLine) const;
|
void clipToReservoir(std::vector<cvf::Vec3d> &polyLinee, double * horizontalLengthAlongWellToClipPoint) const;
|
||||||
void updateName();
|
void updateName();
|
||||||
void rebuildGeometryAndScheduleCreateDisplayModel();
|
void rebuildGeometryAndScheduleCreateDisplayModel();
|
||||||
static double azimuthInRadians(cvf::Vec3d vec);
|
static double azimuthInRadians(cvf::Vec3d vec);
|
||||||
|
|||||||
Reference in New Issue
Block a user