Refactor: Decouple RivContourMapProjectionPartMgr and RimContourMapProjection

This commit is contained in:
Kristian Bendiksen
2024-11-18 11:40:39 +01:00
parent eb6467c599
commit 8da0690096
10 changed files with 307 additions and 171 deletions

View File

@@ -67,7 +67,7 @@ RimGeoMechContourMapView::RimGeoMechContourMapView()
setDefaultCustomName();
m_contourMapProjectionPartMgr = new RivContourMapProjectionPartMgr( contourMapProjection(), this );
m_contourMapProjectionPartMgr = new RivContourMapProjectionPartMgr( contourMapProjection() );
( (RiuViewerToViewInterface*)this )->setCameraPosition( sm_defaultViewMatrix );
@@ -283,7 +283,7 @@ void RimGeoMechContourMapView::createContourMapGeometry()
{
if ( nativeOrOverrideViewer() && m_contourMapProjection->isChecked() )
{
m_contourMapProjectionPartMgr->createProjectionGeometry();
m_contourMapProjection->generateGeometryIfNecessary();
}
}
@@ -305,7 +305,13 @@ void RimGeoMechContourMapView::appendContourMapProjectionToModel()
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_contourMapProjectionPartMgr->appendProjectionToModel( contourMapProjectionModelBasicList.p(), transForm.p() );
m_contourMapProjectionPartMgr->appendProjectionToModel( contourMapProjectionModelBasicList.p(),
transForm.p(),
m_contourMapProjection->trianglesWithVertexValues(),
*m_contourMapProjection->mapGrid(),
backgroundColor(),
m_contourMapProjection->legendConfig()->scalarMapper() );
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel( contourMapProjectionModelBasicList.p() );
}
@@ -330,7 +336,17 @@ void RimGeoMechContourMapView::appendContourLinesToModel()
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_contourMapProjectionPartMgr->appendContourLinesToModel( viewer()->mainCamera(), contourMapLabelModelBasicList.p(), transForm.p() );
m_contourMapProjectionPartMgr->appendContourLinesToModel( viewer()->mainCamera(),
contourMapLabelModelBasicList.p(),
transForm.p(),
m_contourMapProjection->contourPolygons(),
*m_contourMapProjection->mapGrid(),
m_contourMapProjection->legendConfig()->scalarMapper(),
m_contourMapProjection->showContourLines(),
m_contourMapProjection->showContourLabels(),
m_contourMapProjection->legendConfig()->tickNumberFormat(),
m_contourMapProjection->legendConfig()->significantDigitsInData() );
contourMapLabelModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel( contourMapLabelModelBasicList.p() );
}
@@ -355,7 +371,11 @@ void RimGeoMechContourMapView::appendPickPointVisToModel()
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_contourMapProjectionPartMgr->appendPickPointVisToModel( contourMapProjectionModelBasicList.p(), transForm.p() );
m_contourMapProjectionPartMgr->appendPickPointVisToModel( contourMapProjectionModelBasicList.p(),
transForm.p(),
m_contourMapProjection->pickPoint(),
*m_contourMapProjection->mapGrid() );
contourMapProjectionModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel( contourMapProjectionModelBasicList.p() );
}