From f2b8f8487cfe9515fc621f49ef01d9a258da7bf8 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 6 Nov 2018 10:09:30 +0100 Subject: [PATCH] #3636 Temporary LGR : Always rebuild geometry of intersections --- .../ProjectDataModel/RimEclipseView.cpp | 1 + .../ProjectDataModel/RimIntersection.cpp | 8 ++++++++ .../ProjectDataModel/RimIntersection.h | 1 + .../ProjectDataModel/RimIntersectionBox.cpp | 8 ++++++++ .../ProjectDataModel/RimIntersectionBox.h | 2 ++ .../RimIntersectionCollection.cpp | 16 ++++++++++++++++ .../ProjectDataModel/RimIntersectionCollection.h | 1 + 7 files changed, 37 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 4b3ca3b496..e9b6820b67 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -496,6 +496,7 @@ void RimEclipseView::createDisplayModel() // Cross sections m_crossSectionVizModel->removeAllParts(); + m_crossSectionCollection->rebuildGeometry(); m_crossSectionCollection->appendPartsToModel(*this, m_crossSectionVizModel.p(), m_reservoirGridPartManager->scaleTransform()); m_viewer->addStaticModelOnce(m_crossSectionVizModel.p()); diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.cpp b/ApplicationCode/ProjectDataModel/RimIntersection.cpp index b569a2d865..053adf58b9 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersection.cpp @@ -500,6 +500,14 @@ RivIntersectionPartMgr* RimIntersection::intersectionPartMgr() return m_crossSectionPartMgr.p(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersection::rebuildGeometry() +{ + m_crossSectionPartMgr = nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersection.h b/ApplicationCode/ProjectDataModel/RimIntersection.h index 37dcfbc35c..d3c3bbfc61 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersection.h @@ -89,6 +89,7 @@ public: Rim2dIntersectionView* correspondingIntersectionView(); RivIntersectionPartMgr* intersectionPartMgr(); + void rebuildGeometry(); std::vector polyLinesForExtrusionDirection() const; void appendPointToExtrusionDirection(const cvf::Vec3d& point); diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp index 402a717a2d..c4e5e061ac 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionBox.cpp @@ -229,6 +229,14 @@ void RimIntersectionBox::appendManipulatorPartsToModel(cvf::ModelBasicList* mode } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersectionBox::rebuildGeometry() +{ + m_intersectionBoxPartMgr = nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionBox.h b/ApplicationCode/ProjectDataModel/RimIntersectionBox.h index ea471dc8a7..e79ae8b017 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionBox.h +++ b/ApplicationCode/ProjectDataModel/RimIntersectionBox.h @@ -70,8 +70,10 @@ public: SinglePlaneState singlePlaneState() const; bool show3dManipulator() const; + RivIntersectionBoxPartMgr* intersectionBoxPartMgr(); void appendManipulatorPartsToModel(cvf::ModelBasicList* model); + void rebuildGeometry(); void setToDefaultSizeBox(); void setToDefaultSizeSlice(SinglePlaneState plane, const cvf::Vec3d& position); diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp index 2cc463cf95..0739e526dc 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.cpp @@ -151,6 +151,22 @@ void RimIntersectionCollection::appendPartsToModel(Rim3dView& view, cvf::ModelBa } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimIntersectionCollection::rebuildGeometry() +{ + for (RimIntersection* intersection : m_intersections) + { + intersection->rebuildGeometry(); + } + + for (RimIntersectionBox* intersectionBox : m_intersectionBoxes) + { + intersectionBox->rebuildGeometry(); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h index b59913f109..3dcda37b09 100644 --- a/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h +++ b/ApplicationCode/ProjectDataModel/RimIntersectionCollection.h @@ -72,6 +72,7 @@ public: const cvf::ScalarMapper* scalarColorMapper, const RivTernaryScalarMapper* ternaryColorMapper); void appendPartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform); + void rebuildGeometry(); std::vector intersections() const; std::vector intersectionBoxes() const;