From f5b60f33314c37a0f26ce3687761f57014a4723f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 11 Sep 2023 19:31:23 +0200 Subject: [PATCH] Refactoring --- .../ModelVisualization/RivPolylineGenerator.cpp | 4 ---- .../ModelVisualization/RivPolylineGenerator.h | 1 - ApplicationLibCode/ProjectDataModel/Rim3dView.cpp | 14 +++++++------- ApplicationLibCode/ProjectDataModel/Rim3dView.h | 6 ++++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.cpp index 89691e07752..de681cf68a5 100644 --- a/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.cpp @@ -18,11 +18,7 @@ #include "RivPolylineGenerator.h" -#include "RivPartPriority.h" - -#include "cafEffectGenerator.h" #include "cvfDrawableGeo.h" -#include "cvfPart.h" #include "cvfPrimitiveSetDirect.h" #include "cvfPrimitiveSetIndexedUInt.h" diff --git a/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.h b/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.h index 38659771dcd..c21da166771 100644 --- a/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.h +++ b/ApplicationLibCode/ModelVisualization/RivPolylineGenerator.h @@ -26,7 +26,6 @@ namespace cvf { class DrawableGeo; -class Part; } // namespace cvf //================================================================================================== diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp index 85b2eb35df8..5d1b7c12688 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp @@ -156,8 +156,8 @@ Rim3dView::Rim3dView() CAF_PDM_InitFieldNoDefault( &m_annotationStrategy, "AnnotationStrategy", "Annotation Strategy" ); CAF_PDM_InitField( &m_annotationCountHint, "AnnotationCountHint", 5, "Annotation Count Hint" ); - CAF_PDM_InitField( &m_forceAnnotationStrategy, - "ForceAnnotationStrategy", + CAF_PDM_InitField( &m_useCustomAnnotationStrategy, + "UseCustomAnnotationStrategy", false, "Use Custom Annotation Strategy", "Specify the strategy to be applied on all screen space annotations." ); @@ -519,12 +519,12 @@ void Rim3dView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOr gridGroup->add( &surfaceMode ); caf::PdmUiGroup* annotationGroup = uiOrdering.addNewGroup( "Annotations" ); - annotationGroup->add( &m_forceAnnotationStrategy ); + annotationGroup->add( &m_useCustomAnnotationStrategy ); annotationGroup->add( &m_annotationStrategy ); annotationGroup->add( &m_annotationCountHint ); - m_annotationStrategy.uiCapability()->setUiReadOnly( !m_forceAnnotationStrategy ); + m_annotationStrategy.uiCapability()->setUiReadOnly( !m_useCustomAnnotationStrategy ); m_annotationCountHint.uiCapability()->setUiReadOnly( - !m_forceAnnotationStrategy || ( m_annotationStrategy() != RivAnnotationTools::LabelPositionStrategy::COUNT_HINT ) ); + !m_useCustomAnnotationStrategy || ( m_annotationStrategy() != RivAnnotationTools::LabelPositionStrategy::COUNT_HINT ) ); uiOrdering.skipRemainingFields( true ); } @@ -1051,7 +1051,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const { createDisplayModelAndRedraw(); } - else if ( changedField == &m_annotationCountHint || changedField == &m_annotationStrategy || changedField == &m_forceAnnotationStrategy ) + else if ( changedField == &m_annotationCountHint || changedField == &m_annotationStrategy || changedField == &m_useCustomAnnotationStrategy ) { if ( m_viewer ) { @@ -1693,7 +1693,7 @@ void Rim3dView::updateScreenSpaceModel() m_viewer->currentScene()->allParts( &partCollection ); RivAnnotationTools annoTool; - if ( m_forceAnnotationStrategy ) + if ( m_useCustomAnnotationStrategy ) { annoTool.setLabelPositionStrategy( m_annotationStrategy() ); annoTool.setCountHint( m_annotationCountHint() ); diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.h b/ApplicationLibCode/ProjectDataModel/Rim3dView.h index ea0fc33f271..d27dbb01c8b 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.h +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.h @@ -19,10 +19,13 @@ #pragma once #include "RiaDefines.h" + #include "RimNameConfig.h" #include "RimViewWindow.h" + #include "RiuViewerToViewInterface.h" +#include "RivAnnotationTools.h" #include "RivCellSetEnum.h" #include "cafAppEnum.h" @@ -38,7 +41,6 @@ #include "cvfCollection.h" #include "cvfObject.h" -#include "RivAnnotationTools.h" #include #include @@ -337,7 +339,7 @@ class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface, public caf::PdmField m_showZScaleLabel; caf::PdmPtrField m_comparisonView; - caf::PdmField m_forceAnnotationStrategy; + caf::PdmField m_useCustomAnnotationStrategy; caf::PdmField> m_annotationStrategy; caf::PdmField m_annotationCountHint;