mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 01:41:42 -06:00
Merge pull request #8447 from OPM/intersection_filterupdate
Intersection: depth filter updates
This commit is contained in:
parent
376451da2e
commit
d9bb82de91
@ -292,8 +292,8 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
const double gridRadius = gridBBox.radius();
|
||||
|
||||
// set up our horizontal cut planes
|
||||
const double topDepth = -1.0 * m_intersection->topDepth( gridRadius );
|
||||
const double bottomDepth = -1.0 * m_intersection->bottomDepth( gridRadius );
|
||||
const double topDepth = -1.0 * m_intersection->upperFilterDepth( gridRadius );
|
||||
const double bottomDepth = -1.0 * m_intersection->lowerFilterDepth( gridRadius );
|
||||
|
||||
std::array<cvf::Vec3d, 8> corners;
|
||||
gridBBox.cornerVertices( corners.data() );
|
||||
|
@ -244,25 +244,30 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
|
||||
m_surfaceIntersections = new RimSurfaceIntersectionCollection;
|
||||
m_surfaceIntersections->objectChanged.connect( this, &RimExtrudedCurveIntersection::onSurfaceIntersectionsChanged );
|
||||
|
||||
CAF_PDM_InitField( &m_depthThreshold, "DepthThreshold", 2000.0, "Threshold" );
|
||||
m_depthThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitField( &m_depthUpperThreshold, "UpperThreshold", 2000.0, "Upper Threshold" );
|
||||
m_depthUpperThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthDisplayType, "DepthDisplayType", "Intersection Display Type" );
|
||||
CAF_PDM_InitField( &m_depthLowerThreshold, "LowerThreshold", 3000.0, "Lower Threshold" );
|
||||
m_depthLowerThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionDepthThreshold, "CollectionDepthThreshold", "Collection Threshold" );
|
||||
m_collectionDepthThreshold.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthFilterType, "DepthFilter", "Depth Filter" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionUpperThreshold, "CollectionUpperThreshold", "Collection Upper Threshold" );
|
||||
m_collectionUpperThreshold.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionLowerThreshold, "CollectionLowerThreshold", "Collection Lower Threshold" );
|
||||
m_collectionLowerThreshold.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_depthThresholdOverridden,
|
||||
"ThresholdOverridden",
|
||||
false,
|
||||
"Depth Threshold is Controlled by Intersection Collection" );
|
||||
m_depthThresholdOverridden.uiCapability()->setUiReadOnly( true );
|
||||
"Depth Filter is Controlled by Intersection Collection" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_depthThresholdOverridden );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionDepthDisplayType,
|
||||
"CollectionDepthDisplayType",
|
||||
"Collection Controlled Display Type" );
|
||||
m_collectionDepthDisplayType.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionDepthFilterType,
|
||||
"CollectionDepthFilterType",
|
||||
"Collection Controlled Filter Type" );
|
||||
m_collectionDepthFilterType.uiCapability()->setUiHidden( true );
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
@ -301,51 +306,87 @@ void RimExtrudedCurveIntersection::setName( const QString& newName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimExtrudedCurveIntersection::topDepth( double sceneRadius ) const
|
||||
double RimExtrudedCurveIntersection::upperFilterDepth( double sceneRadius ) const
|
||||
{
|
||||
if ( m_depthThresholdOverridden )
|
||||
{
|
||||
if ( m_collectionDepthDisplayType == RimIntersectionDepthCutEnum::INTERSECT_SHOW_BELOW )
|
||||
return m_collectionDepthThreshold;
|
||||
return -sceneRadius;
|
||||
switch ( m_collectionDepthFilterType() )
|
||||
{
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
return m_collectionUpperThreshold;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
return -sceneRadius;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_depthDisplayType == RimIntersectionDepthCutEnum::INTERSECT_SHOW_BELOW )
|
||||
switch ( m_depthFilterType() )
|
||||
{
|
||||
return m_depthThreshold;
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
return m_depthUpperThreshold;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
return -sceneRadius;
|
||||
}
|
||||
return -sceneRadius;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimExtrudedCurveIntersection::bottomDepth( double sceneRadius ) const
|
||||
double RimExtrudedCurveIntersection::lowerFilterDepth( double sceneRadius ) const
|
||||
{
|
||||
if ( m_depthThresholdOverridden )
|
||||
{
|
||||
if ( m_collectionDepthDisplayType == RimIntersectionDepthCutEnum::INTERSECT_SHOW_ABOVE )
|
||||
return m_collectionDepthThreshold;
|
||||
return sceneRadius;
|
||||
switch ( m_collectionDepthFilterType() )
|
||||
{
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
return m_collectionLowerThreshold;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
return sceneRadius;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_depthDisplayType == RimIntersectionDepthCutEnum::INTERSECT_SHOW_ABOVE )
|
||||
switch ( m_depthFilterType() )
|
||||
{
|
||||
return m_depthThreshold;
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
return m_depthLowerThreshold;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
return sceneRadius;
|
||||
}
|
||||
return sceneRadius;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::setDepthOverride( bool collectionOverride,
|
||||
double depthThreshold,
|
||||
RimIntersectionDepthCutEnum displayType )
|
||||
void RimExtrudedCurveIntersection::setDepthOverride( bool collectionOverride )
|
||||
{
|
||||
m_depthThresholdOverridden = collectionOverride;
|
||||
m_collectionDepthThreshold = depthThreshold;
|
||||
m_collectionDepthDisplayType = displayType;
|
||||
m_depthThresholdOverridden = collectionOverride;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::setDepthOverrideParameters( double upperThreshold,
|
||||
double lowerThreshold,
|
||||
RimIntersectionFilterEnum filterType )
|
||||
{
|
||||
m_collectionUpperThreshold = upperThreshold;
|
||||
m_collectionLowerThreshold = lowerThreshold;
|
||||
m_collectionDepthFilterType = filterType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -359,7 +400,9 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
changedField == &m_wellPath || changedField == &m_simulationWell || changedField == &m_branchIndex ||
|
||||
changedField == &m_extentLength || changedField == &m_lengthUp || changedField == &m_lengthDown ||
|
||||
changedField == &m_showInactiveCells || changedField == &m_useSeparateDataSource ||
|
||||
changedField == &m_separateDataSource || changedField == &m_depthThreshold || changedField == &m_depthDisplayType )
|
||||
changedField == &m_separateDataSource || changedField == &m_depthUpperThreshold ||
|
||||
changedField == &m_depthLowerThreshold || changedField == &m_depthThresholdOverridden ||
|
||||
changedField == &m_depthFilterType )
|
||||
{
|
||||
rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
@ -466,6 +509,7 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf::
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* optionsGroup = uiOrdering.addNewGroup( "Options" );
|
||||
optionsGroup->setCollapsedByDefault( true );
|
||||
|
||||
if ( type() == CrossSectionEnum::CS_AZIMUTHLINE )
|
||||
{
|
||||
@ -497,16 +541,38 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf::
|
||||
|
||||
if ( eclipseView() )
|
||||
{
|
||||
auto filterGroup = uiOrdering.addNewGroup( "Depth Filter" );
|
||||
if ( m_depthThresholdOverridden() )
|
||||
{
|
||||
optionsGroup->add( &m_depthThresholdOverridden );
|
||||
filterGroup->add( &m_depthThresholdOverridden );
|
||||
}
|
||||
else
|
||||
{
|
||||
optionsGroup->add( &m_depthDisplayType );
|
||||
optionsGroup->add( &m_depthThreshold );
|
||||
m_depthThreshold.uiCapability()->setUiReadOnly( m_depthDisplayType() ==
|
||||
RimIntersectionDepthCutEnum ::INTERSECT_SHOW_ALL );
|
||||
filterGroup->add( &m_depthFilterType );
|
||||
|
||||
switch ( m_depthFilterType() )
|
||||
{
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
m_depthUpperThreshold.uiCapability()->setUiName( "Depth" );
|
||||
filterGroup->add( &m_depthUpperThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
m_depthUpperThreshold.uiCapability()->setUiName( "Upper Depth" );
|
||||
filterGroup->add( &m_depthUpperThreshold );
|
||||
m_depthLowerThreshold.uiCapability()->setUiName( "Lower Depth" );
|
||||
filterGroup->add( &m_depthLowerThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
m_depthLowerThreshold.uiCapability()->setUiName( "Depth" );
|
||||
filterGroup->add( &m_depthLowerThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -891,11 +957,9 @@ void RimExtrudedCurveIntersection::setPushButtonText( bool buttonEnable, caf::Pd
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::setBaseColor( bool enable, caf::PdmUiListEditorAttribute* attribute )
|
||||
{
|
||||
// if ( attribute && enable )
|
||||
if ( attribute )
|
||||
{
|
||||
attribute->m_qssState = enable ? "ExternalInput" : QString();
|
||||
// attribute->m_baseColor.setRgb( 255, 220, 255 );
|
||||
}
|
||||
}
|
||||
|
||||
@ -921,7 +985,7 @@ void RimExtrudedCurveIntersection::defineEditorAttribute( const caf::PdmFieldHan
|
||||
doubleSliderAttrib->m_maximum = 180;
|
||||
doubleSliderAttrib->m_sliderTickCount = 180;
|
||||
}
|
||||
else if ( field == &m_depthThreshold )
|
||||
else if ( ( field == &m_depthUpperThreshold ) || ( field == &m_depthLowerThreshold ) )
|
||||
{
|
||||
RimEclipseView* eclView = eclipseView();
|
||||
|
||||
|
@ -78,9 +78,11 @@ public:
|
||||
QString name() const override;
|
||||
void setName( const QString& newName );
|
||||
|
||||
double topDepth( double sceneRadius ) const;
|
||||
double bottomDepth( double sceneRadius ) const;
|
||||
void setDepthOverride( bool collectionOverride, double depthThreshold, RimIntersectionDepthCutEnum displayType );
|
||||
double upperFilterDepth( double sceneRadius ) const;
|
||||
double lowerFilterDepth( double sceneRadius ) const;
|
||||
|
||||
void setDepthOverride( bool collectionOverride );
|
||||
void setDepthOverrideParameters( double upperThreshold, double lowerThreshold, RimIntersectionFilterEnum filterType );
|
||||
|
||||
RimExtrudedCurveIntersection::CrossSectionEnum type() const;
|
||||
RimExtrudedCurveIntersection::CrossSectionDirEnum direction() const;
|
||||
@ -163,12 +165,14 @@ private:
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionDepthCutEnum>> m_depthDisplayType;
|
||||
caf::PdmField<double> m_depthThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType;
|
||||
caf::PdmField<double> m_depthUpperThreshold;
|
||||
caf::PdmField<double> m_depthLowerThreshold;
|
||||
|
||||
caf::PdmField<bool> m_depthThresholdOverridden;
|
||||
caf::PdmField<double> m_collectionDepthThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionDepthCutEnum>> m_collectionDepthDisplayType;
|
||||
caf::PdmField<bool> m_depthThresholdOverridden;
|
||||
caf::PdmField<double> m_collectionUpperThreshold;
|
||||
caf::PdmField<double> m_collectionLowerThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_collectionDepthFilterType;
|
||||
|
||||
caf::PdmField<caf::AppEnum<CrossSectionEnum>> m_type;
|
||||
caf::PdmField<caf::AppEnum<CrossSectionDirEnum>> m_direction;
|
||||
|
@ -61,13 +61,16 @@ RimIntersectionCollection::RimIntersectionCollection()
|
||||
CAF_PDM_InitField( &isActive, "Active", true, "Active" );
|
||||
isActive.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionDepthThreshold, "CollectionDepthThreshold", "Threshold" );
|
||||
m_collectionDepthThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthUpperThreshold, "UpperDepthThreshold", "Upper Threshold" );
|
||||
m_depthUpperThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_depthThresholdOverridden, "ThresholdOverridden", false, "Override Intersection Display Settings" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthLowerThreshold, "LowerDepthThreshold", "Lower Threshold" );
|
||||
m_depthLowerThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_depthThresholdOverridden, "DepthFilterOverride", false, "Override Intersection Depth Filters" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_depthThresholdOverridden );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_collectionDepthDisplayType, "CollectionDepthDisplayType", "Intersection Display Type" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthFilterType, "CollectionDepthFilterType", "Depth Filter Type" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -280,19 +283,15 @@ void RimIntersectionCollection::appendIntersectionAndUpdate( RimExtrudedCurveInt
|
||||
{
|
||||
m_intersections.push_back( intersection );
|
||||
|
||||
intersection->setDepthOverride( m_depthThresholdOverridden, m_collectionDepthThreshold, m_collectionDepthDisplayType() );
|
||||
intersection->setDepthOverride( m_depthThresholdOverridden );
|
||||
intersection->setDepthOverrideParameters( m_depthUpperThreshold, m_depthLowerThreshold, m_depthFilterType() );
|
||||
|
||||
syncronize2dIntersectionViews();
|
||||
|
||||
updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( intersection, allowActiveViewChange );
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rebuild3dView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -300,7 +299,8 @@ void RimIntersectionCollection::appendIntersectionAndUpdate( RimExtrudedCurveInt
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::appendIntersectionNoUpdate( RimExtrudedCurveIntersection* intersection )
|
||||
{
|
||||
intersection->setDepthOverride( m_depthThresholdOverridden, m_collectionDepthThreshold, m_collectionDepthDisplayType() );
|
||||
intersection->setDepthOverride( m_depthThresholdOverridden );
|
||||
intersection->setDepthOverrideParameters( m_depthUpperThreshold, m_depthLowerThreshold, m_depthFilterType() );
|
||||
m_intersections.push_back( intersection );
|
||||
}
|
||||
|
||||
@ -338,12 +338,7 @@ void RimIntersectionCollection::appendIntersectionBoxAndUpdate( RimBoxIntersecti
|
||||
updateConnectedEditors();
|
||||
Riu3DMainWindowTools::selectAsCurrentItem( intersectionBox, false );
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rebuild3dView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -361,32 +356,41 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
bool rebuildView = false;
|
||||
|
||||
if ( changedField == &isActive )
|
||||
{
|
||||
updateUiIconFromToggleField();
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
if ( ( changedField == &m_collectionDepthThreshold ) || ( changedField == &m_depthThresholdOverridden ) ||
|
||||
( changedField == &m_collectionDepthDisplayType ) )
|
||||
if ( changedField == &m_depthThresholdOverridden )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
cs->setDepthOverride( m_depthThresholdOverridden, m_collectionDepthThreshold, m_collectionDepthDisplayType() );
|
||||
cs->setDepthOverride( m_depthThresholdOverridden );
|
||||
if ( m_depthThresholdOverridden() )
|
||||
{
|
||||
cs->setDepthOverrideParameters( m_depthUpperThreshold, m_depthLowerThreshold, m_depthFilterType() );
|
||||
}
|
||||
cs->rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) ||
|
||||
( changedField == &m_depthFilterType ) )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
cs->setDepthOverrideParameters( m_depthUpperThreshold, m_depthLowerThreshold, m_depthFilterType() );
|
||||
cs->rebuildGeometryAndScheduleCreateDisplayModel();
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( rebuildView )
|
||||
{
|
||||
rebuild3dView();
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,13 +401,7 @@ void RimIntersectionCollection::onChildDeleted( caf::PdmChildArrayFieldHandle*
|
||||
std::vector<caf::PdmObjectHandle*>& referringObjects )
|
||||
{
|
||||
syncronize2dIntersectionViews();
|
||||
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
rebuild3dView();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -443,13 +441,38 @@ void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
{
|
||||
if ( eclipseView() )
|
||||
{
|
||||
caf::PdmUiGroup* optionsGroup = uiOrdering.addNewGroup( "Curve Intersections" );
|
||||
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" );
|
||||
|
||||
optionsGroup->add( &m_depthThresholdOverridden );
|
||||
optionsGroup->add( &m_collectionDepthDisplayType );
|
||||
optionsGroup->add( &m_collectionDepthThreshold );
|
||||
m_collectionDepthDisplayType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_collectionDepthThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_depthLowerThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
|
||||
filterGroup->add( &m_depthThresholdOverridden );
|
||||
filterGroup->add( &m_depthFilterType );
|
||||
|
||||
switch ( m_depthFilterType() )
|
||||
{
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW:
|
||||
m_depthUpperThreshold.uiCapability()->setUiName( "Depth" );
|
||||
filterGroup->add( &m_depthUpperThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN:
|
||||
m_depthUpperThreshold.uiCapability()->setUiName( "Upper Depth" );
|
||||
filterGroup->add( &m_depthUpperThreshold );
|
||||
m_depthLowerThreshold.uiCapability()->setUiName( "Lower Depth" );
|
||||
filterGroup->add( &m_depthLowerThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE:
|
||||
m_depthLowerThreshold.uiCapability()->setUiName( "Depth" );
|
||||
filterGroup->add( &m_depthLowerThreshold );
|
||||
break;
|
||||
|
||||
case RimIntersectionFilterEnum::INTERSECT_FILTER_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
@ -465,7 +488,7 @@ void RimIntersectionCollection::defineEditorAttribute( const caf::PdmFieldHandle
|
||||
auto* doubleSliderAttrib = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
|
||||
if ( doubleSliderAttrib )
|
||||
{
|
||||
if ( field == &m_collectionDepthThreshold )
|
||||
if ( ( field == &m_depthUpperThreshold ) || ( field == &m_depthLowerThreshold ) )
|
||||
{
|
||||
RimEclipseView* eclView = eclipseView();
|
||||
|
||||
@ -489,3 +512,16 @@ RimEclipseView* RimIntersectionCollection::eclipseView() const
|
||||
firstAncestorOrThisOfType( eclipseView );
|
||||
return eclipseView;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimIntersectionCollection::rebuild3dView() const
|
||||
{
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfType( rimView );
|
||||
if ( rimView )
|
||||
{
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
@ -95,11 +95,13 @@ protected:
|
||||
|
||||
private:
|
||||
RimEclipseView* eclipseView() const;
|
||||
void rebuild3dView() const;
|
||||
|
||||
caf::PdmChildArrayField<RimExtrudedCurveIntersection*> m_intersections;
|
||||
caf::PdmChildArrayField<RimBoxIntersection*> m_intersectionBoxes;
|
||||
|
||||
caf::PdmField<bool> m_depthThresholdOverridden;
|
||||
caf::PdmField<double> m_collectionDepthThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionDepthCutEnum>> m_collectionDepthDisplayType;
|
||||
caf::PdmField<bool> m_depthThresholdOverridden;
|
||||
caf::PdmField<double> m_depthUpperThreshold;
|
||||
caf::PdmField<double> m_depthLowerThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType;
|
||||
};
|
||||
|
@ -23,12 +23,13 @@
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RimIntersectionDepthCutEnum>::setUp()
|
||||
void caf::AppEnum<RimIntersectionFilterEnum>::setUp()
|
||||
{
|
||||
addItem( RimIntersectionDepthCutEnum::INTERSECT_SHOW_ALL, "INTERSECT_SHOW_ALL", "Show All" );
|
||||
addItem( RimIntersectionDepthCutEnum::INTERSECT_SHOW_ABOVE, "INTERSECT_SHOW_ABOVE", "Show Above Threshold" );
|
||||
addItem( RimIntersectionDepthCutEnum::INTERSECT_SHOW_BELOW, "INTERSECT_SHOW_BELOW", "Show Below Threshold" );
|
||||
setDefault( RimIntersectionDepthCutEnum::INTERSECT_SHOW_ALL );
|
||||
addItem( RimIntersectionFilterEnum::INTERSECT_FILTER_NONE, "INTERSECT_SHOW_ALL", "None" );
|
||||
addItem( RimIntersectionFilterEnum::INTERSECT_FILTER_ABOVE, "INTERSECT_SHOW_ABOVE", "Above" );
|
||||
addItem( RimIntersectionFilterEnum::INTERSECT_FILTER_BELOW, "INTERSECT_SHOW_BELOW", "Below" );
|
||||
addItem( RimIntersectionFilterEnum::INTERSECT_FILTER_BETWEEN, "INTERSECT_SHOW_BELOW", "Between" );
|
||||
setDefault( RimIntersectionFilterEnum::INTERSECT_FILTER_NONE );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
@ -18,9 +18,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
enum class RimIntersectionDepthCutEnum
|
||||
enum class RimIntersectionFilterEnum
|
||||
{
|
||||
INTERSECT_SHOW_ALL,
|
||||
INTERSECT_SHOW_BELOW,
|
||||
INTERSECT_SHOW_ABOVE
|
||||
INTERSECT_FILTER_NONE,
|
||||
INTERSECT_FILTER_ABOVE,
|
||||
INTERSECT_FILTER_BELOW,
|
||||
INTERSECT_FILTER_BETWEEN
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user