Enable filters for curve intersections (#10329)

* Enable cell filters
* Enable property filters
* Clean up fault collection interface and use similar setting for controlling filters as in intersection collection
* Enable cell/property filters on geomech intersections
* Enable cell and property filters for box intersections
This commit is contained in:
jonjenssen 2023-06-05 07:33:04 +02:00 committed by GitHub
parent 576156763a
commit 17f09878d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 562 additions and 240 deletions

View File

@ -158,7 +158,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
Riu3DMainWindowTools::setExpanded( propertyFilterCollection ); Riu3DMainWindowTools::setExpanded( propertyFilterCollection );
viewToModify->faultCollection()->showFaultCollection = false; viewToModify->faultCollection()->setActive( false );
viewToModify->faultCollection()->updateConnectedEditors(); viewToModify->faultCollection()->updateConnectedEditors();
viewToModify->updateDisplayModelForCurrentTimeStepAndRedraw(); viewToModify->updateDisplayModelForCurrentTimeStepAndRedraw();

View File

@ -242,7 +242,7 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background
contourMap->setDefaultCustomName(); contourMap->setDefaultCustomName();
contourMap->faultCollection()->showFaultCollection = false; contourMap->faultCollection()->setActive( false );
contourMap->wellCollection()->isActive = false; contourMap->wellCollection()->isActive = false;
// Set default values // Set default values
@ -297,7 +297,7 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMap(
contourMap->contourMapProjection()->setSampleSpacingFactor( 1.2 ); contourMap->contourMapProjection()->setSampleSpacingFactor( 1.2 );
} }
contourMap->faultCollection()->showFaultCollection = false; contourMap->faultCollection()->setActive( false );
contourMap->wellCollection()->isActive = false; contourMap->wellCollection()->isActive = false;
eclipseCase->contourMapCollection()->push_back( contourMap ); eclipseCase->contourMapCollection()->push_back( contourMap );

View File

@ -334,3 +334,55 @@ void RivGeoMechVizLogic::resetPartMgrs()
{ {
m_partMgrCache = new RivGeoMechPartMgrCache; m_partMgrCache = new RivGeoMechPartMgrCache;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGeoMechVizLogic::calculateCellVisibility( cvf::UByteArray* totalVisibility, std::vector<RivCellSetEnum> geomTypes, int viewerStepIndex )
{
if ( !m_geomechView->geoMechCase() ) return;
int partCount = m_geomechView->femParts()->partCount();
if ( partCount == 0 ) return;
int elmCount = 0;
for ( int i = 0; i < partCount; i++ )
{
RigFemPart* part = m_geomechView->femParts()->part( i );
elmCount += part->elementCount();
}
totalVisibility->resize( elmCount );
totalVisibility->setAll( false );
std::vector<RivGeoMechPartMgrCache::Key> partMgrs;
for ( auto geomType : geomTypes )
{
// skip types not support in geomech
if ( geomType == PROPERTY_FILTERED_WELL_CELLS ) continue;
if ( geomType == RANGE_FILTERED_WELL_CELLS ) continue;
partMgrs.push_back( RivGeoMechPartMgrCache::Key( geomType, viewerStepIndex ) );
}
for ( size_t pmIdx = 0; pmIdx < partMgrs.size(); ++pmIdx )
{
RivGeoMechPartMgr* partMgr = getUpdatedPartMgr( partMgrs[pmIdx] );
CVF_ASSERT( partMgr );
if ( partMgr )
{
int elmOffset = 0;
for ( int i = 0; i < partCount; i++ )
{
RigFemPart* part = m_geomechView->femParts()->part( i );
cvf::ref<cvf::UByteArray> visibility = partMgr->cellVisibility( i );
for ( int elmIdx = 0; elmIdx < part->elementCount(); ++elmIdx )
{
( *totalVisibility )[elmOffset + elmIdx] |= ( *visibility )[elmIdx];
}
elmOffset += part->elementCount();
}
}
}
}

View File

@ -48,7 +48,10 @@ public:
void updateStaticCellColors( int viewerStepIndex ); void updateStaticCellColors( int viewerStepIndex );
void scheduleGeometryRegen( RivCellSetEnum geometryType ); void scheduleGeometryRegen( RivCellSetEnum geometryType );
void scheduleGeometryRegenOfVisiblePartMgrs( int viewerStepIndex ); void scheduleGeometryRegenOfVisiblePartMgrs( int viewerStepIndex );
void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int viewerStepIndex ); void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int viewerStepIndex );
void calculateCellVisibility( cvf::UByteArray* totalVisibility, std::vector<RivCellSetEnum> geomTypes, int viewerStepIndex );
void resetPartMgrs(); void resetPartMgrs();
std::vector<RivGeoMechPartMgrCache::Key> keysToVisiblePartMgrs( int viewerStepIndex ) const; std::vector<RivGeoMechPartMgrCache::Key> keysToVisiblePartMgrs( int viewerStepIndex ) const;

View File

