diff --git a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp index 7ca030fe5d..25dd27d924 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp @@ -575,7 +575,8 @@ RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionGeometryGenerator::int //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::Mat4d RivExtrudedCurveIntersectionGeometryGenerator::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) +cvf::Mat4d + RivExtrudedCurveIntersectionGeometryGenerator::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const { cvf::Mat4d flattenMx = cvf::Mat4d::IDENTITY; diff --git a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h index 35b3e8e75f..226e6129dc 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h @@ -79,7 +79,7 @@ public: RimExtrudedCurveIntersection* intersection() const; - cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ); + cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; // GeomGen Interface bool isAnyGeometryPresent() const override; diff --git a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp index b7bb270c44..4b2518b6a4 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp @@ -710,7 +710,7 @@ const RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionPartMgr::interse //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::Mat4d RivExtrudedCurveIntersectionPartMgr::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) +cvf::Mat4d RivExtrudedCurveIntersectionPartMgr::unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const { return m_intersectionGenerator->unflattenTransformMatrix( intersectionPointFlat ); } diff --git a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h index 33ca1401ce..ae633e045f 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h @@ -77,7 +77,7 @@ public: const RimExtrudedCurveIntersection* intersection() const; - cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ); + cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; public: private: diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index c672738561..e3b1bf5ea0 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -356,9 +356,9 @@ void Rim2dIntersectionView::updateName() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::ref Rim2dIntersectionView::flatIntersectionPartMgr() const +const RivExtrudedCurveIntersectionPartMgr* Rim2dIntersectionView::flatIntersectionPartMgr() const { - return m_flatIntersectionPartMgr; + return m_flatIntersectionPartMgr.p(); } //-------------------------------------------------------------------------------------------------- @@ -374,9 +374,14 @@ bool Rim2dIntersectionView::isGridVisualizationMode() const //-------------------------------------------------------------------------------------------------- cvf::Vec3d Rim2dIntersectionView::transformToUtm( const cvf::Vec3d& unscaledPointInFlatDomain ) const { - cvf::Mat4d unflatXf = this->flatIntersectionPartMgr()->unflattenTransformMatrix( unscaledPointInFlatDomain ); + if ( m_flatIntersectionPartMgr.notNull() ) + { + cvf::Mat4d unflatXf = flatIntersectionPartMgr()->unflattenTransformMatrix( unscaledPointInFlatDomain ); - return unscaledPointInFlatDomain.getTransformedPoint( unflatXf ); + return unscaledPointInFlatDomain.getTransformedPoint( unflatXf ); + } + + return unscaledPointInFlatDomain; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h index d944f88b3f..7cbe573bc2 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h @@ -65,8 +65,8 @@ public: void update3dInfo(); void updateName(); - cvf::ref flatIntersectionPartMgr() const; - cvf::Vec3d transformToUtm( const cvf::Vec3d& unscaledPointInFlatDomain ) const; + const RivExtrudedCurveIntersectionPartMgr* flatIntersectionPartMgr() const; + cvf::Vec3d transformToUtm( const cvf::Vec3d& unscaledPointInFlatDomain ) const; cvf::ref displayCoordTransform() const override;