#6934 StimPlanModel: allow user-defined depth bounding box for data extraction

This commit is contained in:
Kristian Bendiksen
2020-11-09 22:07:14 +01:00
parent 91a35784a0
commit d5f5207177
2 changed files with 52 additions and 6 deletions

View File

@@ -143,6 +143,12 @@ RimStimPlanModel::RimStimPlanModel()
CAF_PDM_InitScriptableField( &m_MD, "MeasuredDepth", 0.0, "Measured Depth", "", "", "" ); CAF_PDM_InitScriptableField( &m_MD, "MeasuredDepth", 0.0, "Measured Depth", "", "", "" );
m_MD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); m_MD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitScriptableField( &m_extractionDepthTop, "ExtractionDepthTop", -1.0, "Top", "", "", "" );
m_extractionDepthTop.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitScriptableField( &m_extractionDepthBottom, "ExtractionDepthBottom", -1.0, "Bottom", "", "", "" );
m_extractionDepthBottom.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitScriptableField( &m_extractionType, CAF_PDM_InitScriptableField( &m_extractionType,
"ExtractionType", "ExtractionType",
caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ), caf::AppEnum<ExtractionType>( ExtractionType::TRUE_STRATIGRAPHIC_THICKNESS ),
@@ -273,6 +279,11 @@ void RimStimPlanModel::initAfterRead()
{ {
m_stimPlanModelTemplate->changed.connect( this, &RimStimPlanModel::stimPlanModelTemplateChanged ); m_stimPlanModelTemplate->changed.connect( this, &RimStimPlanModel::stimPlanModelTemplateChanged );
} }
if ( m_extractionDepthTop() < 0.0 || m_extractionDepthBottom < 0.0 )
{
updateExtractionDepthBoundaries();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -290,7 +301,8 @@ void RimStimPlanModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField
if ( changedField == &m_MD || changedField == &m_extractionType || changedField == &m_boundingBoxVertical || if ( changedField == &m_MD || changedField == &m_extractionType || changedField == &m_boundingBoxVertical ||
changedField == &m_boundingBoxHorizontal || changedField == &m_fractureOrientation || changedField == &m_boundingBoxHorizontal || changedField == &m_fractureOrientation ||
changedField == &m_autoComputeBarrier || changedField == &m_azimuthAngle || changedField == &m_autoComputeBarrier || changedField == &m_azimuthAngle ||
changedField == &m_showOnlyBarrierFault || changedField == &m_eclipseCase ) changedField == &m_showOnlyBarrierFault || changedField == &m_eclipseCase ||
changedField == &m_extractionDepthTop || changedField == &m_extractionDepthBottom )
{ {
updateThicknessDirection(); updateThicknessDirection();
updateBarrierProperties(); updateBarrierProperties();
@@ -304,6 +316,8 @@ void RimStimPlanModel::fieldChangedByUi( const caf::PdmFieldHandle* changedField
{ {
m_timeStep = timeStepCount - 1; m_timeStep = timeStepCount - 1;
} }
updateExtractionDepthBoundaries();
} }
if ( changedField == &m_showAllFaults ) if ( changedField == &m_showAllFaults )
@@ -583,6 +597,20 @@ cvf::Vec3d RimStimPlanModel::calculateTSTDirection() const
return direction; return direction;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanModel::updateExtractionDepthBoundaries()
{
RigEclipseCaseData* eclipseCaseData = getEclipseCaseData();
if ( eclipseCaseData )
{
const cvf::BoundingBox& boundingBox = eclipseCaseData->mainGrid()->boundingBox();
m_extractionDepthTop = -boundingBox.max().z();
m_extractionDepthBottom = -boundingBox.min().z();
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -851,6 +879,10 @@ void RimStimPlanModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
uiOrdering.add( &m_anchorPosition ); uiOrdering.add( &m_anchorPosition );
uiOrdering.add( &m_thicknessDirection ); uiOrdering.add( &m_thicknessDirection );
caf::PdmUiOrdering* extractionBoundariesGroup = uiOrdering.addNewGroup( "Extraction Depth Boundaries" );
extractionBoundariesGroup->add( &m_extractionDepthTop );
extractionBoundariesGroup->add( &m_extractionDepthBottom );
caf::PdmUiOrdering* boundingBoxGroup = uiOrdering.addNewGroup( "Bounding Box" ); caf::PdmUiOrdering* boundingBoxGroup = uiOrdering.addNewGroup( "Bounding Box" );
boundingBoxGroup->add( &m_boundingBoxHorizontal ); boundingBoxGroup->add( &m_boundingBoxHorizontal );
boundingBoxGroup->add( &m_boundingBoxVertical ); boundingBoxGroup->add( &m_boundingBoxVertical );
@@ -971,16 +1003,26 @@ bool RimStimPlanModel::findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::
const cvf::Vec3d& position = anchorPosition(); const cvf::Vec3d& position = anchorPosition();
const cvf::Vec3d& direction = thicknessDirection(); const cvf::Vec3d& direction = thicknessDirection();
RiaLogging::info( QString( "Position: %1" ).arg( RimStimPlanModel::vecToString( position ) ) );
RiaLogging::info( QString( "Direction: %1" ).arg( RimStimPlanModel::vecToString( direction ) ) );
// Create a "fake" well path which from top to bottom of formation // Create a "fake" well path which from top to bottom of formation
// passing through the point and with the given direction // passing through the point and with the given direction
const cvf::BoundingBox& geometryBoundingBox = eclipseCaseData->mainGrid()->boundingBox(); const cvf::BoundingBox& allCellsBoundingBox = eclipseCaseData->mainGrid()->boundingBox();
RiaLogging::info( QString( "All cells bounding box: %1 %2" ) RiaLogging::info( QString( "All cells bounding box: %1 %2" )
.arg( RimStimPlanModel::vecToString( geometryBoundingBox.min() ) ) .arg( RimStimPlanModel::vecToString( allCellsBoundingBox.min() ) )
.arg( RimStimPlanModel::vecToString( geometryBoundingBox.max() ) ) ); .arg( RimStimPlanModel::vecToString( allCellsBoundingBox.max() ) ) );
RiaLogging::info( QString( "Position: %1" ).arg( RimStimPlanModel::vecToString( position ) ) ); cvf::BoundingBox geometryBoundingBox( allCellsBoundingBox );
RiaLogging::info( QString( "Direction: %1" ).arg( RimStimPlanModel::vecToString( direction ) ) );
// Use smaller depth bounding box for extraction if configured
if ( m_extractionDepthTop > 0.0 && m_extractionDepthBottom > 0.0 && m_extractionDepthTop > m_extractionDepthBottom )
{
cvf::Vec3d bbMin( allCellsBoundingBox.min().x(), allCellsBoundingBox.min().y(), -m_extractionDepthBottom );
cvf::Vec3d bbMax( allCellsBoundingBox.max().x(), allCellsBoundingBox.max().y(), -m_extractionDepthTop );
geometryBoundingBox = cvf::BoundingBox( bbMin, bbMax );
}
if ( !geometryBoundingBox.contains( position ) ) if ( !geometryBoundingBox.contains( position ) )
{ {
@@ -1458,6 +1500,7 @@ RimEclipseCase* RimStimPlanModel::eclipseCase() const
void RimStimPlanModel::setEclipseCase( RimEclipseCase* eclipseCase ) void RimStimPlanModel::setEclipseCase( RimEclipseCase* eclipseCase )
{ {
m_eclipseCase = eclipseCase; m_eclipseCase = eclipseCase;
updateExtractionDepthBoundaries();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -219,12 +219,15 @@ private:
void showAllFaults(); void showAllFaults();
RimColorLegend* getFaciesColorLegend() const; RimColorLegend* getFaciesColorLegend() const;
void updateExtractionDepthBoundaries();
protected: protected:
caf::PdmField<double> m_MD; caf::PdmField<double> m_MD;
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase; caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
caf::PdmField<int> m_timeStep; caf::PdmField<int> m_timeStep;
caf::PdmField<caf::AppEnum<ExtractionType>> m_extractionType; caf::PdmField<caf::AppEnum<ExtractionType>> m_extractionType;
caf::PdmField<double> m_extractionDepthTop;
caf::PdmField<double> m_extractionDepthBottom;
caf::PdmField<cvf::Vec3d> m_anchorPosition; caf::PdmField<cvf::Vec3d> m_anchorPosition;
caf::PdmField<cvf::Vec3d> m_thicknessDirection; caf::PdmField<cvf::Vec3d> m_thicknessDirection;
caf::PdmField<double> m_boundingBoxVertical; caf::PdmField<double> m_boundingBoxVertical;