mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11482 Add fault mesh line thickness option
This commit is contained in:
parent
f7dccd8149
commit
ea17b1ec07
@ -516,6 +516,8 @@ void RivFaultPartMgr::updatePartEffect()
|
||||
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator faultEffGen( prefs->defaultFaultGridLineColors() );
|
||||
faultEffGen.setLineWidth( m_rimFaultCollection->meshLineThickness() );
|
||||
|
||||
eff = faultEffGen.generateCachedEffect();
|
||||
|
||||
if ( m_nativeFaultGridLines.notNull() )
|
||||
|
@ -20,15 +20,12 @@
|
||||
#include "RimFaultInViewCollection.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseFaultColors.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimFaultInView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
@ -38,8 +35,8 @@
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
#include "cafPdmFieldCvfMat4d.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
namespace caf
|
||||
@ -73,6 +70,7 @@ RimFaultInViewCollection::RimFaultInViewCollection()
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showOppositeFaultFaces );
|
||||
|
||||
CAF_PDM_InitField( &m_applyCellFilters, "ApplyCellFilters", true, "Use Cell Filters for Faults" );
|
||||
CAF_PDM_InitField( &m_meshLineThickness, "MeshLineThickness", 2, "Mesh Line Thickness [1..10]" );
|
||||
|
||||
CAF_PDM_InitField( &m_onlyShowWithNeighbor, "OnlyShowWithDefNeighbor", false, "Show Only Faces with Juxtaposition" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyShowWithNeighbor );
|
||||
@ -184,6 +182,14 @@ bool RimFaultInViewCollection::hideNNCsWhenNoResultIsAvailable() const
|
||||
return m_hideNNCsWhenNoResultIsAvailable();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimFaultInViewCollection::meshLineThickness() const
|
||||
{
|
||||
return m_meshLineThickness();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -205,7 +211,7 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
if ( &m_showFaultFaces == changedField || &m_showOppositeFaultFaces == changedField || &m_showFaultCollection == changedField ||
|
||||
&m_showFaultLabel == changedField || &m_applyCellFilters == changedField || &m_faultLabelColor == changedField ||
|
||||
&m_onlyShowWithNeighbor == changedField || &m_faultResult == changedField || &m_showNNCs == changedField ||
|
||||
&m_hideNNCsWhenNoResultIsAvailable == changedField )
|
||||
&m_hideNNCsWhenNoResultIsAvailable == changedField || changedField == &m_meshLineThickness )
|
||||
{
|
||||
parentView()->scheduleCreateDisplayModelAndRedraw();
|
||||
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
@ -225,6 +231,20 @@ caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
|
||||
return &m_showFaultCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultInViewCollection::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if ( field == &m_meshLineThickness )
|
||||
{
|
||||
if ( auto* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute ) )
|
||||
{
|
||||
lineEditorAttr->validator = new QIntValidator( 1, 10, nullptr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -371,6 +391,7 @@ void RimFaultInViewCollection::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
{
|
||||
caf::PdmUiGroup* general = uiOrdering.addNewGroup( "General" );
|
||||
general->add( &m_applyCellFilters );
|
||||
general->add( &m_meshLineThickness );
|
||||
|
||||
caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" );
|
||||
labs->add( &m_showFaultLabel );
|
||||
|
@ -21,10 +21,8 @@
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@ -67,6 +65,7 @@ public:
|
||||
bool showOppositeFaultFaces() const;
|
||||
bool showNNCs() const;
|
||||
bool hideNNCsWhenNoResultIsAvailable() const;
|
||||
int meshLineThickness() const;
|
||||
|
||||
void setFaultResult( caf::AppEnum<FaultFaceCullingMode> resultType );
|
||||
void setShouldApplyCellFiltersToFaults( bool bEnabled );
|
||||
@ -86,6 +85,7 @@ public:
|
||||
private:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
@ -103,6 +103,7 @@ private:
|
||||
caf::PdmField<bool> m_showFaultCollection;
|
||||
caf::PdmField<bool> m_showNNCs;
|
||||
caf::PdmField<bool> m_hideNNCsWhenNoResultIsAvailable;
|
||||
caf::PdmField<int> m_meshLineThickness;
|
||||
|
||||
caf::PdmField<caf::AppEnum<FaultFaceCullingMode>> m_faultResult;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user