Add support for K filter to polyline intersections (#10302)

* Add support for K filter to polyline intersections
This commit is contained in:
jonjenssen
2023-05-25 08:14:43 +02:00
committed by GitHub
parent fe5c24ef5d
commit 1063d7f3d3
15 changed files with 181 additions and 60 deletions
@@ -61,11 +61,18 @@ void RivEclipseIntersectionGrid::findIntersectingCells( const cvf::BoundingBox&
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RivEclipseIntersectionGrid::useCell( size_t cellIndex ) const bool RivEclipseIntersectionGrid::useCell( size_t cellIndex ) const
{ {
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex]; size_t i, j, k;
if ( m_showInactiveCells ) m_mainGrid->ijkFromCellIndexUnguarded( cellIndex, &i, &j, &k );
return !( cell.isInvalid() || ( cell.subGrid() != nullptr ) );
else if ( m_intervalTool.isNumberIncluded( k ) )
return m_activeCellInfo->isActive( cellIndex ) && ( cell.subGrid() == nullptr ); {
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex];
if ( m_showInactiveCells )
return !( cell.isInvalid() || ( cell.subGrid() != nullptr ) );
else
return m_activeCellInfo->isActive( cellIndex ) && ( cell.subGrid() == nullptr );
}
return false;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -97,3 +104,11 @@ const RigFault* RivEclipseIntersectionGrid::findFaultFromCellIndexAndCellFace( s
{ {
return m_mainGrid->findFaultFromCellIndexAndCellFace( reservoirCellIndex, face ); return m_mainGrid->findFaultFromCellIndexAndCellFace( reservoirCellIndex, face );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivEclipseIntersectionGrid::setKIntervalFilter( bool enabled, std::string kIntervalStr )
{
m_intervalTool.setInterval( enabled, kIntervalStr );
}
@@ -20,6 +20,8 @@
#include "RivIntersectionHexGridInterface.h" #include "RivIntersectionHexGridInterface.h"
#include "RimCellFilterIntervalTool.h"
#include "cvfBoundingBox.h" #include "cvfBoundingBox.h"
#include "cvfObject.h" #include "cvfObject.h"
#include "cvfVector3.h" #include "cvfVector3.h"
@@ -45,9 +47,11 @@ public:
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override; void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override; void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override; const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
void setKIntervalFilter( bool enabled, std::string kIntervalStr ) override;
private: private:
cvf::cref<RigMainGrid> m_mainGrid; cvf::cref<RigMainGrid> m_mainGrid;
cvf::cref<RigActiveCellInfo> m_activeCellInfo; cvf::cref<RigActiveCellInfo> m_activeCellInfo;
bool m_showInactiveCells; bool m_showInactiveCells;
RimCellFilterIntervalTool m_intervalTool;
}; };
@@ -64,8 +64,8 @@ cvf::ref<caf::DisplayCoordTransform> displayCoordTransform( const RimExtrudedCur
RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* crossSection, RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* crossSection,
std::vector<std::vector<cvf::Vec3d>>& polylines, std::vector<std::vector<cvf::Vec3d>>& polylines,
const cvf::Vec3d& extrusionDirection, const cvf::Vec3d& extrusionDirection,
const RivIntersectionHexGridInterface* grid, RivIntersectionHexGridInterface* grid,
bool isFlattened, bool isFlattened,
const cvf::Vec3d& flattenedPolylineStartPoint ) const cvf::Vec3d& flattenedPolylineStartPoint )
: m_intersection( crossSection ) : m_intersection( crossSection )
, m_polylines( polylines ) , m_polylines( polylines )
@@ -278,6 +278,8 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
cvf::BoundingBox gridBBox = m_hexGrid->boundingBox(); cvf::BoundingBox gridBBox = m_hexGrid->boundingBox();
m_hexGrid->setKIntervalFilter( m_intersection->kLayerFilterEnabled(), m_intersection->kFilterText().toStdString() );
calculateLineSegementTransforms(); calculateLineSegementTransforms();
calculateTransformedPolyline(); calculateTransformedPolyline();
@@ -50,12 +50,12 @@ class DrawableGeo;
class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface
{ {
public: public:
RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection, RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection,
std::vector<std::vector<cvf::Vec3d>>& polylines, std::vector<std::vector<cvf::Vec3d>>& polylines,
const cvf::Vec3d& extrusionDirection, const cvf::Vec3d& extrusionDirection,
const RivIntersectionHexGridInterface* grid, RivIntersectionHexGridInterface* grid,
bool isFlattened, bool isFlattened,
const cvf::Vec3d& flattenedPolylineStartPoint ); const cvf::Vec3d& flattenedPolylineStartPoint );
~RivExtrudedCurveIntersectionGeometryGenerator() override; ~RivExtrudedCurveIntersectionGeometryGenerator() override;
@@ -102,7 +102,7 @@ private:
private: private:
RimExtrudedCurveIntersection* m_intersection; RimExtrudedCurveIntersection* m_intersection;
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid; cvf::ref<RivIntersectionHexGridInterface> m_hexGrid;
const std::vector<std::vector<cvf::Vec3d>> m_polylines; const std::vector<std::vector<cvf::Vec3d>> m_polylines;
cvf::Vec3d m_extrusionDirection; cvf::Vec3d m_extrusionDirection;
bool m_isFlattened; bool m_isFlattened;
@@ -129,3 +129,11 @@ const RigFault* RivFemIntersectionGrid::findFaultFromCellIndexAndCellFace( size_
{ {
return nullptr; return nullptr;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivFemIntersectionGrid::setKIntervalFilter( bool enabled, std::string kIntervalStr )
{
// not supported for geomech grids
}
@@ -45,6 +45,7 @@ public:
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override; void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override; void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override; const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
void setKIntervalFilter( bool enabled, std::string kIntervalStr ) override;
private: private:
cvf::cref<RigFemPartCollection> m_femParts; cvf::cref<RigFemPartCollection> m_femParts;
@@ -24,6 +24,7 @@
#include "cvfStructGrid.h" #include "cvfStructGrid.h"
#include <string>
#include <vector> #include <vector>
class RigFault; class RigFault;
@@ -41,4 +42,5 @@ public:
virtual void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const = 0; virtual void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const = 0;
virtual void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const = 0; virtual void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const = 0;
virtual const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const = 0; virtual const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const = 0;
virtual void setKIntervalFilter( bool enabled, std::string kIntervalStr ) = 0;
}; };
@@ -90,9 +90,10 @@ bool RimCellFilterIntervalTool::isNumberIncluded( size_t number ) const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
size_t RimCellFilterIntervalTool::numberFromPart( QString strVal ) const size_t RimCellFilterIntervalTool::numberFromPart( std::string strVal ) const
{ {
return strVal.toUInt(); QString qStrVal = QString::fromStdString( strVal );
return qStrVal.toUInt();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -100,13 +101,15 @@ size_t RimCellFilterIntervalTool::numberFromPart( QString strVal ) const
// Define a range with the comma separated format A,B,C-D, etc., i.e. 1,4,5-8 // Define a range with the comma separated format A,B,C-D, etc., i.e. 1,4,5-8
// Only positive numbers are supported. // Only positive numbers are supported.
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimCellFilterIntervalTool::setInterval( bool enabled, QString intervalText ) void RimCellFilterIntervalTool::setInterval( bool enabled, std::string intervalText )
{ {
m_intervals.clear(); m_intervals.clear();
if ( !enabled ) return; if ( !enabled ) return;
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( intervalText, "," ); QString qIntervalText = QString::fromStdString( intervalText );
QStringList parts = RiaTextStringTools::splitSkipEmptyParts( qIntervalText, "," );
for ( auto& part : parts ) for ( auto& part : parts )
{ {
@@ -114,10 +117,11 @@ void RimCellFilterIntervalTool::setInterval( bool enabled, QString intervalText
switch ( minmax.size() ) switch ( minmax.size() )
{ {
case 1: case 1:
m_intervals.push_back( RimCellFilterInterval( numberFromPart( minmax[0] ) ) ); m_intervals.push_back( RimCellFilterInterval( numberFromPart( minmax[0].toStdString() ) ) );
break; break;
case 2: case 2:
m_intervals.push_back( RimCellFilterInterval( numberFromPart( minmax[0] ), numberFromPart( minmax[1] ) ) ); m_intervals.push_back(
RimCellFilterInterval( numberFromPart( minmax[0].toStdString() ), numberFromPart( minmax[1].toStdString() ) ) );
break; break;
default: default:
@@ -18,8 +18,8 @@
#pragma once #pragma once
#include <QString>
#include <list> #include <list>
#include <string>
class RimCellFilterInterval class RimCellFilterInterval
{ {
@@ -42,14 +42,14 @@ public:
RimCellFilterIntervalTool( bool includeAllByDefault = true ); RimCellFilterIntervalTool( bool includeAllByDefault = true );
~RimCellFilterIntervalTool(); ~RimCellFilterIntervalTool();
void setInterval( bool enabled, QString intervalText ); void setInterval( bool enabled, std::string intervalText );
bool isNumberIncluded( size_t number ) const; bool isNumberIncluded( size_t number ) const;
private: private:
size_t numberFromPart( QString strVal ) const; size_t numberFromPart( std::string strVal ) const;
bool m_includeAllByDefault; bool m_includeAllByDefault;
QString m_intervalText; std::string m_intervalText;
std::list<RimCellFilterInterval> m_intervals; std::list<RimCellFilterInterval> m_intervals;
}; };
@@ -812,7 +812,7 @@ void RimPolygonFilter::updateCells()
initializeCellList(); initializeCellList();
// get optional k-cell filter // get optional k-cell filter
m_intervalTool.setInterval( m_enableKFilter, m_kFilterStr ); m_intervalTool.setInterval( m_enableKFilter, m_kFilterStr().toStdString() );
// get polyline as vector // get polyline as vector
std::vector<cvf::Vec3d> points; std::vector<cvf::Vec3d> points;
@@ -125,16 +125,16 @@ private:
caf::PdmField<caf::AppEnum<PolygonIncludeType>> m_polyIncludeType; caf::PdmField<caf::AppEnum<PolygonIncludeType>> m_polyIncludeType;
caf::PdmPtrField<RimCase*> m_srcCase; caf::PdmPtrField<RimCase*> m_srcCase;
caf::PdmField<bool> m_enableFiltering; caf::PdmField<bool> m_enableFiltering;
caf::PdmField<bool> m_enableKFilter;
caf::PdmField<bool> m_showLines; caf::PdmField<bool> m_showLines;
caf::PdmField<bool> m_showSpheres; caf::PdmField<bool> m_showSpheres;
caf::PdmField<QString> m_kFilterStr;
caf::PdmField<int> m_lineThickness; caf::PdmField<int> m_lineThickness;
caf::PdmField<double> m_sphereRadiusFactor; caf::PdmField<double> m_sphereRadiusFactor;
caf::PdmField<cvf::Color3f> m_lineColor; caf::PdmField<cvf::Color3f> m_lineColor;
caf::PdmField<cvf::Color3f> m_sphereColor; caf::PdmField<cvf::Color3f> m_sphereColor;
caf::PdmField<double> m_polygonPlaneDepth; caf::PdmField<double> m_polygonPlaneDepth;
caf::PdmField<bool> m_lockPolygonToPlane; caf::PdmField<bool> m_lockPolygonToPlane;
caf::PdmField<bool> m_enableKFilter;
caf::PdmField<QString> m_kFilterStr;
std::shared_ptr<RicPolylineTargetsPickEventHandler> m_pickTargetsEventHandler; std::shared_ptr<RicPolylineTargetsPickEventHandler> m_pickTargetsEventHandler;
@@ -267,6 +267,15 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection()
CAF_PDM_InitFieldNoDefault( &m_collectionDepthFilterType, "CollectionDepthFilterType", "Collection Controlled Filter Type" ); CAF_PDM_InitFieldNoDefault( &m_collectionDepthFilterType, "CollectionDepthFilterType", "Collection Controlled Filter Type" );
m_collectionDepthFilterType.uiCapability()->setUiHidden( true ); m_collectionDepthFilterType.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_enableKFilter, "EnableKFilter", false, "Enable K Range Filter" );
CAF_PDM_InitFieldNoDefault( &m_kFilterText, "KRangeFilter", "K Range Filter", "", "Example: 2,4,10-20,31", "" );
CAF_PDM_InitField( &m_kFilterCollectionOverride, "KFilterCollectionOverride", false, "K Range Filter is Controlled by Intersection Collection" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_kFilterCollectionOverride );
CAF_PDM_InitFieldNoDefault( &m_kFilterCollectionText, "KRangeCollectionFilter", "Collection K Range Filter", "", "Example: 2,4,10-20,31", "" );
m_kFilterCollectionText.uiCapability()->setUiHidden( true );
setDeletable( true ); setDeletable( true );
} }
@@ -397,6 +406,32 @@ void RimExtrudedCurveIntersection::setDepthOverrideParameters( double upperThres
m_collectionDepthFilterType = filterType; m_collectionDepthFilterType = filterType;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimExtrudedCurveIntersection::kLayerFilterEnabled() const
{
return m_enableKFilter() || m_kFilterCollectionOverride();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimExtrudedCurveIntersection::kFilterText() const
{
if ( m_kFilterCollectionOverride() ) return m_kFilterCollectionText();
return m_kFilterText();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimExtrudedCurveIntersection::setKFilterOverride( bool collectionOverride, QString kFilterText )
{
m_kFilterCollectionOverride = collectionOverride;
m_kFilterCollectionText = kFilterText;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -406,7 +441,8 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle*
changedField == &m_simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength || changedField == &m_simulationWell || changedField == &m_branchIndex || changedField == &m_extentLength ||
changedField == &m_lengthUp || changedField == &m_lengthDown || changedField == &m_showInactiveCells || changedField == &m_lengthUp || changedField == &m_lengthDown || changedField == &m_showInactiveCells ||
changedField == &m_useSeparateDataSource || changedField == &m_separateDataSource || changedField == &m_depthUpperThreshold || changedField == &m_useSeparateDataSource || changedField == &m_separateDataSource || changedField == &m_depthUpperThreshold ||
changedField == &m_depthLowerThreshold || changedField == &m_depthThresholdOverridden || changedField == &m_depthFilterType ) changedField == &m_depthLowerThreshold || changedField == &m_depthThresholdOverridden || changedField == &m_depthFilterType ||
changedField == &m_enableKFilter || changedField == &m_kFilterText || changedField == &m_kFilterCollectionOverride )
{ {
rebuildGeometryAndScheduleCreateDisplayModel(); rebuildGeometryAndScheduleCreateDisplayModel();
} }
@@ -574,6 +610,21 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf::
default: default:
break; break;
} }
if ( eclipseView() != nullptr )
{
auto kgroup = uiOrdering.addNewGroup( "K Range Filter" );
if ( m_kFilterCollectionOverride() )
{
kgroup->add( &m_kFilterCollectionOverride );
}
else
{
kgroup->add( &m_enableKFilter );
kgroup->add( &m_kFilterText );
}
}
} }
this->defineSeparateDataSourceUi( uiConfigName, uiOrdering ); this->defineSeparateDataSourceUi( uiConfigName, uiOrdering );
@@ -26,6 +26,8 @@
#include "cafPdmChildField.h" #include "cafPdmChildField.h"
#include "cafPdmProxyValueField.h" #include "cafPdmProxyValueField.h"
#include <QString>
class RimWellPath; class RimWellPath;
class RivExtrudedCurveIntersectionPartMgr; class RivExtrudedCurveIntersectionPartMgr;
class RimEclipseView; class RimEclipseView;
@@ -81,6 +83,10 @@ public:
double lowerFilterDepth( double lowerGridLimit ) const; double lowerFilterDepth( double lowerGridLimit ) const;
RimIntersectionFilterEnum depthFilterType() const; RimIntersectionFilterEnum depthFilterType() const;
bool kLayerFilterEnabled() const;
QString kFilterText() const;
void setKFilterOverride( bool collectionOverride, QString kFilterText );
void setDepthOverride( bool collectionOverride ); void setDepthOverride( bool collectionOverride );
void setDepthOverrideParameters( double upperThreshold, double lowerThreshold, RimIntersectionFilterEnum filterType ); void setDepthOverrideParameters( double upperThreshold, double lowerThreshold, RimIntersectionFilterEnum filterType );
@@ -197,4 +203,10 @@ private:
cvf::ref<RivExtrudedCurveIntersectionPartMgr> m_crossSectionPartMgr; cvf::ref<RivExtrudedCurveIntersectionPartMgr> m_crossSectionPartMgr;
mutable std::vector<std::vector<cvf::Vec3d>> m_simulationWellBranchCenterlines; mutable std::vector<std::vector<cvf::Vec3d>> m_simulationWellBranchCenterlines;
caf::PdmField<bool> m_enableKFilter;
caf::PdmField<QString> m_kFilterText;
caf::PdmField<bool> m_kFilterCollectionOverride;
caf::PdmField<QString> m_kFilterCollectionText;
}; };
@@ -69,9 +69,12 @@ RimIntersectionCollection::RimIntersectionCollection()
m_depthLowerThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); m_depthLowerThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_depthThresholdOverridden, "DepthFilterOverride", false, "Override Intersection Depth Filters" ); CAF_PDM_InitField( &m_depthThresholdOverridden, "DepthFilterOverride", false, "Override Intersection Depth Filters" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_depthThresholdOverridden );
CAF_PDM_InitFieldNoDefault( &m_depthFilterType, "CollectionDepthFilterType", "Depth Filter Type" ); CAF_PDM_InitFieldNoDefault( &m_depthFilterType, "CollectionDepthFilterType", "Depth Filter Type" );
CAF_PDM_InitField( &m_kFilterOverridden, "OverrideKFilter", false, "Override K Range Filter" );
CAF_PDM_InitFieldNoDefault( &m_kFilterStr, "KRangeFilter", "K Range Filter", "", "Example: 2,4,10-20,31", "" );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -380,6 +383,16 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
rebuildView = true; rebuildView = true;
} }
if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
{
for ( RimExtrudedCurveIntersection* cs : m_intersections )
{
cs->setKFilterOverride( m_kFilterOverridden, m_kFilterStr );
cs->rebuildGeometryAndScheduleCreateDisplayModel();
}
rebuildView = true;
}
if ( rebuildView ) if ( rebuildView )
{ {
rebuild3dView(); rebuild3dView();
@@ -439,40 +452,46 @@ void RimIntersectionCollection::updateIntersectionBoxGeometry()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" );
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;
}
if ( eclipseView() ) if ( eclipseView() )
{ {
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" ); caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "K Filter - Curve Intersections" );
m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() ); m_kFilterStr.uiCapability()->setUiReadOnly( !m_kFilterOverridden() );
m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
m_depthLowerThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
filterGroup->add( &m_depthThresholdOverridden ); filterGroup->add( &m_kFilterOverridden );
filterGroup->add( &m_depthFilterType ); filterGroup->add( &m_kFilterStr );
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 ); uiOrdering.skipRemainingFields( true );
@@ -103,4 +103,7 @@ private:
caf::PdmField<double> m_depthUpperThreshold; caf::PdmField<double> m_depthUpperThreshold;
caf::PdmField<double> m_depthLowerThreshold; caf::PdmField<double> m_depthLowerThreshold;
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType; caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType;
caf::PdmField<bool> m_kFilterOverridden;
caf::PdmField<QString> m_kFilterStr;
}; };