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