diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp index bfe95eaab7..b7b8417922 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp @@ -144,14 +144,16 @@ void RivIntersectionGeometryGenerator::calculateSegementTransformPrLinePoint() cvf::Vec3d p2 = polyLine[idxToNextP]; cvf::Mat4d sectionLocalCS = calculateSectionLocalFlatteningCS(p1, p2, m_extrusionDirection); + if ( pLineIdx == 0 && lIdx == 0 ) previousSectionOrigo = sectionLocalCS.translation(); + previousSectionFlattenedEndPosX += (sectionLocalCS.translation() - previousSectionOrigo).length(); previousSectionOrigo = sectionLocalCS.translation(); invSectionCS = sectionLocalCS.getInverted(); cvf::Vec3d flattenedTranslation(previousSectionFlattenedEndPosX, 0.0, 0.0); - invSectionCS.setTranslation(invSectionCS.translation() + flattenedTranslation - displayOffset); + invSectionCS.setTranslation(invSectionCS.translation() + flattenedTranslation ); } size_t inc = 0; @@ -210,6 +212,8 @@ void RivIntersectionGeometryGenerator::calculateArrays() if (polyLine.size() < 2) continue; size_t lineCount = polyLine.size(); + //size_t lIdx = 0; + //while ( lIdx < lineCount - 1) for (size_t lIdx = 0; lIdx < lineCount - 1; ++lIdx) { size_t idxToNextP = indexToNextValidPoint(polyLine, m_extrusionDirection, lIdx); @@ -402,6 +406,7 @@ void RivIntersectionGeometryGenerator::calculateArrays() } } } +// lIdx = idxToNextP; } } m_triangleVxes->assign(triangleVertices); diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index fc89cd18b1..810c0a08be 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -41,6 +41,7 @@ #include "RimWellPath.h" #include +#include "cafDisplayCoordTransform.h" CAF_PDM_SOURCE_INIT(Rim2dIntersectionView, "Intersection2dView"); @@ -287,6 +288,14 @@ void Rim2dIntersectionView::update3dInfo() m_viewer->update(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref Rim2dIntersectionView::displayCoordTransform() const +{ + return new caf::DisplayCoordTransform(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h index 4ed2befb49..8db542c59c 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h @@ -60,6 +60,9 @@ public: cvf::ref flatIntersectionPartMgr() const { return m_flatIntersectionPartMgr; } + + virtual cvf::ref displayCoordTransform() const override; + protected: void updateLegends(); diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index 3ca92e3fe4..0764e6ee48 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -392,11 +392,12 @@ void RimIntersection::updateAzimuthLine() //-------------------------------------------------------------------------------------------------- std::vector< std::vector > RimIntersection::polyLines(double * horizontalLengthAlongWellToPolylineStart) const { - CVF_ASSERT(horizontalLengthAlongWellToPolylineStart != nullptr); + if (horizontalLengthAlongWellToPolylineStart) *horizontalLengthAlongWellToPolylineStart = 0.0; std::vector< std::vector > lines; + double horizontalProjectedLengthAlongWellPathToClipPoint = 0.0; - if (horizontalLengthAlongWellToPolylineStart) *horizontalLengthAlongWellToPolylineStart = 0.0; + if (type == CS_WELL_PATH) { if (wellPath() && wellPath->wellPathGeometry() ) diff --git a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp index bc7af30898..cffb7bc60a 100644 --- a/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationCode/UserInterface/RiuResultTextBuilder.cpp @@ -191,7 +191,7 @@ QString RiuResultTextBuilder::geometrySelectionText(QString itemSeparator) QString formattedText; if (m_2dIntersectionView) { - formattedText.sprintf("Horizontal length from well start: %.2f", domainCoord.x()); + formattedText.sprintf("Horizontal length from well start: %.2f", m_intersectionPoint.x()); text += formattedText + itemSeparator; cvf::Mat4d t = m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(m_intersectionPoint);