Use template function

This commit is contained in:
Magne Sjaastad 2024-04-01 16:56:49 +02:00
parent 67eab23d18
commit 55831a9e24
2 changed files with 11 additions and 7 deletions

View File

@ -23,6 +23,8 @@
#include "RimSimWellInView.h"
#include "RimSimWellInViewCollection.h"
#include "cafPdmSetFieldValue.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicEclipseWellShowLabelFeature, "RicEclipseWellShowLabelFeature" );
@ -35,7 +37,7 @@ void RicEclipseWellShowLabelFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellLabel.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellLabel, isChecked );
}
}
@ -83,7 +85,7 @@ void RicEclipseWellShowHeadFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellHead.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellHead, isChecked );
}
}
@ -131,7 +133,7 @@ void RicEclipseWellShowPipeFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellPipe.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellPipe, isChecked );
}
}
@ -179,7 +181,7 @@ void RicEclipseWellShowSpheresFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellSpheres.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellSpheres, isChecked );
}
}
@ -227,7 +229,7 @@ void RicEclipseWellShowWellCellsFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellCells.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellCells, isChecked );
}
}
@ -275,7 +277,7 @@ void RicEclipseWellShowWellCellFenceFeature::onActionTriggered( bool isChecked )
std::vector<RimSimWellInView*> selection = RicEclipseWellFeatureImpl::selectedWells();
for ( RimSimWellInView* w : selection )
{
w->showWellCellFence.setValueWithFieldChanged( isChecked );
caf::setValueWithFieldChanged( &w->showWellCellFence, isChecked );
}
}

View File

@ -28,6 +28,8 @@
#include "RigFault.h"
#include "RigMainGrid.h"
#include "cafPdmSetFieldValue.h"
#include <QAction>
CAF_CMD_SOURCE_INIT( RicEclipseHideFaultFeature, "RicEclipseHideFaultFeature" );
@ -73,7 +75,7 @@ void RicEclipseHideFaultFeature::onActionTriggered( bool isChecked )
RimFaultInView* rimFault = eclView->faultCollection()->findFaultByName( faultName );
if ( rimFault )
{
rimFault->showFault.setValueWithFieldChanged( !rimFault->showFault );
caf::setValueWithFieldChanged( &rimFault->showFault, !rimFault->showFault );
}
}
}