From db0bbb96c41801557c02ca3caf7cad2517a1bff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Tue, 12 Nov 2019 17:22:46 +0100 Subject: [PATCH] #5019 Use hex grid interface creation from data source for all intersections --- .../RivIntersectionBoxPartMgr.cpp | 29 +------------------ .../Intersections/RivIntersectionBoxPartMgr.h | 2 -- .../Intersections/RivIntersectionPartMgr.cpp | 29 +------------------ .../Intersections/RivIntersectionPartMgr.h | 2 -- 4 files changed, 2 insertions(+), 60 deletions(-) diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp index 43bfba409d..7deda4da6e 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.cpp @@ -64,7 +64,7 @@ RivIntersectionBoxPartMgr::RivIntersectionBoxPartMgr( RimIntersectionBox* inters m_intersectionBoxFacesTextureCoords = new cvf::Vec2fArray; - cvf::ref hexGrid = createHexGridInterface(); + cvf::ref hexGrid = intersectionBox->createHexGridInterface(); m_intersectionBoxGenerator = new RivIntersectionBoxGeometryGenerator( m_rimIntersectionBox, hexGrid.p() ); } @@ -356,30 +356,3 @@ void RivIntersectionBoxPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model->addPart( m_intersectionBoxGridLines.p() ); } } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref RivIntersectionBoxPartMgr::createHexGridInterface() -{ - RimEclipseView* eclipseView; - m_rimIntersectionBox->firstAncestorOrThisOfType( eclipseView ); - if ( eclipseView ) - { - RigMainGrid* grid = eclipseView->mainGrid(); - - return new RivEclipseIntersectionGrid( grid, - eclipseView->currentActiveCellInfo(), - m_rimIntersectionBox->isInactiveCellsVisible() ); - } - - RimGeoMechView* geoView; - m_rimIntersectionBox->firstAncestorOrThisOfType( geoView ); - if ( geoView ) - { - RigFemPart* femPart = geoView->femParts()->part( 0 ); - return new RivFemIntersectionGrid( femPart ); - } - - return nullptr; -} diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.h b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.h index b5e12bd90b..4ce8574bb1 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionBoxPartMgr.h @@ -55,8 +55,6 @@ private: void updatePartEffect(); void generatePartGeometry(); - cvf::ref createHexGridInterface(); - private: RimIntersectionBox* m_rimIntersectionBox; diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp index 6c28d55e43..8271586c30 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.cpp @@ -97,7 +97,7 @@ RivIntersectionPartMgr::RivIntersectionPartMgr( RimIntersection* rimCrossSection if ( polyLines.size() > 0 ) { cvf::Vec3d direction = m_rimCrossSection->extrusionDirection(); - cvf::ref hexGrid = createHexGridInterface(); + cvf::ref hexGrid = m_rimCrossSection->createHexGridInterface(); m_crossSectionGenerator = new RivIntersectionGeometryGenerator( m_rimCrossSection, polyLines, direction, @@ -998,30 +998,3 @@ cvf::Mat4d RivIntersectionPartMgr::unflattenTransformMatrix( const cvf::Vec3d& i { return m_crossSectionGenerator->unflattenTransformMatrix( intersectionPointFlat ); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref RivIntersectionPartMgr::createHexGridInterface() -{ - RimEclipseView* eclipseView; - m_rimCrossSection->firstAncestorOrThisOfType( eclipseView ); - if ( eclipseView ) - { - RigMainGrid* grid = eclipseView->mainGrid(); - return new RivEclipseIntersectionGrid( grid, - eclipseView->currentActiveCellInfo(), - m_rimCrossSection->isInactiveCellsVisible() ); - } - - RimGeoMechView* geoView; - m_rimCrossSection->firstAncestorOrThisOfType( geoView ); - if ( geoView && geoView->femParts() && geoView->femParts()->partCount() ) - { - RigFemPart* femPart = geoView->femParts()->part( 0 ); - - return new RivFemIntersectionGrid( femPart ); - } - - return nullptr; -} diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h index 27e1adaedf..5a8493cd75 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionPartMgr.h @@ -117,8 +117,6 @@ private: void createPolyLineParts( bool useBufferObjects ); void createExtrusionDirParts( bool useBufferObjects ); - cvf::ref createHexGridInterface(); - private: caf::PdmPointer m_rimCrossSection;