Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Sep 11, 2023
1 parent e06cb1c commit f5b60f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
namespace cvf
{
class DrawableGeo;
class Part;
} // namespace cvf

//==================================================================================================
Expand Down
14 changes: 7 additions & 7 deletions ApplicationLibCode/ProjectDataModel/Rim3dView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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." );
Expand Down Expand Up @@ -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 );
}
Expand Down Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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() );
Expand Down
6 changes: 4 additions & 2 deletions ApplicationLibCode/ProjectDataModel/Rim3dView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -38,7 +41,6 @@
#include "cvfCollection.h"
#include "cvfObject.h"

#include "RivAnnotationTools.h"
#include <QPointer>
#include <QTimer>

Expand Down Expand Up @@ -337,7 +339,7 @@ class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface, public
caf::PdmField<bool> m_showZScaleLabel;
caf::PdmPtrField<Rim3dView*> m_comparisonView;

caf::PdmField<bool> m_forceAnnotationStrategy;
caf::PdmField<bool> m_useCustomAnnotationStrategy;
caf::PdmField<caf::AppEnum<RivAnnotationTools::LabelPositionStrategy>> m_annotationStrategy;
caf::PdmField<int> m_annotationCountHint;

Expand Down

0 comments on commit f5b60f3

Please sign in to comment.