#6093 Wells: Toggling Off a well path leaves perforations visible

This commit is contained in:
Magne Sjaastad 2020-06-22 07:27:28 +02:00
parent 33fb733110
commit be67b0cb67
2 changed files with 35 additions and 29 deletions

View File

@ -128,6 +128,26 @@ bool RivWellPathPartMgr::isWellPathWithinBoundingBox( const cvf::BoundingBox& we
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RivWellPathPartMgr::isWellPathEnabled( const cvf::BoundingBox& wellPathClipBoundingBox ) const
{
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if ( !wellPathCollection ) return false;
if ( !wellPathCollection->isActive() ) return false;
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF ) return false;
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::ALL_ON && m_rimWellPath->showWellPath() == false )
return false;
if ( !isWellPathWithinBoundingBox( wellPathClipBoundingBox ) ) return false;
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -770,16 +790,7 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel( cvf::ModelBasicList*
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox )
{
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if ( !wellPathCollection ) return;
if ( wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF ) return;
if ( wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON &&
m_rimWellPath->showWellPath() == false )
return;
if ( !isWellPathWithinBoundingBox( wellPathClipBoundingBox ) ) return;
if ( !isWellPathEnabled( wellPathClipBoundingBox ) ) return;
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
buildWellPathParts( displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox, false );
@ -804,9 +815,11 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel( cvf::ModelBasicList*
appendWellPathAttributesToModel( model, displayCoordTransform, characteristicCellSize );
RimGridView* gridView = dynamic_cast<RimGridView*>( m_rimView.p() );
if ( !gridView ) return;
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr( m_rimWellPath, gridView );
m_3dWellLogPlanePartMgr->appendPlaneToModel( model, displayCoordTransform, wellPathClipBoundingBox, true );
if ( gridView )
{
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr( m_rimWellPath, gridView );
m_3dWellLogPlanePartMgr->appendPlaneToModel( model, displayCoordTransform, wellPathClipBoundingBox, true );
}
}
//--------------------------------------------------------------------------------------------------
@ -849,17 +862,7 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList*
{
CVF_ASSERT( model );
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if ( !wellPathCollection ) return;
if ( m_rimWellPath.isNull() ) return;
bool showWellPath = ( wellPathCollection->isActive() &&
( ( wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_OFF ) ||
( wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_ON &&
m_rimWellPath->showWellPath() ) ) );
if ( !isWellPathWithinBoundingBox( wellPathClipBoundingBox ) ) return;
bool showWellPath = isWellPathEnabled( wellPathClipBoundingBox );
if ( showWellPath )
{
@ -874,13 +877,14 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList*
if ( showWellPath )
{
RimGridView* gridView = dynamic_cast<RimGridView*>( m_rimView.p() );
if ( !gridView ) return;
if ( m_3dWellLogPlanePartMgr.isNull() )
if ( gridView )
{
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr( m_rimWellPath, gridView );
if ( m_3dWellLogPlanePartMgr.isNull() )
{
m_3dWellLogPlanePartMgr = new Riv3dWellLogPlanePartMgr( m_rimWellPath, gridView );
}
m_3dWellLogPlanePartMgr->appendPlaneToModel( model, displayCoordTransform, wellPathClipBoundingBox, false );
}
m_3dWellLogPlanePartMgr->appendPlaneToModel( model, displayCoordTransform, wellPathClipBoundingBox, false );
}
}

View File

@ -135,6 +135,8 @@ private:
static cvf::Color3f mapWellMeasurementToColor( const QString& measurementKind, double value );
bool isWellPathEnabled( const cvf::BoundingBox& wellPathClipBoundingBox ) const;
private:
caf::PdmPointer<RimWellPath> m_rimWellPath;
caf::PdmPointer<Rim3dView> m_rimView;