mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2449 2d intersection view. Show UTM intersection point in result info window
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "RimIntersection.h"
|
||||
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
#include "RivIntersectionPartMgr.h"
|
||||
|
||||
#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"
|
||||
|
||||
@@ -603,6 +604,41 @@ RimIntersection* RivIntersectionGeometryGenerator::crossSection() const
|
||||
return m_crossSection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Mat4d RivIntersectionGeometryGenerator::unflattenTransformMatrix(const cvf::Vec3d& intersectionPointUtm)
|
||||
{
|
||||
cvf::Vec3d startPt = cvf::Vec3d::ZERO;
|
||||
|
||||
int polyLineIdx = -1;
|
||||
int segIdx = -1;
|
||||
for (int i = 0; i < m_flattenedOrOffsettedPolyLines.size(); i++)
|
||||
{
|
||||
std::vector<cvf::Vec3d> pts = m_flattenedOrOffsettedPolyLines[i];
|
||||
for(int j = 0; j < pts.size(); j++)
|
||||
{
|
||||
// Assumes ascending sorted list
|
||||
if (j > 0 && intersectionPointUtm.x() < pts[j].x())
|
||||
{
|
||||
polyLineIdx = i;
|
||||
segIdx = j - 1;
|
||||
startPt = pts[segIdx];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!startPt.isZero()) break;
|
||||
}
|
||||
|
||||
if (polyLineIdx > -1 && segIdx > -1)
|
||||
{
|
||||
cvf::Mat4d t = m_segementTransformPrLinePoint[polyLineIdx][segIdx];
|
||||
return t.getInverted(); // Check for invertible?
|
||||
}
|
||||
return cvf::Mat4d::ZERO;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -75,6 +75,8 @@ public:
|
||||
|
||||
RimIntersection* crossSection() const;
|
||||
|
||||
cvf::Mat4d unflattenTransformMatrix(const cvf::Vec3d& intersectionPointUtm);
|
||||
|
||||
private:
|
||||
void calculateArrays();
|
||||
void calculateSegementTransformPrLinePoint();
|
||||
|
||||
@@ -967,6 +967,14 @@ const RimIntersection* RivIntersectionPartMgr::intersection() const
|
||||
return m_rimCrossSection.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Mat4d RivIntersectionPartMgr::unflattenTransformMatrix(const cvf::Vec3d& intersectionPointUtm)
|
||||
{
|
||||
return m_crossSectionGenerator->unflattenTransformMatrix(intersectionPointUtm);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "cvfColor4.h"
|
||||
#include "cvfVector3.h"
|
||||
#include "cvfArray.h"
|
||||
#include "cvfMatrix4.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include <list>
|
||||
@@ -74,6 +76,7 @@ public:
|
||||
|
||||
const RimIntersection* intersection() const;
|
||||
|
||||
cvf::Mat4d unflattenTransformMatrix(const cvf::Vec3d& intersectionPointUtm);
|
||||
|
||||
public:
|
||||
static void calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
|
||||
Reference in New Issue
Block a user