@ -70,9 +70,9 @@ bool RivBoxIntersectionGeometryGenerator::isAnyGeometryPresent() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
cvf::ref<cvf::DrawableGeo> RivBoxIntersectionGeometryGenerator::generateSurface() cvf::ref<cvf::DrawableGeo> RivBoxIntersectionGeometryGenerator::generateSurface( cvf::UByteArray* visibleCells )
{ {
calculateArrays(); calculateArrays( visibleCells );
CVF_ASSERT( m_triangleVxes.notNull() ); CVF_ASSERT( m_triangleVxes.notNull() );
@ -244,7 +244,7 @@ RimBoxIntersection* RivBoxIntersectionGeometryGenerator::intersectionBox() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivBoxIntersectionGeometryGenerator::calculateArrays() void RivBoxIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* visibleCells )
{ {
if ( m_triangleVxes->size() ) return; if ( m_triangleVxes->size() ) return;
@ -310,6 +310,7 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
{ {
size_t globalCellIdx = columnCellCandidates[cccIdx]; size_t globalCellIdx = columnCellCandidates[cccIdx];
if ( ( visibleCells != nullptr ) && ( ( *visibleCells )[globalCellIdx] == 0 ) ) continue;
if ( !m_hexGrid->useCell( globalCellIdx ) ) continue; if ( !m_hexGrid->useCell( globalCellIdx ) ) continue;
hexPlaneCutTriangleVxes.clear(); hexPlaneCutTriangleVxes.clear();

View File

@ -46,7 +46,7 @@ public:
~RivBoxIntersectionGeometryGenerator() override; ~RivBoxIntersectionGeometryGenerator() override;
// Generate geometry // Generate geometry
cvf::ref<cvf::DrawableGeo> generateSurface(); cvf::ref<cvf::DrawableGeo> generateSurface( cvf::UByteArray* visibleCells );
cvf::ref<cvf::DrawableGeo> createMeshDrawable(); cvf::ref<cvf::DrawableGeo> createMeshDrawable();
RimBoxIntersection* intersectionBox() const; RimBoxIntersection* intersectionBox() const;
@ -60,7 +60,7 @@ public:
const cvf::Vec3fArray* triangleVxes() const override; const cvf::Vec3fArray* triangleVxes() const override;
private: private:
void calculateArrays(); void calculateArrays( cvf::UByteArray* visibleCells );
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid; cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;

View File

@ -96,12 +96,12 @@ void RivBoxIntersectionPartMgr::updateCellResultColor( int timeStepIndex )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivBoxIntersectionPartMgr::generatePartGeometry() void RivBoxIntersectionPartMgr::generatePartGeometry( cvf::UByteArray* visibleCells )
{ {
bool useBufferObjects = true; bool useBufferObjects = true;
// Surface geometry // Surface geometry
{ {
cvf::ref<cvf::DrawableGeo> geo = m_intersectionBoxGenerator->generateSurface(); cvf::ref<cvf::DrawableGeo> geo = m_intersectionBoxGenerator->generateSurface( visibleCells );
if ( geo.notNull() ) if ( geo.notNull() )
{ {
geo->computeNormals(); geo->computeNormals();
@ -187,11 +187,6 @@ void RivBoxIntersectionPartMgr::updatePartEffect()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
{ {
if ( m_intersectionBoxFaces.isNull() && m_intersectionBoxGridLines.isNull() )
{
generatePartGeometry();
}
if ( m_intersectionBoxFaces.notNull() ) if ( m_intersectionBoxFaces.notNull() )
{ {
m_intersectionBoxFaces->setTransform( scaleTransform ); m_intersectionBoxFaces->setTransform( scaleTransform );
@ -204,11 +199,6 @@ void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::Model
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivBoxIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) void RivBoxIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
{ {
if ( m_intersectionBoxFaces.isNull() && m_intersectionBoxGridLines.isNull() )
{
generatePartGeometry();
}
if ( m_intersectionBoxGridLines.notNull() ) if ( m_intersectionBoxGridLines.notNull() )
{ {
m_intersectionBoxGridLines->setTransform( scaleTransform ); m_intersectionBoxGridLines->setTransform( scaleTransform );

View File

@ -63,9 +63,10 @@ public:
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const; const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const;
void generatePartGeometry( cvf::UByteArray* visibleCells );
private: private:
void updatePartEffect(); void updatePartEffect();
void generatePartGeometry();
private: private:
RimBoxIntersection* m_rimIntersectionBox; RimBoxIntersection* m_rimIntersectionBox;

View File

@ -265,7 +265,7 @@ private:
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* visibleCells )
{ {
if ( m_triangleVxes->size() ) return; if ( m_triangleVxes->size() ) return;
@ -386,6 +386,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
for ( auto globalCellIdx : columnCellCandidates ) for ( auto globalCellIdx : columnCellCandidates )
{ {
if ( ( visibleCells != nullptr ) && ( ( *visibleCells )[globalCellIdx] == 0 ) ) continue;
if ( !m_hexGrid->useCell( globalCellIdx ) ) continue; if ( !m_hexGrid->useCell( globalCellIdx ) ) continue;
hexPlaneCutTriangleVxes.clear(); hexPlaneCutTriangleVxes.clear();
@ -618,9 +619,9 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
/// Generate surface drawable geo from the specified region /// Generate surface drawable geo from the specified region
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::generateSurface() cvf::ref<cvf::DrawableGeo> RivExtrudedCurveIntersectionGeometryGenerator::generateSurface( cvf::UByteArray* visibleCells )
{ {
calculateArrays(); calculateArrays( visibleCells );
CVF_ASSERT( m_triangleVxes.notNull() ); CVF_ASSERT( m_triangleVxes.notNull() );
@ -781,7 +782,7 @@ const cvf::Vec3fArray* RivExtrudedCurveIntersectionGeometryGenerator::faultMeshV
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionGeometryGenerator::ensureGeometryIsCalculated() void RivExtrudedCurveIntersectionGeometryGenerator::ensureGeometryIsCalculated()
{ {
calculateArrays(); calculateArrays( nullptr );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -60,7 +60,7 @@ public:
~RivExtrudedCurveIntersectionGeometryGenerator() override; ~RivExtrudedCurveIntersectionGeometryGenerator() override;
// Generate geometry // Generate geometry
cvf::ref<cvf::DrawableGeo> generateSurface(); cvf::ref<cvf::DrawableGeo> generateSurface( cvf::UByteArray* visibleCells );
cvf::ref<cvf::DrawableGeo> createMeshDrawable(); cvf::ref<cvf::DrawableGeo> createMeshDrawable();
cvf::ref<cvf::DrawableGeo> createFaultMeshDrawable(); cvf::ref<cvf::DrawableGeo> createFaultMeshDrawable();
@ -87,7 +87,7 @@ public:
void ensureGeometryIsCalculated(); void ensureGeometryIsCalculated();
private: private:
void calculateArrays(); void calculateArrays( cvf::UByteArray* visibleCells );
void calculateLineSegementTransforms(); void calculateLineSegementTransforms();
void calculateTransformedPolyline(); void calculateTransformedPolyline();
void calculateSurfaceIntersectionPoints(); void calculateSurfaceIntersectionPoints();

View File

@ -231,7 +231,7 @@ void RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMech
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry() void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry( cvf::UByteArray* visibleCells )
{ {
if ( m_intersectionGenerator.isNull() ) return; if ( m_intersectionGenerator.isNull() ) return;
@ -242,7 +242,7 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry()
bool useBufferObjects = true; bool useBufferObjects = true;
// Surface geometry // Surface geometry
{ {
cvf::ref<cvf::DrawableGeo> geo = m_intersectionGenerator->generateSurface(); cvf::ref<cvf::DrawableGeo> geo = m_intersectionGenerator->generateSurface( visibleCells );
if ( geo.notNull() ) if ( geo.notNull() )
{ {
geo->computeNormals(); geo->computeNormals();
@ -772,11 +772,6 @@ cvf::ref<cvf::Part> RivExtrudedCurveIntersectionPartMgr::createCurvePart( const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
{ {
if ( m_intersectionFaces.isNull() )
{
generatePartGeometry();
}
if ( m_intersectionFaces.notNull() ) if ( m_intersectionFaces.notNull() )
{ {
m_intersectionFaces->setTransform( scaleTransform ); m_intersectionFaces->setTransform( scaleTransform );
@ -789,11 +784,6 @@ void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::M
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
{ {
if ( m_intersectionGridLines.isNull() )
{
generatePartGeometry();
}
if ( m_intersectionGridLines.notNull() ) if ( m_intersectionGridLines.notNull() )
{ {
m_intersectionGridLines->setTransform( scaleTransform ); m_intersectionGridLines->setTransform( scaleTransform );
@ -873,7 +863,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView&
for ( size_t i = 0; i < m_annotationParts.size(); i++ ) for ( size_t i = 0; i < m_annotationParts.size(); i++ )
{ {
auto part = m_annotationParts[i]; auto& part = m_annotationParts[i];
if ( part.notNull() ) if ( part.notNull() )
{ {
part->setTransform( scaleTransform ); part->setTransform( scaleTransform );

View File

@ -20,13 +20,13 @@
#pragma once #pragma once
#include "cvfArray.h" #include "cvfArray.h"
#include "cvfCollection.h"
#include "cvfColor4.h" #include "cvfColor4.h"
#include "cvfMatrix4.h" #include "cvfMatrix4.h"
#include "cvfObject.h" #include "cvfObject.h"
#include "cvfVector3.h" #include "cvfVector3.h"
#include "cafPdmPointer.h" #include "cafPdmPointer.h"
#include "cvfCollection.h"
#include <QString> #include <QString>
@ -81,8 +81,9 @@ public:
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const; const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const;
void generatePartGeometry( cvf::UByteArray* visibleCells );
private: private:
void generatePartGeometry();
void createFaultLabelParts( const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors ); void createFaultLabelParts( const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors );
void createPolyLineParts( bool useBufferObjects ); void createPolyLineParts( bool useBufferObjects );
void createExtrusionDirParts( bool useBufferObjects ); void createExtrusionDirParts( bool useBufferObjects );

View File

@ -859,7 +859,7 @@ void RivFaultPartMgr::updateNNCColors( size_t timeStepIndex, RimEclipseCellColor
cvf::ref<cvf::Effect> nncEffect; cvf::ref<cvf::Effect> nncEffect;
if ( m_rimFaultCollection->showFaultFaces || m_rimFaultCollection->showOppositeFaultFaces ) if ( m_rimFaultCollection->showFaultFaces() || m_rimFaultCollection->showOppositeFaultFaces() )
{ {
// Move NNC closer to camera to avoid z-fighting with grid surface // Move NNC closer to camera to avoid z-fighting with grid surface
caf::ScalarMapperEffectGenerator nncEffgen( mapper, caf::PO_NEG_LARGE ); caf::ScalarMapperEffectGenerator nncEffgen( mapper, caf::PO_NEG_LARGE );
@ -901,7 +901,7 @@ void RivFaultPartMgr::updateNNCColors( size_t timeStepIndex, RimEclipseCellColor
CVF_ASSERT( nncColor.isValid() ); CVF_ASSERT( nncColor.isValid() );
cvf::ref<cvf::Effect> nncEffect; cvf::ref<cvf::Effect> nncEffect;
if ( m_rimFaultCollection->showFaultFaces || m_rimFaultCollection->showOppositeFaultFaces ) if ( m_rimFaultCollection->showFaultFaces() || m_rimFaultCollection->showOppositeFaultFaces() )
{ {
// Move NNC closer to camera to avoid z-fighting with grid surface // Move NNC closer to camera to avoid z-fighting with grid surface
caf::SurfaceEffectGenerator nncEffgen( nncColor, caf::PO_NEG_LARGE ); caf::SurfaceEffectGenerator nncEffgen( nncColor, caf::PO_NEG_LARGE );

View File

@ -54,9 +54,9 @@ RivReservoirFaultsPartMgr::RivReservoirFaultsPartMgr( const RigMainGrid* grid, R
RimFaultInViewCollection* faultCollection = reservoirView->faultCollection(); RimFaultInViewCollection* faultCollection = reservoirView->faultCollection();
if ( faultCollection ) if ( faultCollection )
{ {
for ( size_t i = 0; i < faultCollection->faults.size(); i++ ) for ( auto fault : faultCollection->faults() )
{ {
m_faultParts.push_back( new RivFaultPartMgr( grid, faultCollection, faultCollection->faults[i] ) ); m_faultParts.push_back( new RivFaultPartMgr( grid, faultCollection, fault ) );
} }
} }
} }
@ -86,9 +86,9 @@ void RivReservoirFaultsPartMgr::setCellVisibility( cvf::UByteArray* cellVisibili
{ {
CVF_ASSERT( cellVisibilities ); CVF_ASSERT( cellVisibilities );
for ( size_t i = 0; i < m_faultParts.size(); i++ ) for ( auto& faultPart : m_faultParts )
{ {
m_faultParts.at( i )->setCellVisibility( cellVisibilities ); faultPart->setCellVisibility( cellVisibilities );
} }
} }
@ -103,14 +103,14 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
if ( !faultCollection ) return; if ( !faultCollection ) return;
bool isShowingGrid = m_reservoirView->isMainGridVisible(); bool isShowingGrid = m_reservoirView->isMainGridVisible();
if ( !faultCollection->showFaultCollection() && !isShowingGrid ) return; if ( !faultCollection->isActive() && !isShowingGrid ) return;
// Check match between model fault count and fault parts // Check match between model fault count and fault parts
CVF_ASSERT( faultCollection->faults.size() == m_faultParts.size() ); CVF_ASSERT( faultCollection->faults().size() == m_faultParts.size() );
// Parts that is overridden by the grid settings // Parts that is overridden by the grid settings
bool forceDisplayOfFault = false; bool forceDisplayOfFault = false;
if ( !faultCollection->isShowingFaultsAndFaultsOutsideFilters() ) if ( faultCollection->shouldApplyCellFiltersToFaults() )
{ {
forceDisplayOfFault = isShowingGrid; forceDisplayOfFault = isShowingGrid;
} }
@ -122,14 +122,13 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
cvf::ModelBasicList parts; cvf::ModelBasicList parts;
for ( size_t i = 0; i < faultCollection->faults.size(); i++ ) int i = 0;
for ( const auto rimFault : faultCollection->faults() )
{ {
const RimFaultInView* rimFault = faultCollection->faults[i]; cvf::ref<RivFaultPartMgr> rivFaultPart = m_faultParts[i++];
cvf::ref<RivFaultPartMgr> rivFaultPart = m_faultParts[i];
CVF_ASSERT( rivFaultPart.notNull() ); CVF_ASSERT( rivFaultPart.notNull() );
if ( ( faultCollection->showFaultCollection() && rimFault->showFault() ) || forceDisplayOfFault ) if ( ( faultCollection->isActive() && rimFault->showFault() ) || forceDisplayOfFault )
{ {
if ( faultCollection->showFaultFaces() || forceDisplayOfFault ) if ( faultCollection->showFaultFaces() || forceDisplayOfFault )
{ {
@ -152,7 +151,7 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
RimEclipseFaultColors* faultResultColors = m_reservoirView->faultResultSettings(); RimEclipseFaultColors* faultResultColors = m_reservoirView->faultResultSettings();
RimEclipseCellColors* cellResultColors = m_reservoirView->cellResult(); RimEclipseCellColors* cellResultColors = m_reservoirView->cellResult();
if ( rimFault->showFault() && faultCollection->showFaultCollection() ) if ( rimFault->showFault() && faultCollection->isActive() )
{ {
if ( faultCollection->showNNCs() ) if ( faultCollection->showNNCs() )
{ {
@ -190,7 +189,7 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
} }
} }
if ( faultCollection->hideNncsWhenNoResultIsAvailable() ) if ( faultCollection->hideNNCsWhenNoResultIsAvailable() )
{ {
RigMainGrid* mainGrid = m_reservoirView->mainGrid(); RigMainGrid* mainGrid = m_reservoirView->mainGrid();
if ( !( mainGrid && mainGrid->nncData()->hasScalarValues( eclipseResultAddress ) ) ) if ( !( mainGrid && mainGrid->nncData()->hasScalarValues( eclipseResultAddress ) ) )
@ -231,9 +230,9 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivReservoirFaultsPartMgr::applySingleColorEffect() void RivReservoirFaultsPartMgr::applySingleColorEffect()
{ {
for ( size_t i = 0; i < m_faultParts.size(); i++ ) for ( auto& faultPart : m_faultParts )
{ {
m_faultParts[i]->applySingleColorEffect(); faultPart->applySingleColorEffect();
} }
} }
@ -247,15 +246,15 @@ void RivReservoirFaultsPartMgr::updateColors( size_t timeStepIndex, RimEclipseCe
RimFaultInViewCollection* faultCollection = m_reservoirView->faultCollection(); RimFaultInViewCollection* faultCollection = m_reservoirView->faultCollection();
CVF_ASSERT( faultCollection ); CVF_ASSERT( faultCollection );
for ( size_t i = 0; i < faultCollection->faults.size(); i++ ) for ( auto& faultPart : m_faultParts )
{ {
if ( cellResultColors && ( cellResultColors->hasResult() || cellResultColors->isTernarySaturationSelected() ) ) if ( cellResultColors && ( cellResultColors->hasResult() || cellResultColors->isTernarySaturationSelected() ) )
{ {
m_faultParts[i]->updateCellResultColor( timeStepIndex, cellResultColors ); faultPart->updateCellResultColor( timeStepIndex, cellResultColors );
} }
else else
{ {
m_faultParts[i]->applySingleColorEffect(); faultPart->applySingleColorEffect();
} }
} }
} }
@ -267,9 +266,9 @@ void RivReservoirFaultsPartMgr::updateCellEdgeResultColor( size_t
RimEclipseCellColors* cellResultColors, RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors ) RimCellEdgeColors* cellEdgeResultColors )
{ {
for ( size_t i = 0; i < m_faultParts.size(); i++ ) for ( auto& faultPart : m_faultParts )
{ {
m_faultParts[i]->updateCellEdgeResultColor( timeStepIndex, cellResultColors, cellEdgeResultColors ); faultPart->updateCellEdgeResultColor( timeStepIndex, cellResultColors, cellEdgeResultColors );
} }
} }
@ -284,20 +283,19 @@ void RivReservoirFaultsPartMgr::appendLabelPartsToModel( cvf::ModelBasicList* mo
RimFaultInViewCollection* faultCollection = m_reservoirView->faultCollection(); RimFaultInViewCollection* faultCollection = m_reservoirView->faultCollection();
CVF_ASSERT( faultCollection ); CVF_ASSERT( faultCollection );
if ( !faultCollection->showFaultCollection() ) return; if ( !faultCollection->isActive() ) return;
if ( !faultCollection->showFaultLabel() ) return; if ( !faultCollection->showFaultLabel() ) return;
// Check match between model fault count and fault parts // Check match between model fault count and fault parts
CVF_ASSERT( faultCollection->faults.size() == m_faultParts.size() ); CVF_ASSERT( faultCollection->faults().size() == m_faultParts.size() );
cvf::ModelBasicList parts; cvf::ModelBasicList parts;
for ( size_t i = 0; i < faultCollection->faults.size(); i++ ) int i = 0;
for ( const auto rimFault : faultCollection->faults() )
{ {
const RimFaultInView* rimFault = faultCollection->faults[i]; cvf::ref<RivFaultPartMgr> rivFaultPart = m_faultParts[i++];
cvf::ref<RivFaultPartMgr> rivFaultPart = m_faultParts[i];
CVF_ASSERT( rivFaultPart.notNull() ); CVF_ASSERT( rivFaultPart.notNull() );
if ( rimFault->showFault() ) if ( rimFault->showFault() )
@ -336,8 +334,8 @@ void RivReservoirFaultsPartMgr::clearWatertightGeometryFlag()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RivReservoirFaultsPartMgr::setOpacityLevel( float opacity ) void RivReservoirFaultsPartMgr::setOpacityLevel( float opacity )
{ {
for ( size_t i = 0; i < m_faultParts.size(); i++ ) for ( auto& faultPart : m_faultParts )
{ {
m_faultParts[i]->setOpacityLevel( opacity ); faultPart->setOpacityLevel( opacity );
} }
} }

View File

@ -62,40 +62,42 @@ RimFaultInViewCollection::RimFaultInViewCollection()
{ {
CAF_PDM_InitObject( "Faults", ":/draw_style_faults_24x24.png" ); CAF_PDM_InitObject( "Faults", ":/draw_style_faults_24x24.png" );
CAF_PDM_InitField( &showFaultCollection, "Active", true, "Active" ); CAF_PDM_InitField( &m_showFaultCollection, "Active", true, "Active" );
showFaultCollection.uiCapability()->setUiHidden( true ); m_showFaultCollection.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &showFaultFaces, "ShowFaultFaces", true, "Show Defined faces" ); CAF_PDM_InitField( &m_showFaultFaces, "ShowFaultFaces", true, "Show Defined faces" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultFaces ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultFaces );
CAF_PDM_InitField( &showOppositeFaultFaces, "ShowOppositeFaultFaces", true, "Show Opposite Faces" ); CAF_PDM_InitField( &m_showOppositeFaultFaces, "ShowOppositeFaultFaces", true, "Show Opposite Faces" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showOppositeFaultFaces ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showOppositeFaultFaces );
CAF_PDM_InitField( &m_showFaultsOutsideFilters, "ShowFaultsOutsideFilters", true, "Show Faults Outside Filters" ); CAF_PDM_InitField( &m_applyCellFilters, "ApplyCellFilters", true, "Use Cell Filters for Faults" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultsOutsideFilters );
CAF_PDM_InitField( &m_onlyShowWithNeighbor, "OnlyShowWithDefNeighbor", false, "Show Only Faces with Juxtaposition" ); CAF_PDM_InitField( &m_onlyShowWithNeighbor, "OnlyShowWithDefNeighbor", false, "Show Only Faces with Juxtaposition" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyShowWithNeighbor ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyShowWithNeighbor );
CAF_PDM_InitField( &faultResult, CAF_PDM_InitField( &m_faultResult,
"FaultFaceCulling", "FaultFaceCulling",
caf::AppEnum<RimFaultInViewCollection::FaultFaceCullingMode>( RimFaultInViewCollection::FAULT_BACK_FACE_CULLING ), caf::AppEnum<RimFaultInViewCollection::FaultFaceCullingMode>( RimFaultInViewCollection::FAULT_BACK_FACE_CULLING ),
"Dynamic Face Selection" ); "Dynamic Face Selection" );
CAF_PDM_InitField( &showFaultLabel, "ShowFaultLabel", false, "Show Labels" ); CAF_PDM_InitField( &m_showFaultLabel, "ShowFaultLabel", false, "Show Labels" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultLabel ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultLabel );
cvf::Color3f defWellLabelColor = RiaPreferences::current()->defaultWellLabelColor(); cvf::Color3f defWellLabelColor = RiaPreferences::current()->defaultWellLabelColor();
CAF_PDM_InitField( &faultLabelColor, "FaultLabelColor", defWellLabelColor, "Label Color" ); CAF_PDM_InitField( &m_faultLabelColor, "FaultLabelColor", defWellLabelColor, "Label Color" );
CAF_PDM_InitField( &showNNCs, "ShowNNCs", true, "Show NNCs" ); CAF_PDM_InitField( &m_showNNCs, "ShowNNCs", true, "Show NNCs" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showNNCs ); caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showNNCs );
CAF_PDM_InitField( &hideNncsWhenNoResultIsAvailable, "HideNncsWhenNoResultIsAvailable", true, "Hide NNC Geometry if No NNC Result is Available" ); CAF_PDM_InitField( &m_hideNNCsWhenNoResultIsAvailable,
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &hideNncsWhenNoResultIsAvailable ); "HideNncsWhenNoResultIsAvailable",
true,
"Hide NNC Geometry if No NNC Result is Available" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_hideNNCsWhenNoResultIsAvailable );
CAF_PDM_InitFieldNoDefault( &faults, "Faults", "Faults" ); CAF_PDM_InitFieldNoDefault( &m_faults, "Faults", "Faults" );
faults.uiCapability()->setUiTreeHidden( true ); m_faults.uiCapability()->setUiTreeHidden( true );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -103,7 +105,79 @@ RimFaultInViewCollection::RimFaultInViewCollection()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFaultInViewCollection::~RimFaultInViewCollection() RimFaultInViewCollection::~RimFaultInViewCollection()
{ {
faults.deleteChildren(); m_faults.deleteChildren();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::isActive() const
{
return m_showFaultCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setActive( bool bActive )
{
m_showFaultCollection = bActive;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimFaultInViewCollection::faultLabelColor() const
{
return m_faultLabelColor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::AppEnum<RimFaultInViewCollection::FaultFaceCullingMode> RimFaultInViewCollection::faultResult() const
{
return m_faultResult();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::showFaultFaces() const
{
return m_showFaultFaces();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::showFaultLabel() const
{
return m_showFaultLabel();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::showOppositeFaultFaces() const
{
return m_showOppositeFaultFaces();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::showNNCs() const
{
return m_showOppositeFaultFaces();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::hideNNCsWhenNoResultIsAvailable() const
{
return m_hideNNCsWhenNoResultIsAvailable();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -113,7 +187,7 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
{ {
this->updateUiIconFromToggleField(); this->updateUiIconFromToggleField();
if ( &faultLabelColor == changedField ) if ( &m_faultLabelColor == changedField )
{ {
parentView()->scheduleReservoirGridGeometryRegen(); parentView()->scheduleReservoirGridGeometryRegen();
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
@ -124,16 +198,16 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
parentView()->scheduleReservoirGridGeometryRegen(); parentView()->scheduleReservoirGridGeometryRegen();
} }
if ( &showFaultFaces == changedField || &showOppositeFaultFaces == changedField || &showFaultCollection == changedField || if ( &m_showFaultFaces == changedField || &m_showOppositeFaultFaces == changedField || &m_showFaultCollection == changedField ||
&showFaultLabel == changedField || &m_showFaultsOutsideFilters == changedField || &faultLabelColor == changedField || &m_showFaultLabel == changedField || &m_applyCellFilters == changedField || &m_faultLabelColor == changedField ||
&m_onlyShowWithNeighbor == changedField || &faultResult == changedField || &showNNCs == changedField || &m_onlyShowWithNeighbor == changedField || &m_faultResult == changedField || &m_showNNCs == changedField ||
&hideNncsWhenNoResultIsAvailable == changedField ) &m_hideNNCsWhenNoResultIsAvailable == changedField )
{ {
parentView()->scheduleCreateDisplayModelAndRedraw(); parentView()->scheduleCreateDisplayModelAndRedraw();
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
} }
if ( &showFaultLabel == changedField ) if ( &m_showFaultLabel == changedField )
{ {
RiuMainWindow::instance()->refreshDrawStyleActions(); RiuMainWindow::instance()->refreshDrawStyleActions();
} }
@ -144,7 +218,7 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField() caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
{ {
return &showFaultCollection; return &m_showFaultCollection;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -152,12 +226,9 @@ caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimFaultInView* RimFaultInViewCollection::findFaultByName( QString name ) RimFaultInView* RimFaultInViewCollection::findFaultByName( QString name )
{ {
for ( size_t i = 0; i < this->faults().size(); ++i ) for ( auto& fault : m_faults )
{ {
if ( this->faults()[i]->name() == name ) if ( fault->name() == name ) return fault;
{
return this->faults()[i];
}
} }
return nullptr; return nullptr;
} }
@ -250,8 +321,8 @@ void RimFaultInViewCollection::syncronizeFaults()
newFaults.push_back( rimFault ); newFaults.push_back( rimFault );
} }
this->faults().clearWithoutDelete(); m_faults().clearWithoutDelete();
this->faults().insert( 0, newFaults ); m_faults().insert( 0, newFaults );
QString toolTip = QString( "Fault count (%1)" ).arg( newFaults.size() ); QString toolTip = QString( "Fault count (%1)" ).arg( newFaults.size() );
setUiToolTip( toolTip ); setUiToolTip( toolTip );
@ -272,21 +343,21 @@ void RimFaultInViewCollection::uiOrderingFaults( QString uiConfigName, caf::PdmU
{ {
bool isGridVizMode = isGridVisualizationMode(); bool isGridVizMode = isGridVisualizationMode();
faultResult.uiCapability()->setUiReadOnly( isGridVizMode ); m_faultResult.uiCapability()->setUiReadOnly( isGridVizMode );
showFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode ); m_showFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
showOppositeFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode ); m_showOppositeFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
caf::PdmUiGroup* ffviz = uiOrdering.addNewGroup( "Fault Face Visibility" ); caf::PdmUiGroup* ffviz = uiOrdering.addNewGroup( "Fault Face Visibility" );
ffviz->setCollapsedByDefault(); ffviz->setCollapsedByDefault();
ffviz->add( &showFaultFaces ); ffviz->add( &m_showFaultFaces );
ffviz->add( &showOppositeFaultFaces ); ffviz->add( &m_showOppositeFaultFaces );
ffviz->add( &faultResult ); ffviz->add( &m_faultResult );
ffviz->add( &m_onlyShowWithNeighbor ); ffviz->add( &m_onlyShowWithNeighbor );
caf::PdmUiGroup* nncViz = uiOrdering.addNewGroup( "NNC Visibility" ); caf::PdmUiGroup* nncViz = uiOrdering.addNewGroup( "NNC Visibility" );
nncViz->setCollapsedByDefault(); nncViz->setCollapsedByDefault();
nncViz->add( &showNNCs ); nncViz->add( &m_showNNCs );
nncViz->add( &hideNncsWhenNoResultIsAvailable ); nncViz->add( &m_hideNNCsWhenNoResultIsAvailable );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -294,12 +365,12 @@ void RimFaultInViewCollection::uiOrderingFaults( QString uiConfigName, caf::PdmU
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) void RimFaultInViewCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" ); caf::PdmUiGroup* general = uiOrdering.addNewGroup( "General" );
labs->add( &showFaultLabel ); general->add( &m_applyCellFilters );
labs->add( &faultLabelColor );
caf::PdmUiGroup* adv = uiOrdering.addNewGroup( "Fault Options" ); caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" );
adv->add( &m_showFaultsOutsideFilters ); labs->add( &m_showFaultLabel );
labs->add( &m_faultLabelColor );
uiOrderingFaults( uiConfigName, uiOrdering ); uiOrderingFaults( uiConfigName, uiOrdering );
} }
@ -316,7 +387,7 @@ void RimFaultInViewCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
uiTreeOrdering.appendChild( uiTree ); uiTreeOrdering.appendChild( uiTree );
} }
for ( const auto& fault : faults ) for ( const auto& fault : m_faults )
{ {
uiTreeOrdering.add( fault ); uiTreeOrdering.add( fault );
} }
@ -335,19 +406,11 @@ RimEclipseView* RimFaultInViewCollection::parentView() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RimFaultInViewCollection::isShowingFaultsAndFaultsOutsideFilters() const bool RimFaultInViewCollection::shouldApplyCellFiltersToFaults() const
{ {
if ( !showFaultCollection ) return false; if ( !m_showFaultCollection() ) return false;
return m_showFaultsOutsideFilters; return m_applyCellFilters;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setShowFaultsOutsideFilter( bool show )
{
m_showFaultsOutsideFilters = show;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -357,3 +420,43 @@ bool RimFaultInViewCollection::onlyShowFacesWithDefinedNeighbor() const
{ {
return m_onlyShowWithNeighbor; return m_onlyShowWithNeighbor;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimFaultInView*> RimFaultInViewCollection::faults() const
{
return m_faults.childrenByType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setFaultResult( caf::AppEnum<FaultFaceCullingMode> resultType )
{
m_faultResult = resultType;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setShouldApplyCellFiltersToFaults( bool bEnabled )
{
m_applyCellFilters = bEnabled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setShowOppositeFaultFaces( bool bEnabled )
{
m_showOppositeFaultFaces = bEnabled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaultInViewCollection::setShowFaultLabelWithFieldChanged( bool bEnabled )
{
m_showFaultLabel.setValueWithFieldChanged( bEnabled );
}

View File

@ -31,6 +31,8 @@
#include <QString> #include <QString>
#include <vector>
class RimEclipseView; class RimEclipseView;
class RimFaultInView; class RimFaultInView;
@ -54,28 +56,29 @@ public:
RimFaultInViewCollection(); RimFaultInViewCollection();
~RimFaultInViewCollection() override; ~RimFaultInViewCollection() override;
bool isActive() const;
void setActive( bool bActive );
std::vector<RimFaultInView*> faults() const;
cvf::Color3f faultLabelColor() const;
caf::AppEnum<FaultFaceCullingMode> faultResult() const;
bool showFaultFaces() const;
bool showFaultLabel() const;
bool showOppositeFaultFaces() const;
bool showNNCs() const;
bool hideNNCsWhenNoResultIsAvailable() const;
void setFaultResult( caf::AppEnum<FaultFaceCullingMode> resultType );
void setShouldApplyCellFiltersToFaults( bool bEnabled );
void setShowOppositeFaultFaces( bool bEnabled );
void setShowFaultLabelWithFieldChanged( bool bEnabled );
void syncronizeFaults(); void syncronizeFaults();
bool isGridVisualizationMode() const; bool isGridVisualizationMode() const;
bool shouldApplyCellFiltersToFaults() const;
bool isShowingFaultsAndFaultsOutsideFilters() const;
void setShowFaultsOutsideFilter( bool show );
bool onlyShowFacesWithDefinedNeighbor() const; bool onlyShowFacesWithDefinedNeighbor() const;
caf::PdmField<bool> showFaultFaces;
caf::PdmField<bool> showOppositeFaultFaces;
caf::PdmField<caf::AppEnum<FaultFaceCullingMode>> faultResult;
caf::PdmField<bool> showFaultLabel;
caf::PdmField<cvf::Color3f> faultLabelColor;
caf::PdmField<bool> showFaultCollection;
caf::PdmField<bool> showNNCs;
caf::PdmField<bool> hideNncsWhenNoResultIsAvailable;
caf::PdmChildArrayField<RimFaultInView*> faults;
RimFaultInView* findFaultByName( QString name ); RimFaultInView* findFaultByName( QString name );
void uiOrderingFaults( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); void uiOrderingFaults( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
@ -90,6 +93,19 @@ private:
RimEclipseView* parentView() const; RimEclipseView* parentView() const;
private: private:
caf::PdmField<bool> m_showFaultsOutsideFilters; caf::PdmField<bool> m_showFaultsOutsideFilters_obsolete;
caf::PdmField<bool> m_applyCellFilters;
caf::PdmField<bool> m_onlyShowWithNeighbor; caf::PdmField<bool> m_onlyShowWithNeighbor;
caf::PdmField<bool> m_showFaultFaces;
caf::PdmField<bool> m_showOppositeFaultFaces;
caf::PdmField<bool> m_showFaultLabel;
caf::PdmField<cvf::Color3f> m_faultLabelColor;
caf::PdmField<bool> m_showFaultCollection;
caf::PdmField<bool> m_showNNCs;
caf::PdmField<bool> m_hideNNCsWhenNoResultIsAvailable;
caf::PdmField<caf::AppEnum<FaultFaceCullingMode>> m_faultResult;
caf::PdmChildArrayField<RimFaultInView*> m_faults;
}; };

View File

@ -537,7 +537,7 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( view != nullptr ) if ( view != nullptr )
{ {
view->faultCollection()->showFaultCollection = false; view->faultCollection()->setActive( false );
view->cellResult()->setResultType( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ); view->cellResult()->setResultType( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS );
view->cellResult()->setFlowDiagTracerSelectionType( view->cellResult()->setFlowDiagTracerSelectionType(
RimEclipseResultDefinition::FlowTracerSelectionType::FLOW_TR_BY_SELECTION ); RimEclipseResultDefinition::FlowTracerSelectionType::FLOW_TR_BY_SELECTION );
@ -667,7 +667,6 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
if ( m_cellFilter() == RigFlowDiagResults::CELLS_VISIBLE ) if ( m_cellFilter() == RigFlowDiagResults::CELLS_VISIBLE )
{ {
cvf::UByteArray visibleCells; cvf::UByteArray visibleCells;
m_case()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
if ( m_cellFilterView ) if ( m_cellFilterView )
{ {

View File

@ -318,12 +318,9 @@ void RimGeoMechView::onCreateDisplayModel()
nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() ); nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
// Cross sections // Intersections
m_intersectionVizModel->removeAllParts(); appendIntersectionsToModel( cellFilterCollection()->hasActiveFilters(), propertyFilterCollection()->hasActiveDynamicFilters() );
m_intersectionCollection->rebuildGeometry();
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
// Seismic sections // Seismic sections
@ -480,13 +477,14 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
m_vizLogic->updateStaticCellColors( m_currentTimeStep() ); m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
// Intersections // Intersections
if ( intersectionCollection()->shouldApplyCellFiltersToIntersections() && propertyFilterCollection()->hasActiveDynamicFilters() )
{ {
m_intersectionVizModel->removeAllParts(); m_intersectionCollection->clearGeometry();
m_intersectionCollection->rebuildGeometry(); appendIntersectionsForCurrentTimeStep();
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
} }
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
if ( m_surfaceCollection ) if ( m_surfaceCollection )
{ {
m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep ); m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
@ -1133,3 +1131,12 @@ void RimGeoMechView::resetVizLogic()
m_vizLogic->resetPartMgrs(); m_vizLogic->resetPartMgrs();
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int viewerTimeStep )
{
CAF_ASSERT( m_vizLogic.notNull() );
m_vizLogic->calculateCellVisibility( visibility, geomTypes, viewerTimeStep );
}

View File

@ -128,6 +128,8 @@ protected:
RimPropertyFilterCollection* nativePropertyFilterCollection(); RimPropertyFilterCollection* nativePropertyFilterCollection();
void calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int timeStep = 0 ) override;
private: private:
QString createAutoName() const override; QString createAutoName() const override;

View File

@ -267,7 +267,7 @@ void RimBoxIntersection::appendManipulatorPartsToModel( cvf::ModelBasicList* mod
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimBoxIntersection::rebuildGeometry() void RimBoxIntersection::clearGeometry()
{ {
m_intersectionBoxPartMgr = nullptr; m_intersectionBoxPartMgr = nullptr;
} }

View File

@ -73,7 +73,7 @@ public:
RivBoxIntersectionPartMgr* intersectionBoxPartMgr(); RivBoxIntersectionPartMgr* intersectionBoxPartMgr();
void appendManipulatorPartsToModel( cvf::ModelBasicList* model ); void appendManipulatorPartsToModel( cvf::ModelBasicList* model );
void rebuildGeometry(); void clearGeometry();
void setToDefaultSizeBox(); void setToDefaultSizeBox();
void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position ); void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position );

View File

@ -844,7 +844,7 @@ RivExtrudedCurveIntersectionPartMgr* RimExtrudedCurveIntersection::intersectionP
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimExtrudedCurveIntersection::rebuildGeometry() void RimExtrudedCurveIntersection::clearGeometry()
{ {
m_crossSectionPartMgr = nullptr; m_crossSectionPartMgr = nullptr;
} }

View File

@ -109,7 +109,7 @@ public:
Rim2dIntersectionView* correspondingIntersectionView() const; Rim2dIntersectionView* correspondingIntersectionView() const;
RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr(); RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr();
void rebuildGeometry(); void clearGeometry();
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override; const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
std::vector<cvf::Vec3d> polyLinesForExtrusionDirection() const; std::vector<cvf::Vec3d> polyLinesForExtrusionDirection() const;

View File

@ -42,6 +42,7 @@
#include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiDoubleSliderEditor.h" #include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiTreeOrdering.h" #include "cafPdmUiTreeOrdering.h"
#include "cvfModelBasicList.h" #include "cvfModelBasicList.h"
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "IntersectionCollection", "CrossSectionCollection" ); CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "IntersectionCollection", "CrossSectionCollection" );
@ -59,8 +60,8 @@ RimIntersectionCollection::RimIntersectionCollection()
CAF_PDM_InitFieldNoDefault( &m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes" ); CAF_PDM_InitFieldNoDefault( &m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes" );
m_intersectionBoxes.uiCapability()->setUiTreeHidden( true ); m_intersectionBoxes.uiCapability()->setUiTreeHidden( true );
CAF_PDM_InitField( &isActive, "Active", true, "Active" ); CAF_PDM_InitField( &m_isActive, "Active", true, "Active" );
isActive.uiCapability()->setUiHidden( true ); m_isActive.uiCapability()->setUiHidden( true );
CAF_PDM_InitFieldNoDefault( &m_depthUpperThreshold, "UpperDepthThreshold", "Upper Threshold" ); CAF_PDM_InitFieldNoDefault( &m_depthUpperThreshold, "UpperDepthThreshold", "Upper Threshold" );
m_depthUpperThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); m_depthUpperThreshold.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
@ -75,6 +76,8 @@ RimIntersectionCollection::RimIntersectionCollection()
CAF_PDM_InitField( &m_kFilterOverridden, "OverrideKFilter", false, "Override K Range Filter" ); CAF_PDM_InitField( &m_kFilterOverridden, "OverrideKFilter", false, "Override K Range Filter" );
CAF_PDM_InitFieldNoDefault( &m_kFilterStr, "KRangeFilter", "K Range Filter", "", "Example: 2,4-6,10-30:2", "" ); CAF_PDM_InitFieldNoDefault( &m_kFilterStr, "KRangeFilter", "K Range Filter", "", "Example: 2,4-6,10-30:2", "" );
CAF_PDM_InitField( &m_applyCellFilters, "ApplyCellFilters", true, "Use Cell Filters" );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -91,7 +94,15 @@ RimIntersectionCollection::~RimIntersectionCollection()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimIntersectionCollection::objectToggleField() caf::PdmFieldHandle* RimIntersectionCollection::objectToggleField()
{ {
return &isActive; return &m_isActive;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionCollection::isActive() const
{
return m_isActive();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -209,9 +220,36 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelB
{ {
if ( cs->isActive() ) if ( cs->isActive() )
{ {
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
}
}
for ( RimBoxIntersection* cs : m_intersectionBoxes )
{
if ( cs->isActive() && cs->show3dManipulator() )
{
cs->appendManipulatorPartsToModel( model );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::appendDynamicPartsToModel( cvf::ModelBasicList* model,
cvf::Transform* scaleTransform,
size_t timeStepIndex,
cvf::UByteArray* visibleCells )
{
if ( !isActive() ) return;
for ( RimExtrudedCurveIntersection* cs : m_intersections )
{
if ( cs->isActive() )
{
cs->intersectionPartMgr()->generatePartGeometry( visibleCells );
cs->intersectionPartMgr()->appendIntersectionFacesToModel( model, scaleTransform ); cs->intersectionPartMgr()->appendIntersectionFacesToModel( model, scaleTransform );
cs->intersectionPartMgr()->appendMeshLinePartsToModel( model, scaleTransform ); cs->intersectionPartMgr()->appendMeshLinePartsToModel( model, scaleTransform );
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
} }
} }
@ -219,32 +257,26 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelB
{ {
if ( cs->isActive() ) if ( cs->isActive() )
{ {
cs->intersectionBoxPartMgr()->generatePartGeometry( visibleCells );
cs->intersectionBoxPartMgr()->appendNativeIntersectionFacesToModel( model, scaleTransform ); cs->intersectionBoxPartMgr()->appendNativeIntersectionFacesToModel( model, scaleTransform );
cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel( model, scaleTransform ); cs->intersectionBoxPartMgr()->appendMeshLinePartsToModel( model, scaleTransform );
if ( cs->show3dManipulator() )
{
cs->appendManipulatorPartsToModel( model );
} }
} }
} }
model->updateBoundingBoxesRecursive();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::rebuildGeometry() void RimIntersectionCollection::clearGeometry()
{ {
for ( RimExtrudedCurveIntersection* intersection : m_intersections ) for ( RimExtrudedCurveIntersection* intersection : m_intersections )
{ {
intersection->rebuildGeometry(); intersection->clearGeometry();
} }
for ( RimBoxIntersection* intersectionBox : m_intersectionBoxes ) for ( RimBoxIntersection* intersectionBox : m_intersectionBoxes )
{ {
intersectionBox->rebuildGeometry(); intersectionBox->clearGeometry();
} }
} }
@ -354,12 +386,12 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
{ {
bool rebuildView = false; bool rebuildView = false;
if ( changedField == &isActive ) if ( changedField == &m_isActive )
{ {
updateUiIconFromToggleField(); updateUiIconFromToggleField();
rebuildView = true; rebuildView = true;
} }
if ( changedField == &m_depthThresholdOverridden ) else if ( changedField == &m_depthThresholdOverridden )
{ {
for ( RimExtrudedCurveIntersection* cs : m_intersections ) for ( RimExtrudedCurveIntersection* cs : m_intersections )
{ {
@ -372,8 +404,8 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
} }
rebuildView = true; rebuildView = true;
} }
else if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) ||
if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) || ( changedField == &m_depthFilterType ) ) ( changedField == &m_depthFilterType ) )
{ {
for ( RimExtrudedCurveIntersection* cs : m_intersections ) for ( RimExtrudedCurveIntersection* cs : m_intersections )
{ {
@ -382,8 +414,7 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
} }
rebuildView = true; rebuildView = true;
} }
else if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
{ {
for ( RimExtrudedCurveIntersection* cs : m_intersections ) for ( RimExtrudedCurveIntersection* cs : m_intersections )
{ {
@ -392,6 +423,10 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
} }
rebuildView = true; rebuildView = true;
} }
else if ( changedField == &m_applyCellFilters )
{
rebuildView = true;
}
if ( rebuildView ) if ( rebuildView )
{ {
@ -452,7 +487,11 @@ void RimIntersectionCollection::updateIntersectionBoxGeometry()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{ {
caf::PdmUiGroup* genGroup = uiOrdering.addNewGroup( "General" );
genGroup->add( &m_applyCellFilters );
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" ); caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "Depth Filter - Curve Intersections" );
filterGroup->setCollapsedByDefault();
m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() ); m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() ); m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
@ -486,12 +525,13 @@ void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::Pdm
} }
if ( eclipseView() ) if ( eclipseView() )
{ {
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup( "K Filter - Curve Intersections" ); caf::PdmUiGroup* kfilterGroup = uiOrdering.addNewGroup( "K Filter - Curve Intersections" );
kfilterGroup->setCollapsedByDefault();
m_kFilterStr.uiCapability()->setUiReadOnly( !m_kFilterOverridden() ); m_kFilterStr.uiCapability()->setUiReadOnly( !m_kFilterOverridden() );
filterGroup->add( &m_kFilterOverridden ); kfilterGroup->add( &m_kFilterOverridden );
filterGroup->add( &m_kFilterStr ); kfilterGroup->add( &m_kFilterStr );
} }
uiOrdering.skipRemainingFields( true ); uiOrdering.skipRemainingFields( true );
@ -539,3 +579,11 @@ void RimIntersectionCollection::rebuild3dView() const
rimView->scheduleCreateDisplayModelAndRedraw(); rimView->scheduleCreateDisplayModelAndRedraw();
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimIntersectionCollection::shouldApplyCellFiltersToIntersections() const
{
return m_applyCellFilters();
}

View File

@ -23,6 +23,8 @@
#include "cafPdmField.h" #include "cafPdmField.h"
#include "cafPdmObject.h" #include "cafPdmObject.h"
#include "cvfArray.h"
#include "RimIntersectionEnums.h" #include "RimIntersectionEnums.h"
class Rim3dView; class Rim3dView;
@ -53,8 +55,6 @@ public:
RimIntersectionCollection(); RimIntersectionCollection();
~RimIntersectionCollection() override; ~RimIntersectionCollection() override;
caf::PdmField<bool> isActive;
void appendIntersectionAndUpdate( RimExtrudedCurveIntersection* intersection, bool allowActiveViewChange = true ); void appendIntersectionAndUpdate( RimExtrudedCurveIntersection* intersection, bool allowActiveViewChange = true );
void appendIntersectionNoUpdate( RimExtrudedCurveIntersection* intersection ); void appendIntersectionNoUpdate( RimExtrudedCurveIntersection* intersection );
@ -70,12 +70,18 @@ public:
void scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); void scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
void recomputeSimWellBranchData(); void recomputeSimWellBranchData();
bool shouldApplyCellFiltersToIntersections() const;
// Visualization interface // Visualization interface
void applySingleColorEffect(); void applySingleColorEffect();
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex ); void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform ); void appendPartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void rebuildGeometry(); void appendDynamicPartsToModel( cvf::ModelBasicList* model,
cvf::Transform* scaleTransform,
size_t timeStepIndex,
cvf::UByteArray* visibleCells = nullptr );
void clearGeometry();
std::vector<RimExtrudedCurveIntersection*> intersections() const; std::vector<RimExtrudedCurveIntersection*> intersections() const;
std::vector<RimBoxIntersection*> intersectionBoxes() const; std::vector<RimBoxIntersection*> intersectionBoxes() const;
@ -84,6 +90,8 @@ public:
void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override; void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override;
bool isActive() const;
protected: protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
caf::PdmFieldHandle* objectToggleField() override; caf::PdmFieldHandle* objectToggleField() override;
@ -96,6 +104,8 @@ private:
RimEclipseView* eclipseView() const; RimEclipseView* eclipseView() const;
void rebuild3dView() const; void rebuild3dView() const;
caf::PdmField<bool> m_isActive;
caf::PdmChildArrayField<RimExtrudedCurveIntersection*> m_intersections; caf::PdmChildArrayField<RimExtrudedCurveIntersection*> m_intersections;
caf::PdmChildArrayField<RimBoxIntersection*> m_intersectionBoxes; caf::PdmChildArrayField<RimBoxIntersection*> m_intersectionBoxes;
@ -104,6 +114,8 @@ private:
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_applyCellFilters;
caf::PdmField<bool> m_kFilterOverridden; caf::PdmField<bool> m_kFilterOverridden;
caf::PdmField<QString> m_kFilterStr; caf::PdmField<QString> m_kFilterStr;
}; };

View File

@ -539,6 +539,7 @@ void Rim2dIntersectionView::onCreateDisplayModel()
m_intersectionVizModel->removeAllParts(); m_intersectionVizModel->removeAllParts();
m_flatIntersectionPartMgr->generatePartGeometry( nullptr );
m_flatIntersectionPartMgr->appendIntersectionFacesToModel( m_intersectionVizModel.p(), scaleTransform() ); m_flatIntersectionPartMgr->appendIntersectionFacesToModel( m_intersectionVizModel.p(), scaleTransform() );
m_flatIntersectionPartMgr->appendMeshLinePartsToModel( m_intersectionVizModel.p(), scaleTransform() ); m_flatIntersectionPartMgr->appendMeshLinePartsToModel( m_intersectionVizModel.p(), scaleTransform() );
m_flatIntersectionPartMgr->appendPolylinePartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() ); m_flatIntersectionPartMgr->appendPolylinePartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );

View File

@ -150,9 +150,6 @@ Rim3dView::Rim3dView()
CAF_PDM_InitFieldNoDefault( &m_fontSize, "FontSize", "Font Size" ); CAF_PDM_InitFieldNoDefault( &m_fontSize, "FontSize", "Font Size" );
m_intersectionVizModel = new cvf::ModelBasicList;
m_intersectionVizModel->setName( "CrossSectionModel" );
m_seismicVizModel = new cvf::ModelBasicList; m_seismicVizModel = new cvf::ModelBasicList;
m_seismicVizModel->setName( "SeismicSectionModel" ); m_seismicVizModel->setName( "SeismicSectionModel" );

View File

@ -257,7 +257,6 @@ protected:
// 3D display model data // 3D display model data
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel; cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
cvf::ref<cvf::ModelBasicList> m_seismicVizModel; cvf::ref<cvf::ModelBasicList> m_seismicVizModel;
cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager; cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager;

View File

@ -312,7 +312,7 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
} }
auto prefs = RiaPreferences::current(); auto prefs = RiaPreferences::current();
rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault(); rimEclipseView->faultCollection()->setActive( prefs->enableFaultsByDefault() );
rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" ); rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" );
rimEclipseView->cellEdgeResult()->setActive( false ); rimEclipseView->cellEdgeResult()->setActive( false );

View File

@ -291,9 +291,9 @@ void RimEclipseContourMapView::updateGeometry()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::setFaultVisParameters() void RimEclipseContourMapView::setFaultVisParameters()
{ {
faultCollection()->setShowFaultsOutsideFilter( false ); faultCollection()->setShouldApplyCellFiltersToFaults( true );
faultCollection()->showOppositeFaultFaces = true; faultCollection()->setShowOppositeFaultFaces( true );
faultCollection()->faultResult = RimFaultInViewCollection::FAULT_NO_FACE_CULLING; faultCollection()->setFaultResult( RimFaultInViewCollection::FAULT_NO_FACE_CULLING );
faultResultSettings()->showCustomFaultResult = true; faultResultSettings()->showCustomFaultResult = true;
faultResultSettings()->customFaultResult()->setResultVariable( "None" ); faultResultSettings()->customFaultResult()->setResultVariable( "None" );
} }
@ -507,7 +507,7 @@ std::set<RivCellSetEnum> RimEclipseContourMapView::allVisibleFaultGeometryTypes(
{ {
std::set<RivCellSetEnum> faultGeoTypes; std::set<RivCellSetEnum> faultGeoTypes;
// Normal eclipse views always shows faults for active and visible eclipse cells. // Normal eclipse views always shows faults for active and visible eclipse cells.
if ( faultCollection()->showFaultCollection() ) if ( faultCollection()->isActive() )
{ {
faultGeoTypes = RimEclipseView::allVisibleFaultGeometryTypes(); faultGeoTypes = RimEclipseView::allVisibleFaultGeometryTypes();
} }

View File

@ -439,6 +439,9 @@ void RimEclipseView::onCreateDisplayModel()
if ( !( m_eclipseCase && m_eclipseCase->eclipseCaseData() ) ) return; if ( !( m_eclipseCase && m_eclipseCase->eclipseCaseData() ) ) return;
const bool cellFiltersActive = cellFilterCollection()->hasActiveFilters();
const bool propertyFiltersActive = eclipsePropertyFilterCollection()->hasActiveFilters();
// Define a vector containing time step indices to produce geometry for. // Define a vector containing time step indices to produce geometry for.
// First entry in this vector is used to define the geometry only result mode with no results. // First entry in this vector is used to define the geometry only result mode with no results.
std::vector<size_t> timeStepIndices; std::vector<size_t> timeStepIndices;
@ -458,9 +461,9 @@ void RimEclipseView::onCreateDisplayModel()
timeStepIndices.push_back( i ); timeStepIndices.push_back( i );
} }
} }
else if ( this->cellResult()->hasStaticResult() || this->cellEdgeResult()->hasResult() || else if ( cellResult()->hasStaticResult() || cellEdgeResult()->hasResult() || propertyFiltersActive ||
this->eclipsePropertyFilterCollection()->hasActiveFilters() || this->intersectionCollection()->hasAnyActiveSeparateResults() || intersectionCollection()->hasAnyActiveSeparateResults() ||
( this->surfaceInViewCollection() && this->surfaceInViewCollection()->hasAnyActiveSeparateResults() ) ) ( surfaceInViewCollection() && surfaceInViewCollection()->hasAnyActiveSeparateResults() ) )
{ {
// The one and only static result entry // The one and only static result entry
timeStepIndices.push_back( 0 ); timeStepIndices.push_back( 0 );
@ -480,7 +483,7 @@ void RimEclipseView::onCreateDisplayModel()
wellCollection()->scheduleIsWellPipesVisibleRecalculation(); wellCollection()->scheduleIsWellPipesVisibleRecalculation();
// Create vector of grid indices to render // Create vector of grid indices to render
std::vector<size_t> gridIndices = this->indicesToVisibleGrids(); std::vector<size_t> gridIndices = indicesToVisibleGrids();
/// ///
// Get or create the parts for "static" type geometry. The same geometry is used // Get or create the parts for "static" type geometry. The same geometry is used
@ -488,36 +491,35 @@ void RimEclipseView::onCreateDisplayModel()
// For property filtered geometry : just set all the models as empty scenes // For property filtered geometry : just set all the models as empty scenes
// updateCurrentTimeStep requests the actual parts // updateCurrentTimeStep requests the actual parts
if ( !this->eclipsePropertyFilterCollection()->hasActiveFilters() || if ( !propertyFiltersActive || ( viewController() && viewController()->isVisibleCellsOveridden() ) )
( this->viewController() && this->viewController()->isVisibleCellsOveridden() ) )
{ {
std::vector<RivCellSetEnum> geometryTypesToAdd; std::vector<RivCellSetEnum> geometryTypesToAdd;
if ( this->viewController() && this->viewController()->isVisibleCellsOveridden() ) if ( viewController() && viewController()->isVisibleCellsOveridden() )
{ {
geometryTypesToAdd.push_back( OVERRIDDEN_CELL_VISIBILITY ); geometryTypesToAdd.push_back( OVERRIDDEN_CELL_VISIBILITY );
} }
else if ( this->cellFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells() ) else if ( cellFiltersActive && wellCollection()->hasVisibleWellCells() )
{ {
geometryTypesToAdd.push_back( RANGE_FILTERED ); geometryTypesToAdd.push_back( RANGE_FILTERED );
geometryTypesToAdd.push_back( RANGE_FILTERED_WELL_CELLS ); geometryTypesToAdd.push_back( RANGE_FILTERED_WELL_CELLS );
geometryTypesToAdd.push_back( VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER ); geometryTypesToAdd.push_back( VISIBLE_WELL_CELLS_OUTSIDE_RANGE_FILTER );
geometryTypesToAdd.push_back( VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER ); geometryTypesToAdd.push_back( VISIBLE_WELL_FENCE_CELLS_OUTSIDE_RANGE_FILTER );
if ( this->showInactiveCells() ) if ( showInactiveCells() )
{ {
geometryTypesToAdd.push_back( RANGE_FILTERED_INACTIVE ); geometryTypesToAdd.push_back( RANGE_FILTERED_INACTIVE );
} }
} }
else if ( !this->cellFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells() ) else if ( !cellFiltersActive && wellCollection()->hasVisibleWellCells() )
{ {
geometryTypesToAdd.push_back( VISIBLE_WELL_CELLS ); geometryTypesToAdd.push_back( VISIBLE_WELL_CELLS );
geometryTypesToAdd.push_back( VISIBLE_WELL_FENCE_CELLS ); geometryTypesToAdd.push_back( VISIBLE_WELL_FENCE_CELLS );
} }
else if ( this->cellFilterCollection()->hasActiveFilters() && !this->wellCollection()->hasVisibleWellCells() ) else if ( cellFiltersActive && !wellCollection()->hasVisibleWellCells() )
{ {
geometryTypesToAdd.push_back( RANGE_FILTERED ); geometryTypesToAdd.push_back( RANGE_FILTERED );
geometryTypesToAdd.push_back( RANGE_FILTERED_WELL_CELLS ); geometryTypesToAdd.push_back( RANGE_FILTERED_WELL_CELLS );
if ( this->showInactiveCells() ) if ( showInactiveCells() )
{ {
geometryTypesToAdd.push_back( RANGE_FILTERED_INACTIVE ); geometryTypesToAdd.push_back( RANGE_FILTERED_INACTIVE );
} }
@ -527,7 +529,7 @@ void RimEclipseView::onCreateDisplayModel()
geometryTypesToAdd.push_back( ALL_WELL_CELLS ); // Should be all well cells geometryTypesToAdd.push_back( ALL_WELL_CELLS ); // Should be all well cells
geometryTypesToAdd.push_back( ACTIVE ); geometryTypesToAdd.push_back( ACTIVE );
if ( this->showInactiveCells() ) if ( showInactiveCells() )
{ {
geometryTypesToAdd.push_back( INACTIVE ); geometryTypesToAdd.push_back( INACTIVE );
} }
@ -555,7 +557,7 @@ void RimEclipseView::onCreateDisplayModel()
} }
} }
// Set static colors // Set static colors
this->onUpdateStaticCellColors(); onUpdateStaticCellColors();
} }
else else
{ {
@ -565,14 +567,14 @@ void RimEclipseView::onCreateDisplayModel()
m_reservoirGridPartManager->clearWatertightGeometryFlags(); m_reservoirGridPartManager->clearWatertightGeometryFlags();
if ( faultCollection()->showFaultCollection() || !this->eclipsePropertyFilterCollection()->hasActiveFilters() ) if ( faultCollection()->isActive() || !propertyFiltersActive )
{ {
setVisibleGridPartsWatertight(); setVisibleGridPartsWatertight();
std::set<RivCellSetEnum> faultGeometryTypesToAppend = allVisibleFaultGeometryTypes(); std::set<RivCellSetEnum> faultGeometryTypesToAppend = allVisibleFaultGeometryTypes();
RivCellSetEnum faultLabelType = RivCellSetEnum faultLabelType =
m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend, m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend,
faultCollection()->isShowingFaultsAndFaultsOutsideFilters() ); !faultCollection()->shouldApplyCellFiltersToFaults() );
for ( size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx ) for ( size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx )
{ {
@ -587,22 +589,16 @@ void RimEclipseView::onCreateDisplayModel()
} }
} }
// Cross sections // Intersections
appendIntersectionsToModel( cellFiltersActive, propertyFiltersActive );
m_intersectionVizModel->removeAllParts();
m_intersectionCollection->rebuildGeometry();
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), m_reservoirGridPartManager->scaleTransform() );
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
// Seismic sections // Seismic sections
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform(); cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform();
m_seismicVizModel->removeAllParts(); m_seismicVizModel->removeAllParts();
m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), ownerCase()->allCellsBoundingBox() ); m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), ownerCase()->allCellsBoundingBox() );
nativeOrOverrideViewer()->addStaticModelOnce( m_seismicVizModel.p(), isUsingOverrideViewer() ); nativeOrOverrideViewer()->addStaticModelOnce( m_seismicVizModel.p(), isUsingOverrideViewer() );
// Surfaces // Surfaces
m_surfaceVizModel->removeAllParts(); m_surfaceVizModel->removeAllParts();
if ( surfaceInViewCollection() ) if ( surfaceInViewCollection() )
{ {
@ -611,7 +607,6 @@ void RimEclipseView::onCreateDisplayModel()
} }
// Well path model // Well path model
m_wellPathPipeVizModel->removeAllParts(); m_wellPathPipeVizModel->removeAllParts();
// NB! StimPlan legend colors must be updated before well path geometry is added to the model // NB! StimPlan legend colors must be updated before well path geometry is added to the model
@ -659,7 +654,7 @@ void RimEclipseView::onCreateDisplayModel()
updateFaultColors(); updateFaultColors();
} }
std::vector<RimFlowCharacteristicsPlot*> characteristicsPlots = this->objectsWithReferringPtrFieldsOfType<RimFlowCharacteristicsPlot>(); std::vector<RimFlowCharacteristicsPlot*> characteristicsPlots = objectsWithReferringPtrFieldsOfType<RimFlowCharacteristicsPlot>();
for ( auto plot : characteristicsPlots ) for ( auto plot : characteristicsPlots )
{ {
if ( plot != nullptr ) if ( plot != nullptr )
@ -711,8 +706,6 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
{ {
clearReservoirCellVisibilities(); clearReservoirCellVisibilities();
// m_surfaceCollection->clearGeometry();
m_propertyFilterCollection()->updateFromCurrentTimeStep(); m_propertyFilterCollection()->updateFromCurrentTimeStep();
m_streamlineCollection()->updateFromCurrentTimeStep( currentTimeStep() ); m_streamlineCollection()->updateFromCurrentTimeStep( currentTimeStep() );
@ -720,6 +713,12 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
onUpdateLegends(); // To make sure the scalar mappers are set up correctly onUpdateLegends(); // To make sure the scalar mappers are set up correctly
if ( intersectionCollection()->shouldApplyCellFiltersToIntersections() && eclipsePropertyFilterCollection()->hasActiveFilters() )
{
m_intersectionCollection->clearGeometry();
appendIntersectionsForCurrentTimeStep();
}
updateVisibleCellColors(); updateVisibleCellColors();
wellCollection()->scaleWellDisks(); wellCollection()->scaleWellDisks();
@ -787,7 +786,7 @@ void RimEclipseView::updateVisibleGeometries()
RivCellSetEnum faultLabelType = RivCellSetEnum faultLabelType =
m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend, m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend,
faultCollection()->isShowingFaultsAndFaultsOutsideFilters() ); !faultCollection()->shouldApplyCellFiltersToFaults() );
if ( faultLabelType == PROPERTY_FILTERED ) if ( faultLabelType == PROPERTY_FILTERED )
{ {
m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel( frameParts.p(), faultLabelType, m_currentTimeStep ); m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel( frameParts.p(), faultLabelType, m_currentTimeStep );
@ -810,7 +809,7 @@ void RimEclipseView::updateVisibleGeometries()
{ {
m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE, gridIndices ); m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE, gridIndices );
if ( !faultCollection()->isShowingFaultsAndFaultsOutsideFilters() ) if ( faultCollection()->shouldApplyCellFiltersToFaults() )
{ {
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE ); m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE );
} }
@ -819,7 +818,7 @@ void RimEclipseView::updateVisibleGeometries()
{ {
m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), INACTIVE, gridIndices ); m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), INACTIVE, gridIndices );
if ( !faultCollection()->isShowingFaultsAndFaultsOutsideFilters() ) if ( faultCollection()->shouldApplyCellFiltersToFaults() )
{ {
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), INACTIVE ); m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), INACTIVE );
} }
@ -1934,7 +1933,7 @@ std::set<RivCellSetEnum> RimEclipseView::allVisibleFaultGeometryTypes() const
std::set<RivCellSetEnum> faultGeoTypes; std::set<RivCellSetEnum> faultGeoTypes;
faultGeoTypes.insert( m_visibleGridParts.begin(), m_visibleGridParts.end() ); faultGeoTypes.insert( m_visibleGridParts.begin(), m_visibleGridParts.end() );
if ( faultCollection()->isShowingFaultsAndFaultsOutsideFilters() ) if ( !faultCollection()->shouldApplyCellFiltersToFaults() )
{ {
faultGeoTypes.insert( ACTIVE ); faultGeoTypes.insert( ACTIVE );
faultGeoTypes.insert( ALL_WELL_CELLS ); faultGeoTypes.insert( ALL_WELL_CELLS );
@ -2208,6 +2207,37 @@ void RimEclipseView::calculateCurrentTotalCellVisibility( cvf::UByteArray* total
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int timeStep )
{
size_t cellCount = this->mainGrid()->globalCellArray().size();
visibility->resize( cellCount );
visibility->setAll( false );
std::vector<size_t> gridIndices = this->indicesToVisibleGrids();
const auto gridCount = this->eclipseCase()->eclipseCaseData()->gridCount();
for ( size_t gridIdx = 0; gridIdx < gridCount; gridIdx++ )
{
RigGridBase* grid = this->eclipseCase()->eclipseCaseData()->grid( gridIdx );
int gridCellCount = static_cast<int>( grid->cellCount() );
for ( auto vizType : geomTypes )
{
const cvf::UByteArray* gridVisibility = m_reservoirGridPartManager->cellVisibility( vizType, gridIdx, timeStep );
for ( int lcIdx = 0; lcIdx < gridCellCount; ++lcIdx )
{
( *visibility )[grid->reservoirCellIndex( lcIdx )] |= ( *gridVisibility )[lcIdx];
}
}
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -155,6 +155,8 @@ public:
void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) override; void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) override;
void calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int timeStep = 0 ) override;
std::vector<RimLegendConfig*> legendConfigs() const override; std::vector<RimLegendConfig*> legendConfigs() const override;
cvf::Color4f colorFromCellCategory( RivCellSetEnum geometryType ) const; cvf::Color4f colorFromCellCategory( RivCellSetEnum geometryType ) const;

View File

@ -46,6 +46,7 @@
#include "Riu3DMainWindowTools.h" #include "Riu3DMainWindowTools.h"
#include "Riu3dSelectionManager.h" #include "Riu3dSelectionManager.h"
#include "RiuMainWindow.h" #include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RivSingleCellPartGenerator.h" #include "RivSingleCellPartGenerator.h"
@ -112,6 +113,9 @@ RimGridView::RimGridView()
m_surfaceVizModel = new cvf::ModelBasicList; m_surfaceVizModel = new cvf::ModelBasicList;
m_surfaceVizModel->setName( "SurfaceModel" ); m_surfaceVizModel->setName( "SurfaceModel" );
m_intersectionVizModel = new cvf::ModelBasicList;
m_intersectionVizModel->setName( "CrossSectionModel" );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -493,3 +497,63 @@ void RimGridView::updateSurfacesInViewTreeItems()
this->updateConnectedEditors(); this->updateConnectedEditors();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridView::appendIntersectionsForCurrentTimeStep()
{
if ( nativeOrOverrideViewer() )
{
cvf::Scene* frameScene = nativeOrOverrideViewer()->frame( m_currentTimeStep, isUsingOverrideViewer() );
if ( frameScene )
{
cvf::String name = "IntersectionDynamicModel";
Rim3dView::removeModelByName( frameScene, name );
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName( name );
cvf::UByteArray visibility;
calculateCellVisibility( &visibility, { PROPERTY_FILTERED, PROPERTY_FILTERED_WELL_CELLS }, m_currentTimeStep );
m_intersectionCollection->appendDynamicPartsToModel( frameParts.p(), scaleTransform(), m_currentTimeStep, &visibility );
frameParts->updateBoundingBoxesRecursive();
frameScene->addModel( frameParts.p() );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridView::appendIntersectionsToModel( bool cellFiltersActive, bool propertyFiltersActive )
{
m_intersectionVizModel->removeAllParts();
if ( m_intersectionCollection->isActive() )
{
m_intersectionCollection->clearGeometry();
if ( m_intersectionCollection->shouldApplyCellFiltersToIntersections() && ( cellFiltersActive || propertyFiltersActive ) )
{
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
if ( !propertyFiltersActive )
{
cvf::UByteArray visibleCells;
calculateCellVisibility( &visibleCells, { RANGE_FILTERED_WELL_CELLS, RANGE_FILTERED } );
m_intersectionCollection->appendDynamicPartsToModel( m_intersectionVizModel.p(), scaleTransform(), currentTimeStep(), &visibleCells );
}
}
else
{
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
m_intersectionCollection->appendDynamicPartsToModel( m_intersectionVizModel.p(), scaleTransform(), currentTimeStep() );
}
m_intersectionVizModel->updateBoundingBoxesRecursive();
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
}
}

View File

@ -84,8 +84,14 @@ protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void initAfterRead() override; void initAfterRead() override;
void appendIntersectionsForCurrentTimeStep();
void appendIntersectionsToModel( bool cellFiltersActive, bool propertyFiltersActive );
virtual void calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int timeStep = 0 ) = 0;
protected: protected:
cvf::ref<cvf::ModelBasicList> m_surfaceVizModel; cvf::ref<cvf::ModelBasicList> m_surfaceVizModel;
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
// Fields // Fields
caf::PdmChildField<RimIntersectionCollection*> m_intersectionCollection; caf::PdmChildField<RimIntersectionCollection*> m_intersectionCollection;

View File

@ -146,7 +146,7 @@ std::set<int> RigVisibleCategoriesCalculator::visibleCategories( RimEclipseView*
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::set<size_t> RigVisibleCategoriesCalculator::visibleNncConnectionIndices( RimEclipseView* eclView ) std::set<size_t> RigVisibleCategoriesCalculator::visibleNncConnectionIndices( RimEclipseView* eclView )
{ {
if ( !eclView->faultCollection() || !eclView->faultCollection()->showFaultCollection ) return {}; if ( !eclView->faultCollection() || !eclView->faultCollection()->isActive() ) return {};
std::set<size_t> visibleConnectionIndices; std::set<size_t> visibleConnectionIndices;
@ -173,8 +173,7 @@ std::set<size_t> RigVisibleCategoriesCalculator::visibleNncConnectionIndices( Ri
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RigVisibleCategoriesCalculator::appendVisibleFaultCells( RimEclipseView* eclView, std::set<size_t>& visibleCells ) void RigVisibleCategoriesCalculator::appendVisibleFaultCells( RimEclipseView* eclView, std::set<size_t>& visibleCells )
{ {
if ( eclView->faultCollection() && eclView->faultCollection()->showFaultCollection && if ( eclView->faultCollection() && eclView->faultCollection()->isActive() && !eclView->faultResultSettings()->showCustomFaultResult() )
!eclView->faultResultSettings()->showCustomFaultResult() )
{ {
for ( const auto& f : eclView->faultCollection()->faults() ) for ( const auto& f : eclView->faultCollection()->faults() )
{ {

View File

@ -1613,7 +1613,7 @@ void RiuMainWindow::slotToggleFaultLabelsAction( bool showLabels )
if ( !activeRiv ) return; if ( !activeRiv ) return;
activeRiv->faultCollection()->showFaultLabel.setValueWithFieldChanged( showLabels ); activeRiv->faultCollection()->setShowFaultLabelWithFieldChanged( showLabels );
refreshDrawStyleActions(); refreshDrawStyleActions();
} }