mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
parent
576156763a
commit
17f09878d2
@ -158,7 +158,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
|
||||
Riu3DMainWindowTools::setExpanded( propertyFilterCollection );
|
||||
|
||||
viewToModify->faultCollection()->showFaultCollection = false;
|
||||
viewToModify->faultCollection()->setActive( false );
|
||||
viewToModify->faultCollection()->updateConnectedEditors();
|
||||
|
||||
viewToModify->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
|
@ -242,8 +242,8 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMapFr
|
||||
contourMap->setBackgroundColor( RiaColorTools::fromQColorTo3f( col ) ); // Ignore original view background
|
||||
|
||||
contourMap->setDefaultCustomName();
|
||||
contourMap->faultCollection()->showFaultCollection = false;
|
||||
contourMap->wellCollection()->isActive = false;
|
||||
contourMap->faultCollection()->setActive( false );
|
||||
contourMap->wellCollection()->isActive = false;
|
||||
|
||||
// Set default values
|
||||
RimRegularLegendConfig* legendConfig = contourMap->cellResult()->legendConfig();
|
||||
@ -297,8 +297,8 @@ RimEclipseContourMapView* RicNewContourMapViewFeature::createEclipseContourMap(
|
||||
contourMap->contourMapProjection()->setSampleSpacingFactor( 1.2 );
|
||||
}
|
||||
|
||||
contourMap->faultCollection()->showFaultCollection = false;
|
||||
contourMap->wellCollection()->isActive = false;
|
||||
contourMap->faultCollection()->setActive( false );
|
||||
contourMap->wellCollection()->isActive = false;
|
||||
|
||||
eclipseCase->contourMapCollection()->push_back( contourMap );
|
||||
|
||||
|
@ -334,3 +334,55 @@ void RivGeoMechVizLogic::resetPartMgrs()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,10 @@ public:
|
||||
void updateStaticCellColors( int viewerStepIndex );
|
||||
void scheduleGeometryRegen( RivCellSetEnum geometryType );
|
||||
void scheduleGeometryRegenOfVisiblePartMgrs( int viewerStepIndex );
|
||||
|
||||
void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int viewerStepIndex );
|
||||
void calculateCellVisibility( cvf::UByteArray* totalVisibility, std::vector<RivCellSetEnum> geomTypes, int viewerStepIndex );
|
||||
|
||||
void resetPartMgrs();
|
||||
|
||||
std::vector<RivGeoMechPartMgrCache::Key> keysToVisiblePartMgrs( int viewerStepIndex ) const;
|
||||
|
@ -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() );
|
||||
|
||||
@ -244,7 +244,7 @@ RimBoxIntersection* RivBoxIntersectionGeometryGenerator::intersectionBox() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivBoxIntersectionGeometryGenerator::calculateArrays()
|
||||
void RivBoxIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* visibleCells )
|
||||
{
|
||||
if ( m_triangleVxes->size() ) return;
|
||||
|
||||
@ -310,6 +310,7 @@ void RivBoxIntersectionGeometryGenerator::calculateArrays()
|
||||
{
|
||||
size_t globalCellIdx = columnCellCandidates[cccIdx];
|
||||
|
||||
if ( ( visibleCells != nullptr ) && ( ( *visibleCells )[globalCellIdx] == 0 ) ) continue;
|
||||
if ( !m_hexGrid->useCell( globalCellIdx ) ) continue;
|
||||
|
||||
hexPlaneCutTriangleVxes.clear();
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
~RivBoxIntersectionGeometryGenerator() override;
|
||||
|
||||
// Generate geometry
|
||||
cvf::ref<cvf::DrawableGeo> generateSurface();
|
||||
cvf::ref<cvf::DrawableGeo> generateSurface( cvf::UByteArray* visibleCells );
|
||||
cvf::ref<cvf::DrawableGeo> createMeshDrawable();
|
||||
|
||||
RimBoxIntersection* intersectionBox() const;
|
||||
@ -60,7 +60,7 @@ public:
|
||||
const cvf::Vec3fArray* triangleVxes() const override;
|
||||
|
||||
private:
|
||||
void calculateArrays();
|
||||
void calculateArrays( cvf::UByteArray* visibleCells );
|
||||
|
||||
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
||||
|
||||
|
@ -96,12 +96,12 @@ void RivBoxIntersectionPartMgr::updateCellResultColor( int timeStepIndex )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivBoxIntersectionPartMgr::generatePartGeometry()
|
||||
void RivBoxIntersectionPartMgr::generatePartGeometry( cvf::UByteArray* visibleCells )
|
||||
{
|
||||
bool useBufferObjects = true;
|
||||
// Surface geometry
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_intersectionBoxGenerator->generateSurface();
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_intersectionBoxGenerator->generateSurface( visibleCells );
|
||||
if ( geo.notNull() )
|
||||
{
|
||||
geo->computeNormals();
|
||||
@ -187,11 +187,6 @@ void RivBoxIntersectionPartMgr::updatePartEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionBoxFaces.isNull() && m_intersectionBoxGridLines.isNull() )
|
||||
{
|
||||
generatePartGeometry();
|
||||
}
|
||||
|
||||
if ( m_intersectionBoxFaces.notNull() )
|
||||
{
|
||||
m_intersectionBoxFaces->setTransform( scaleTransform );
|
||||
@ -204,11 +199,6 @@ void RivBoxIntersectionPartMgr::appendNativeIntersectionFacesToModel( cvf::Model
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivBoxIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionBoxFaces.isNull() && m_intersectionBoxGridLines.isNull() )
|
||||
{
|
||||
generatePartGeometry();
|
||||
}
|
||||
|
||||
if ( m_intersectionBoxGridLines.notNull() )
|
||||
{
|
||||
m_intersectionBoxGridLines->setTransform( scaleTransform );
|
||||
|
@ -63,9 +63,10 @@ public:
|
||||
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const;
|
||||
|
||||
void generatePartGeometry( cvf::UByteArray* visibleCells );
|
||||
|
||||
private:
|
||||
void updatePartEffect();
|
||||
void generatePartGeometry();
|
||||
|
||||
private:
|
||||
RimBoxIntersection* m_rimIntersectionBox;
|
||||
|
@ -265,7 +265,7 @@ private:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* visibleCells )
|
||||
{
|
||||
if ( m_triangleVxes->size() ) return;
|
||||
|
||||
@ -386,6 +386,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
|
||||
for ( auto globalCellIdx : columnCellCandidates )
|
||||
{
|
||||
if ( ( visibleCells != nullptr ) && ( ( *visibleCells )[globalCellIdx] == 0 ) ) continue;
|
||||
if ( !m_hexGrid->useCell( globalCellIdx ) ) continue;
|
||||
|
||||
hexPlaneCutTriangleVxes.clear();
|
||||
@ -618,9 +619,9 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
/// 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() );
|
||||
|
||||
@ -781,7 +782,7 @@ const cvf::Vec3fArray* RivExtrudedCurveIntersectionGeometryGenerator::faultMeshV
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionGeometryGenerator::ensureGeometryIsCalculated()
|
||||
{
|
||||
calculateArrays();
|
||||
calculateArrays( nullptr );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
~RivExtrudedCurveIntersectionGeometryGenerator() override;
|
||||
|
||||
// Generate geometry
|
||||
cvf::ref<cvf::DrawableGeo> generateSurface();
|
||||
cvf::ref<cvf::DrawableGeo> generateSurface( cvf::UByteArray* visibleCells );
|
||||
cvf::ref<cvf::DrawableGeo> createMeshDrawable();
|
||||
cvf::ref<cvf::DrawableGeo> createFaultMeshDrawable();
|
||||
|
||||
@ -87,7 +87,7 @@ public:
|
||||
void ensureGeometryIsCalculated();
|
||||
|
||||
private:
|
||||
void calculateArrays();
|
||||
void calculateArrays( cvf::UByteArray* visibleCells );
|
||||
void calculateLineSegementTransforms();
|
||||
void calculateTransformedPolyline();
|
||||
void calculateSurfaceIntersectionPoints();
|
||||
|
@ -231,7 +231,7 @@ void RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMech
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry()
|
||||
void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry( cvf::UByteArray* visibleCells )
|
||||
{
|
||||
if ( m_intersectionGenerator.isNull() ) return;
|
||||
|
||||
@ -242,7 +242,7 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry()
|
||||
bool useBufferObjects = true;
|
||||
// Surface geometry
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_intersectionGenerator->generateSurface();
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_intersectionGenerator->generateSurface( visibleCells );
|
||||
if ( geo.notNull() )
|
||||
{
|
||||
geo->computeNormals();
|
||||
@ -772,11 +772,6 @@ cvf::ref<cvf::Part> RivExtrudedCurveIntersectionPartMgr::createCurvePart( const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionFaces.isNull() )
|
||||
{
|
||||
generatePartGeometry();
|
||||
}
|
||||
|
||||
if ( m_intersectionFaces.notNull() )
|
||||
{
|
||||
m_intersectionFaces->setTransform( scaleTransform );
|
||||
@ -789,11 +784,6 @@ void RivExtrudedCurveIntersectionPartMgr::appendIntersectionFacesToModel( cvf::M
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivExtrudedCurveIntersectionPartMgr::appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform )
|
||||
{
|
||||
if ( m_intersectionGridLines.isNull() )
|
||||
{
|
||||
generatePartGeometry();
|
||||
}
|
||||
|
||||
if ( m_intersectionGridLines.notNull() )
|
||||
{
|
||||
m_intersectionGridLines->setTransform( scaleTransform );
|
||||
@ -873,7 +863,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView&
|
||||
|
||||
for ( size_t i = 0; i < m_annotationParts.size(); i++ )
|
||||
{
|
||||
auto part = m_annotationParts[i];
|
||||
auto& part = m_annotationParts[i];
|
||||
if ( part.notNull() )
|
||||
{
|
||||
part->setTransform( scaleTransform );
|
||||
|
@ -20,13 +20,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "cvfArray.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfColor4.h"
|
||||
#include "cvfMatrix4.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
@ -81,8 +81,9 @@ public:
|
||||
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const;
|
||||
|
||||
void generatePartGeometry( cvf::UByteArray* visibleCells );
|
||||
|
||||
private:
|
||||
void generatePartGeometry();
|
||||
void createFaultLabelParts( const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors );
|
||||
void createPolyLineParts( bool useBufferObjects );
|
||||
void createExtrusionDirParts( bool useBufferObjects );
|
||||
|
@ -859,7 +859,7 @@ void RivFaultPartMgr::updateNNCColors( size_t timeStepIndex, RimEclipseCellColor
|
||||
|
||||
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
|
||||
caf::ScalarMapperEffectGenerator nncEffgen( mapper, caf::PO_NEG_LARGE );
|
||||
@ -901,7 +901,7 @@ void RivFaultPartMgr::updateNNCColors( size_t timeStepIndex, RimEclipseCellColor
|
||||
CVF_ASSERT( nncColor.isValid() );
|
||||
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
|
||||
caf::SurfaceEffectGenerator nncEffgen( nncColor, caf::PO_NEG_LARGE );
|
||||
|
@ -54,9 +54,9 @@ RivReservoirFaultsPartMgr::RivReservoirFaultsPartMgr( const RigMainGrid* grid, R
|
||||
RimFaultInViewCollection* faultCollection = reservoirView->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 );
|
||||
|
||||
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;
|
||||
|
||||
bool isShowingGrid = m_reservoirView->isMainGridVisible();
|
||||
if ( !faultCollection->showFaultCollection() && !isShowingGrid ) return;
|
||||
if ( !faultCollection->isActive() && !isShowingGrid ) return;
|
||||
|
||||
// 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
|
||||
bool forceDisplayOfFault = false;
|
||||
if ( !faultCollection->isShowingFaultsAndFaultsOutsideFilters() )
|
||||
if ( faultCollection->shouldApplyCellFiltersToFaults() )
|
||||
{
|
||||
forceDisplayOfFault = isShowingGrid;
|
||||
}
|
||||
@ -122,14 +122,13 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
|
||||
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() );
|
||||
|
||||
if ( ( faultCollection->showFaultCollection() && rimFault->showFault() ) || forceDisplayOfFault )
|
||||
if ( ( faultCollection->isActive() && rimFault->showFault() ) || forceDisplayOfFault )
|
||||
{
|
||||
if ( faultCollection->showFaultFaces() || forceDisplayOfFault )
|
||||
{
|
||||
@ -152,7 +151,7 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
RimEclipseFaultColors* faultResultColors = m_reservoirView->faultResultSettings();
|
||||
RimEclipseCellColors* cellResultColors = m_reservoirView->cellResult();
|
||||
|
||||
if ( rimFault->showFault() && faultCollection->showFaultCollection() )
|
||||
if ( rimFault->showFault() && faultCollection->isActive() )
|
||||
{
|
||||
if ( faultCollection->showNNCs() )
|
||||
{
|
||||
@ -190,7 +189,7 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
}
|
||||
}
|
||||
|
||||
if ( faultCollection->hideNncsWhenNoResultIsAvailable() )
|
||||
if ( faultCollection->hideNNCsWhenNoResultIsAvailable() )
|
||||
{
|
||||
RigMainGrid* mainGrid = m_reservoirView->mainGrid();
|
||||
if ( !( mainGrid && mainGrid->nncData()->hasScalarValues( eclipseResultAddress ) ) )
|
||||
@ -231,9 +230,9 @@ void RivReservoirFaultsPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
CVF_ASSERT( faultCollection );
|
||||
|
||||
for ( size_t i = 0; i < faultCollection->faults.size(); i++ )
|
||||
for ( auto& faultPart : m_faultParts )
|
||||
{
|
||||
if ( cellResultColors && ( cellResultColors->hasResult() || cellResultColors->isTernarySaturationSelected() ) )
|
||||
{
|
||||
m_faultParts[i]->updateCellResultColor( timeStepIndex, cellResultColors );
|
||||
faultPart->updateCellResultColor( timeStepIndex, cellResultColors );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_faultParts[i]->applySingleColorEffect();
|
||||
faultPart->applySingleColorEffect();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -267,9 +266,9 @@ void RivReservoirFaultsPartMgr::updateCellEdgeResultColor( size_t
|
||||
RimEclipseCellColors* cellResultColors,
|
||||
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();
|
||||
CVF_ASSERT( faultCollection );
|
||||
|
||||
if ( !faultCollection->showFaultCollection() ) return;
|
||||
if ( !faultCollection->isActive() ) return;
|
||||
|
||||
if ( !faultCollection->showFaultLabel() ) return;
|
||||
|
||||
// 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;
|
||||
|
||||
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() );
|
||||
|
||||
if ( rimFault->showFault() )
|
||||
@ -336,8 +334,8 @@ void RivReservoirFaultsPartMgr::clearWatertightGeometryFlag()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
@ -62,40 +62,42 @@ RimFaultInViewCollection::RimFaultInViewCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "Faults", ":/draw_style_faults_24x24.png" );
|
||||
|
||||
CAF_PDM_InitField( &showFaultCollection, "Active", true, "Active" );
|
||||
showFaultCollection.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_showFaultCollection, "Active", true, "Active" );
|
||||
m_showFaultCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &showFaultFaces, "ShowFaultFaces", true, "Show Defined faces" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultFaces );
|
||||
CAF_PDM_InitField( &m_showFaultFaces, "ShowFaultFaces", true, "Show Defined faces" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultFaces );
|
||||
|
||||
CAF_PDM_InitField( &showOppositeFaultFaces, "ShowOppositeFaultFaces", true, "Show Opposite Faces" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showOppositeFaultFaces );
|
||||
CAF_PDM_InitField( &m_showOppositeFaultFaces, "ShowOppositeFaultFaces", true, "Show Opposite Faces" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showOppositeFaultFaces );
|
||||
|
||||
CAF_PDM_InitField( &m_showFaultsOutsideFilters, "ShowFaultsOutsideFilters", true, "Show Faults Outside Filters" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultsOutsideFilters );
|
||||
CAF_PDM_InitField( &m_applyCellFilters, "ApplyCellFilters", true, "Use Cell Filters for Faults" );
|
||||
|
||||
CAF_PDM_InitField( &m_onlyShowWithNeighbor, "OnlyShowWithDefNeighbor", false, "Show Only Faces with Juxtaposition" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_onlyShowWithNeighbor );
|
||||
|
||||
CAF_PDM_InitField( &faultResult,
|
||||
CAF_PDM_InitField( &m_faultResult,
|
||||
"FaultFaceCulling",
|
||||
caf::AppEnum<RimFaultInViewCollection::FaultFaceCullingMode>( RimFaultInViewCollection::FAULT_BACK_FACE_CULLING ),
|
||||
"Dynamic Face Selection" );
|
||||
|
||||
CAF_PDM_InitField( &showFaultLabel, "ShowFaultLabel", false, "Show Labels" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showFaultLabel );
|
||||
CAF_PDM_InitField( &m_showFaultLabel, "ShowFaultLabel", false, "Show Labels" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showFaultLabel );
|
||||
|
||||
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::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &showNNCs );
|
||||
CAF_PDM_InitField( &m_showNNCs, "ShowNNCs", true, "Show NNCs" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showNNCs );
|
||||
|
||||
CAF_PDM_InitField( &hideNncsWhenNoResultIsAvailable, "HideNncsWhenNoResultIsAvailable", true, "Hide NNC Geometry if No NNC Result is Available" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &hideNncsWhenNoResultIsAvailable );
|
||||
CAF_PDM_InitField( &m_hideNNCsWhenNoResultIsAvailable,
|
||||
"HideNncsWhenNoResultIsAvailable",
|
||||
true,
|
||||
"Hide NNC Geometry if No NNC Result is Available" );
|
||||
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_hideNNCsWhenNoResultIsAvailable );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &faults, "Faults", "Faults" );
|
||||
faults.uiCapability()->setUiTreeHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_faults, "Faults", "Faults" );
|
||||
m_faults.uiCapability()->setUiTreeHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -103,7 +105,79 @@ 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();
|
||||
|
||||
if ( &faultLabelColor == changedField )
|
||||
if ( &m_faultLabelColor == changedField )
|
||||
{
|
||||
parentView()->scheduleReservoirGridGeometryRegen();
|
||||
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
@ -124,16 +198,16 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
parentView()->scheduleReservoirGridGeometryRegen();
|
||||
}
|
||||
|
||||
if ( &showFaultFaces == changedField || &showOppositeFaultFaces == changedField || &showFaultCollection == changedField ||
|
||||
&showFaultLabel == changedField || &m_showFaultsOutsideFilters == changedField || &faultLabelColor == changedField ||
|
||||
&m_onlyShowWithNeighbor == changedField || &faultResult == changedField || &showNNCs == changedField ||
|
||||
&hideNncsWhenNoResultIsAvailable == changedField )
|
||||
if ( &m_showFaultFaces == changedField || &m_showOppositeFaultFaces == changedField || &m_showFaultCollection == changedField ||
|
||||
&m_showFaultLabel == changedField || &m_applyCellFilters == changedField || &m_faultLabelColor == changedField ||
|
||||
&m_onlyShowWithNeighbor == changedField || &m_faultResult == changedField || &m_showNNCs == changedField ||
|
||||
&m_hideNNCsWhenNoResultIsAvailable == changedField )
|
||||
{
|
||||
parentView()->scheduleCreateDisplayModelAndRedraw();
|
||||
parentView()->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
|
||||
if ( &showFaultLabel == changedField )
|
||||
if ( &m_showFaultLabel == changedField )
|
||||
{
|
||||
RiuMainWindow::instance()->refreshDrawStyleActions();
|
||||
}
|
||||
@ -144,7 +218,7 @@ void RimFaultInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
|
||||
{
|
||||
return &showFaultCollection;
|
||||
return &m_showFaultCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -152,12 +226,9 @@ caf::PdmFieldHandle* RimFaultInViewCollection::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 )
|
||||
{
|
||||
return this->faults()[i];
|
||||
}
|
||||
if ( fault->name() == name ) return fault;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -250,8 +321,8 @@ void RimFaultInViewCollection::syncronizeFaults()
|
||||
newFaults.push_back( rimFault );
|
||||
}
|
||||
|
||||
this->faults().clearWithoutDelete();
|
||||
this->faults().insert( 0, newFaults );
|
||||
m_faults().clearWithoutDelete();
|
||||
m_faults().insert( 0, newFaults );
|
||||
|
||||
QString toolTip = QString( "Fault count (%1)" ).arg( newFaults.size() );
|
||||
setUiToolTip( toolTip );
|
||||
@ -272,21 +343,21 @@ void RimFaultInViewCollection::uiOrderingFaults( QString uiConfigName, caf::PdmU
|
||||
{
|
||||
bool isGridVizMode = isGridVisualizationMode();
|
||||
|
||||
faultResult.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
showFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
showOppositeFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
m_faultResult.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
m_showFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
m_showOppositeFaultFaces.uiCapability()->setUiReadOnly( isGridVizMode );
|
||||
|
||||
caf::PdmUiGroup* ffviz = uiOrdering.addNewGroup( "Fault Face Visibility" );
|
||||
ffviz->setCollapsedByDefault();
|
||||
ffviz->add( &showFaultFaces );
|
||||
ffviz->add( &showOppositeFaultFaces );
|
||||
ffviz->add( &faultResult );
|
||||
ffviz->add( &m_showFaultFaces );
|
||||
ffviz->add( &m_showOppositeFaultFaces );
|
||||
ffviz->add( &m_faultResult );
|
||||
ffviz->add( &m_onlyShowWithNeighbor );
|
||||
|
||||
caf::PdmUiGroup* nncViz = uiOrdering.addNewGroup( "NNC Visibility" );
|
||||
nncViz->setCollapsedByDefault();
|
||||
nncViz->add( &showNNCs );
|
||||
nncViz->add( &hideNncsWhenNoResultIsAvailable );
|
||||
nncViz->add( &m_showNNCs );
|
||||
nncViz->add( &m_hideNNCsWhenNoResultIsAvailable );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -294,12 +365,12 @@ void RimFaultInViewCollection::uiOrderingFaults( QString uiConfigName, caf::PdmU
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultInViewCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" );
|
||||
labs->add( &showFaultLabel );
|
||||
labs->add( &faultLabelColor );
|
||||
caf::PdmUiGroup* general = uiOrdering.addNewGroup( "General" );
|
||||
general->add( &m_applyCellFilters );
|
||||
|
||||
caf::PdmUiGroup* adv = uiOrdering.addNewGroup( "Fault Options" );
|
||||
adv->add( &m_showFaultsOutsideFilters );
|
||||
caf::PdmUiGroup* labs = uiOrdering.addNewGroup( "Fault Labels" );
|
||||
labs->add( &m_showFaultLabel );
|
||||
labs->add( &m_faultLabelColor );
|
||||
|
||||
uiOrderingFaults( uiConfigName, uiOrdering );
|
||||
}
|
||||
@ -316,7 +387,7 @@ void RimFaultInViewCollection::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
|
||||
uiTreeOrdering.appendChild( uiTree );
|
||||
}
|
||||
|
||||
for ( const auto& fault : faults )
|
||||
for ( const auto& fault : m_faults )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultInViewCollection::setShowFaultsOutsideFilter( bool show )
|
||||
{
|
||||
m_showFaultsOutsideFilters = show;
|
||||
return m_applyCellFilters;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -357,3 +420,43 @@ bool RimFaultInViewCollection::onlyShowFacesWithDefinedNeighbor() const
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimEclipseView;
|
||||
class RimFaultInView;
|
||||
|
||||
@ -54,29 +56,30 @@ public:
|
||||
RimFaultInViewCollection();
|
||||
~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();
|
||||
|
||||
bool isGridVisualizationMode() const;
|
||||
|
||||
bool isShowingFaultsAndFaultsOutsideFilters() const;
|
||||
void setShowFaultsOutsideFilter( bool show );
|
||||
|
||||
bool shouldApplyCellFiltersToFaults() 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 );
|
||||
|
||||
@ -90,6 +93,19 @@ private:
|
||||
RimEclipseView* parentView() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showFaultsOutsideFilters;
|
||||
caf::PdmField<bool> m_onlyShowWithNeighbor;
|
||||
caf::PdmField<bool> m_showFaultsOutsideFilters_obsolete;
|
||||
|
||||
caf::PdmField<bool> m_applyCellFilters;
|
||||
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;
|
||||
};
|
||||
|
@ -537,7 +537,7 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
|
||||
if ( view != nullptr )
|
||||
{
|
||||
view->faultCollection()->showFaultCollection = false;
|
||||
view->faultCollection()->setActive( false );
|
||||
view->cellResult()->setResultType( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS );
|
||||
view->cellResult()->setFlowDiagTracerSelectionType(
|
||||
RimEclipseResultDefinition::FlowTracerSelectionType::FLOW_TR_BY_SELECTION );
|
||||
@ -667,7 +667,6 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
|
||||
if ( m_cellFilter() == RigFlowDiagResults::CELLS_VISIBLE )
|
||||
{
|
||||
cvf::UByteArray visibleCells;
|
||||
m_case()->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
|
||||
if ( m_cellFilterView )
|
||||
{
|
||||
|
@ -318,12 +318,9 @@ void RimGeoMechView::onCreateDisplayModel()
|
||||
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_wellPathPipeVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Cross sections
|
||||
// Intersections
|
||||
|
||||
m_intersectionVizModel->removeAllParts();
|
||||
m_intersectionCollection->rebuildGeometry();
|
||||
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
|
||||
appendIntersectionsToModel( cellFilterCollection()->hasActiveFilters(), propertyFilterCollection()->hasActiveDynamicFilters() );
|
||||
|
||||
// Seismic sections
|
||||
|
||||
@ -480,13 +477,14 @@ void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
m_vizLogic->updateStaticCellColors( m_currentTimeStep() );
|
||||
|
||||
// Intersections
|
||||
if ( intersectionCollection()->shouldApplyCellFiltersToIntersections() && propertyFilterCollection()->hasActiveDynamicFilters() )
|
||||
{
|
||||
m_intersectionVizModel->removeAllParts();
|
||||
m_intersectionCollection->rebuildGeometry();
|
||||
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
m_intersectionCollection->clearGeometry();
|
||||
appendIntersectionsForCurrentTimeStep();
|
||||
}
|
||||
|
||||
m_intersectionCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
|
||||
if ( m_surfaceCollection )
|
||||
{
|
||||
m_surfaceCollection->updateCellResultColor( hasGeneralCellResult, m_currentTimeStep );
|
||||
@ -1133,3 +1131,12 @@ void RimGeoMechView::resetVizLogic()
|
||||
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 );
|
||||
}
|
||||
|
@ -128,6 +128,8 @@ protected:
|
||||
|
||||
RimPropertyFilterCollection* nativePropertyFilterCollection();
|
||||
|
||||
void calculateCellVisibility( cvf::UByteArray* visibility, std::vector<RivCellSetEnum> geomTypes, int timeStep = 0 ) override;
|
||||
|
||||
private:
|
||||
QString createAutoName() const override;
|
||||
|
||||
|
@ -267,7 +267,7 @@ void RimBoxIntersection::appendManipulatorPartsToModel( cvf::ModelBasicList* mod
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimBoxIntersection::rebuildGeometry()
|
||||
void RimBoxIntersection::clearGeometry()
|
||||
{
|
||||
m_intersectionBoxPartMgr = nullptr;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
|
||||
RivBoxIntersectionPartMgr* intersectionBoxPartMgr();
|
||||
void appendManipulatorPartsToModel( cvf::ModelBasicList* model );
|
||||
void rebuildGeometry();
|
||||
void clearGeometry();
|
||||
|
||||
void setToDefaultSizeBox();
|
||||
void setToDefaultSizeSlice( SinglePlaneState plane, const cvf::Vec3d& position );
|
||||
|
@ -844,7 +844,7 @@ RivExtrudedCurveIntersectionPartMgr* RimExtrudedCurveIntersection::intersectionP
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimExtrudedCurveIntersection::rebuildGeometry()
|
||||
void RimExtrudedCurveIntersection::clearGeometry()
|
||||
{
|
||||
m_crossSectionPartMgr = nullptr;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public:
|
||||
|
||||
Rim2dIntersectionView* correspondingIntersectionView() const;
|
||||
RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr();
|
||||
void rebuildGeometry();
|
||||
void clearGeometry();
|
||||
const RivIntersectionGeometryGeneratorInterface* intersectionGeometryGenerator() const override;
|
||||
|
||||
std::vector<cvf::Vec3d> polyLinesForExtrusionDirection() const;
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimIntersectionCollection, "IntersectionCollection", "CrossSectionCollection" );
|
||||
@ -59,8 +60,8 @@ RimIntersectionCollection::RimIntersectionCollection()
|
||||
CAF_PDM_InitFieldNoDefault( &m_intersectionBoxes, "IntersectionBoxes", "IntersectionBoxes" );
|
||||
m_intersectionBoxes.uiCapability()->setUiTreeHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &isActive, "Active", true, "Active" );
|
||||
isActive.uiCapability()->setUiHidden( true );
|
||||
CAF_PDM_InitField( &m_isActive, "Active", true, "Active" );
|
||||
m_isActive.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_depthUpperThreshold, "UpperDepthThreshold", "Upper Threshold" );
|
||||
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_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()
|
||||
{
|
||||
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() )
|
||||
{
|
||||
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()->appendMeshLinePartsToModel( model, scaleTransform );
|
||||
cs->intersectionPartMgr()->appendPolylinePartsToModel( view, model, scaleTransform );
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,32 +257,26 @@ void RimIntersectionCollection::appendPartsToModel( Rim3dView& view, cvf::ModelB
|
||||
{
|
||||
if ( cs->isActive() )
|
||||
{
|
||||
cs->intersectionBoxPartMgr()->generatePartGeometry( visibleCells );
|
||||
cs->intersectionBoxPartMgr()->appendNativeIntersectionFacesToModel( 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 )
|
||||
{
|
||||
intersection->rebuildGeometry();
|
||||
intersection->clearGeometry();
|
||||
}
|
||||
|
||||
for ( RimBoxIntersection* intersectionBox : m_intersectionBoxes )
|
||||
{
|
||||
intersectionBox->rebuildGeometry();
|
||||
intersectionBox->clearGeometry();
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,12 +386,12 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
{
|
||||
bool rebuildView = false;
|
||||
|
||||
if ( changedField == &isActive )
|
||||
if ( changedField == &m_isActive )
|
||||
{
|
||||
updateUiIconFromToggleField();
|
||||
rebuildView = true;
|
||||
}
|
||||
if ( changedField == &m_depthThresholdOverridden )
|
||||
else if ( changedField == &m_depthThresholdOverridden )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@ -372,8 +404,8 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) || ( changedField == &m_depthFilterType ) )
|
||||
else if ( ( changedField == &m_depthUpperThreshold ) || ( changedField == &m_depthLowerThreshold ) ||
|
||||
( changedField == &m_depthFilterType ) )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@ -382,8 +414,7 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
|
||||
else if ( changedField == &m_kFilterOverridden || changedField == &m_kFilterStr )
|
||||
{
|
||||
for ( RimExtrudedCurveIntersection* cs : m_intersections )
|
||||
{
|
||||
@ -392,6 +423,10 @@ void RimIntersectionCollection::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
}
|
||||
rebuildView = true;
|
||||
}
|
||||
else if ( changedField == &m_applyCellFilters )
|
||||
{
|
||||
rebuildView = true;
|
||||
}
|
||||
|
||||
if ( rebuildView )
|
||||
{
|
||||
@ -452,7 +487,11 @@ void RimIntersectionCollection::updateIntersectionBoxGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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" );
|
||||
filterGroup->setCollapsedByDefault();
|
||||
|
||||
m_depthFilterType.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
m_depthUpperThreshold.uiCapability()->setUiReadOnly( !m_depthThresholdOverridden() );
|
||||
@ -486,12 +525,13 @@ void RimIntersectionCollection::defineUiOrdering( QString uiConfigName, caf::Pdm
|
||||
}
|
||||
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() );
|
||||
|
||||
filterGroup->add( &m_kFilterOverridden );
|
||||
filterGroup->add( &m_kFilterStr );
|
||||
kfilterGroup->add( &m_kFilterOverridden );
|
||||
kfilterGroup->add( &m_kFilterStr );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
@ -539,3 +579,11 @@ void RimIntersectionCollection::rebuild3dView() const
|
||||
rimView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimIntersectionCollection::shouldApplyCellFiltersToIntersections() const
|
||||
{
|
||||
return m_applyCellFilters();
|
||||
}
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cvfArray.h"
|
||||
|
||||
#include "RimIntersectionEnums.h"
|
||||
|
||||
class Rim3dView;
|
||||
@ -53,8 +55,6 @@ public:
|
||||
RimIntersectionCollection();
|
||||
~RimIntersectionCollection() override;
|
||||
|
||||
caf::PdmField<bool> isActive;
|
||||
|
||||
void appendIntersectionAndUpdate( RimExtrudedCurveIntersection* intersection, bool allowActiveViewChange = true );
|
||||
void appendIntersectionNoUpdate( RimExtrudedCurveIntersection* intersection );
|
||||
|
||||
@ -70,12 +70,18 @@ public:
|
||||
void scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
void recomputeSimWellBranchData();
|
||||
|
||||
bool shouldApplyCellFiltersToIntersections() const;
|
||||
|
||||
// Visualization interface
|
||||
|
||||
void applySingleColorEffect();
|
||||
void updateCellResultColor( bool hasGeneralCellResult, int timeStepIndex );
|
||||
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<RimBoxIntersection*> intersectionBoxes() const;
|
||||
@ -84,6 +90,8 @@ public:
|
||||
|
||||
void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override;
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
caf::PdmFieldHandle* objectToggleField() override;
|
||||
@ -96,6 +104,8 @@ private:
|
||||
RimEclipseView* eclipseView() const;
|
||||
void rebuild3dView() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
|
||||
caf::PdmChildArrayField<RimExtrudedCurveIntersection*> m_intersections;
|
||||
caf::PdmChildArrayField<RimBoxIntersection*> m_intersectionBoxes;
|
||||
|
||||
@ -104,6 +114,8 @@ private:
|
||||
caf::PdmField<double> m_depthLowerThreshold;
|
||||
caf::PdmField<caf::AppEnum<RimIntersectionFilterEnum>> m_depthFilterType;
|
||||
|
||||
caf::PdmField<bool> m_applyCellFilters;
|
||||
|
||||
caf::PdmField<bool> m_kFilterOverridden;
|
||||
caf::PdmField<QString> m_kFilterStr;
|
||||
};
|
||||
|
@ -539,6 +539,7 @@ void Rim2dIntersectionView::onCreateDisplayModel()
|
||||
|
||||
m_intersectionVizModel->removeAllParts();
|
||||
|
||||
m_flatIntersectionPartMgr->generatePartGeometry( nullptr );
|
||||
m_flatIntersectionPartMgr->appendIntersectionFacesToModel( m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_flatIntersectionPartMgr->appendMeshLinePartsToModel( m_intersectionVizModel.p(), scaleTransform() );
|
||||
m_flatIntersectionPartMgr->appendPolylinePartsToModel( *this, m_intersectionVizModel.p(), scaleTransform() );
|
||||
|
@ -150,9 +150,6 @@ Rim3dView::Rim3dView()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fontSize, "FontSize", "Font Size" );
|
||||
|
||||
m_intersectionVizModel = new cvf::ModelBasicList;
|
||||
m_intersectionVizModel->setName( "CrossSectionModel" );
|
||||
|
||||
m_seismicVizModel = new cvf::ModelBasicList;
|
||||
m_seismicVizModel->setName( "SeismicSectionModel" );
|
||||
|
||||
|
@ -257,7 +257,6 @@ protected:
|
||||
|
||||
// 3D display model data
|
||||
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
|
||||
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
|
||||
cvf::ref<cvf::ModelBasicList> m_seismicVizModel;
|
||||
cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager;
|
||||
|
||||
|
@ -311,8 +311,8 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
|
||||
rimEclipseView->cellResult()->setFromEclipseResultAddress( defaultResult );
|
||||
}
|
||||
|
||||
auto prefs = RiaPreferences::current();
|
||||
rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault();
|
||||
auto prefs = RiaPreferences::current();
|
||||
rimEclipseView->faultCollection()->setActive( prefs->enableFaultsByDefault() );
|
||||
|
||||
rimEclipseView->cellEdgeResult()->setResultVariable( "MULT" );
|
||||
rimEclipseView->cellEdgeResult()->setActive( false );
|
||||
|
@ -291,9 +291,9 @@ void RimEclipseContourMapView::updateGeometry()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseContourMapView::setFaultVisParameters()
|
||||
{
|
||||
faultCollection()->setShowFaultsOutsideFilter( false );
|
||||
faultCollection()->showOppositeFaultFaces = true;
|
||||
faultCollection()->faultResult = RimFaultInViewCollection::FAULT_NO_FACE_CULLING;
|
||||
faultCollection()->setShouldApplyCellFiltersToFaults( true );
|
||||
faultCollection()->setShowOppositeFaultFaces( true );
|
||||
faultCollection()->setFaultResult( RimFaultInViewCollection::FAULT_NO_FACE_CULLING );
|
||||
faultResultSettings()->showCustomFaultResult = true;
|
||||
faultResultSettings()->customFaultResult()->setResultVariable( "None" );
|
||||
}
|
||||
@ -507,7 +507,7 @@ std::set<RivCellSetEnum> RimEclipseContourMapView::allVisibleFaultGeometryTypes(
|
||||
{
|
||||
std::set<RivCellSetEnum> faultGeoTypes;
|
||||
// Normal eclipse views always shows faults for active and visible eclipse cells.
|
||||
if ( faultCollection()->showFaultCollection() )
|
||||
if ( faultCollection()->isActive() )
|
||||
{
|
||||
faultGeoTypes = RimEclipseView::allVisibleFaultGeometryTypes();
|
||||
}
|
||||
|
@ -439,6 +439,9 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
|
||||
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.
|
||||
// First entry in this vector is used to define the geometry only result mode with no results.
|
||||
std::vector<size_t> timeStepIndices;
|
||||
@ -458,9 +461,9 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
timeStepIndices.push_back( i );
|
||||
}
|
||||
}
|
||||
else if ( this->cellResult()->hasStaticResult() || this->cellEdgeResult()->hasResult() ||
|
||||
this->eclipsePropertyFilterCollection()->hasActiveFilters() || this->intersectionCollection()->hasAnyActiveSeparateResults() ||
|
||||
( this->surfaceInViewCollection() && this->surfaceInViewCollection()->hasAnyActiveSeparateResults() ) )
|
||||
else if ( cellResult()->hasStaticResult() || cellEdgeResult()->hasResult() || propertyFiltersActive ||
|
||||
intersectionCollection()->hasAnyActiveSeparateResults() ||
|
||||
( surfaceInViewCollection() && surfaceInViewCollection()->hasAnyActiveSeparateResults() ) )
|
||||
{
|
||||
// The one and only static result entry
|
||||
timeStepIndices.push_back( 0 );
|
||||
@ -480,7 +483,7 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
wellCollection()->scheduleIsWellPipesVisibleRecalculation();
|
||||
|
||||
// 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
|
||||
@ -488,36 +491,35 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
// For property filtered geometry : just set all the models as empty scenes
|
||||
// updateCurrentTimeStep requests the actual parts
|
||||
|
||||
if ( !this->eclipsePropertyFilterCollection()->hasActiveFilters() ||
|
||||
( this->viewController() && this->viewController()->isVisibleCellsOveridden() ) )
|
||||
if ( !propertyFiltersActive || ( viewController() && viewController()->isVisibleCellsOveridden() ) )
|
||||
{
|
||||
std::vector<RivCellSetEnum> geometryTypesToAdd;
|
||||
|
||||
if ( this->viewController() && this->viewController()->isVisibleCellsOveridden() )
|
||||
if ( viewController() && viewController()->isVisibleCellsOveridden() )
|
||||
{
|
||||
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_WELL_CELLS );
|
||||
geometryTypesToAdd.push_back( VISIBLE_WELL_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 );
|
||||
}
|
||||
}
|
||||
else if ( !this->cellFilterCollection()->hasActiveFilters() && this->wellCollection()->hasVisibleWellCells() )
|
||||
else if ( !cellFiltersActive && wellCollection()->hasVisibleWellCells() )
|
||||
{
|
||||
geometryTypesToAdd.push_back( VISIBLE_WELL_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_WELL_CELLS );
|
||||
if ( this->showInactiveCells() )
|
||||
if ( showInactiveCells() )
|
||||
{
|
||||
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( ACTIVE );
|
||||
|
||||
if ( this->showInactiveCells() )
|
||||
if ( showInactiveCells() )
|
||||
{
|
||||
geometryTypesToAdd.push_back( INACTIVE );
|
||||
}
|
||||
@ -555,7 +557,7 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
}
|
||||
}
|
||||
// Set static colors
|
||||
this->onUpdateStaticCellColors();
|
||||
onUpdateStaticCellColors();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -565,14 +567,14 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
|
||||
m_reservoirGridPartManager->clearWatertightGeometryFlags();
|
||||
|
||||
if ( faultCollection()->showFaultCollection() || !this->eclipsePropertyFilterCollection()->hasActiveFilters() )
|
||||
if ( faultCollection()->isActive() || !propertyFiltersActive )
|
||||
{
|
||||
setVisibleGridPartsWatertight();
|
||||
|
||||
std::set<RivCellSetEnum> faultGeometryTypesToAppend = allVisibleFaultGeometryTypes();
|
||||
RivCellSetEnum faultLabelType =
|
||||
m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend,
|
||||
faultCollection()->isShowingFaultsAndFaultsOutsideFilters() );
|
||||
!faultCollection()->shouldApplyCellFiltersToFaults() );
|
||||
|
||||
for ( size_t frameIdx = 0; frameIdx < frameModels.size(); ++frameIdx )
|
||||
{
|
||||
@ -587,22 +589,16 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
}
|
||||
}
|
||||
|
||||
// Cross sections
|
||||
|
||||
m_intersectionVizModel->removeAllParts();
|
||||
m_intersectionCollection->rebuildGeometry();
|
||||
m_intersectionCollection->appendPartsToModel( *this, m_intersectionVizModel.p(), m_reservoirGridPartManager->scaleTransform() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_intersectionVizModel.p(), isUsingOverrideViewer() );
|
||||
// Intersections
|
||||
appendIntersectionsToModel( cellFiltersActive, propertyFiltersActive );
|
||||
|
||||
// Seismic sections
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform();
|
||||
m_seismicVizModel->removeAllParts();
|
||||
m_seismicSectionCollection->appendPartsToModel( this, m_seismicVizModel.p(), transform.p(), ownerCase()->allCellsBoundingBox() );
|
||||
nativeOrOverrideViewer()->addStaticModelOnce( m_seismicVizModel.p(), isUsingOverrideViewer() );
|
||||
|
||||
// Surfaces
|
||||
|
||||
m_surfaceVizModel->removeAllParts();
|
||||
if ( surfaceInViewCollection() )
|
||||
{
|
||||
@ -611,7 +607,6 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
}
|
||||
|
||||
// Well path model
|
||||
|
||||
m_wellPathPipeVizModel->removeAllParts();
|
||||
|
||||
// NB! StimPlan legend colors must be updated before well path geometry is added to the model
|
||||
@ -659,7 +654,7 @@ void RimEclipseView::onCreateDisplayModel()
|
||||
updateFaultColors();
|
||||
}
|
||||
|
||||
std::vector<RimFlowCharacteristicsPlot*> characteristicsPlots = this->objectsWithReferringPtrFieldsOfType<RimFlowCharacteristicsPlot>();
|
||||
std::vector<RimFlowCharacteristicsPlot*> characteristicsPlots = objectsWithReferringPtrFieldsOfType<RimFlowCharacteristicsPlot>();
|
||||
for ( auto plot : characteristicsPlots )
|
||||
{
|
||||
if ( plot != nullptr )
|
||||
@ -711,8 +706,6 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
{
|
||||
clearReservoirCellVisibilities();
|
||||
|
||||
// m_surfaceCollection->clearGeometry();
|
||||
|
||||
m_propertyFilterCollection()->updateFromCurrentTimeStep();
|
||||
m_streamlineCollection()->updateFromCurrentTimeStep( currentTimeStep() );
|
||||
|
||||
@ -720,6 +713,12 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
|
||||
|
||||
onUpdateLegends(); // To make sure the scalar mappers are set up correctly
|
||||
|
||||
if ( intersectionCollection()->shouldApplyCellFiltersToIntersections() && eclipsePropertyFilterCollection()->hasActiveFilters() )
|
||||
{
|
||||
m_intersectionCollection->clearGeometry();
|
||||
appendIntersectionsForCurrentTimeStep();
|
||||
}
|
||||
|
||||
updateVisibleCellColors();
|
||||
|
||||
wellCollection()->scaleWellDisks();
|
||||
@ -787,7 +786,7 @@ void RimEclipseView::updateVisibleGeometries()
|
||||
|
||||
RivCellSetEnum faultLabelType =
|
||||
m_reservoirGridPartManager->geometryTypeForFaultLabels( faultGeometryTypesToAppend,
|
||||
faultCollection()->isShowingFaultsAndFaultsOutsideFilters() );
|
||||
!faultCollection()->shouldApplyCellFiltersToFaults() );
|
||||
if ( faultLabelType == PROPERTY_FILTERED )
|
||||
{
|
||||
m_reservoirGridPartManager->appendFaultLabelsDynamicGeometryPartsToModel( frameParts.p(), faultLabelType, m_currentTimeStep );
|
||||
@ -810,7 +809,7 @@ void RimEclipseView::updateVisibleGeometries()
|
||||
{
|
||||
m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE, gridIndices );
|
||||
|
||||
if ( !faultCollection()->isShowingFaultsAndFaultsOutsideFilters() )
|
||||
if ( faultCollection()->shouldApplyCellFiltersToFaults() )
|
||||
{
|
||||
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), RANGE_FILTERED_INACTIVE );
|
||||
}
|
||||
@ -819,7 +818,7 @@ void RimEclipseView::updateVisibleGeometries()
|
||||
{
|
||||
m_reservoirGridPartManager->appendStaticGeometryPartsToModel( frameParts.p(), INACTIVE, gridIndices );
|
||||
|
||||
if ( !faultCollection()->isShowingFaultsAndFaultsOutsideFilters() )
|
||||
if ( faultCollection()->shouldApplyCellFiltersToFaults() )
|
||||
{
|
||||
m_reservoirGridPartManager->appendFaultsStaticGeometryPartsToModel( frameParts.p(), INACTIVE );
|
||||
}
|
||||
@ -1934,7 +1933,7 @@ std::set<RivCellSetEnum> RimEclipseView::allVisibleFaultGeometryTypes() const
|
||||
std::set<RivCellSetEnum> faultGeoTypes;
|
||||
faultGeoTypes.insert( m_visibleGridParts.begin(), m_visibleGridParts.end() );
|
||||
|
||||
if ( faultCollection()->isShowingFaultsAndFaultsOutsideFilters() )
|
||||
if ( !faultCollection()->shouldApplyCellFiltersToFaults() )
|
||||
{
|
||||
faultGeoTypes.insert( ACTIVE );
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -155,6 +155,8 @@ public:
|
||||
|
||||
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;
|
||||
cvf::Color4f colorFromCellCategory( RivCellSetEnum geometryType ) const;
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
#include "Riu3dSelectionManager.h"
|
||||
#include "RiuMainWindow.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "RivSingleCellPartGenerator.h"
|
||||
|
||||
@ -112,6 +113,9 @@ RimGridView::RimGridView()
|
||||
|
||||
m_surfaceVizModel = new cvf::ModelBasicList;
|
||||
m_surfaceVizModel->setName( "SurfaceModel" );
|
||||
|
||||
m_intersectionVizModel = new cvf::ModelBasicList;
|
||||
m_intersectionVizModel->setName( "CrossSectionModel" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -493,3 +497,63 @@ void RimGridView::updateSurfacesInViewTreeItems()
|
||||
|
||||
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() );
|
||||
}
|
||||
}
|
||||
|
@ -84,8 +84,14 @@ protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) 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:
|
||||
cvf::ref<cvf::ModelBasicList> m_surfaceVizModel;
|
||||
cvf::ref<cvf::ModelBasicList> m_intersectionVizModel;
|
||||
|
||||
// Fields
|
||||
caf::PdmChildField<RimIntersectionCollection*> m_intersectionCollection;
|
||||
|
@ -146,7 +146,7 @@ std::set<int> RigVisibleCategoriesCalculator::visibleCategories( RimEclipseView*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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;
|
||||
|
||||
@ -173,8 +173,7 @@ std::set<size_t> RigVisibleCategoriesCalculator::visibleNncConnectionIndices( Ri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigVisibleCategoriesCalculator::appendVisibleFaultCells( RimEclipseView* eclView, std::set<size_t>& visibleCells )
|
||||
{
|
||||
if ( eclView->faultCollection() && eclView->faultCollection()->showFaultCollection &&
|
||||
!eclView->faultResultSettings()->showCustomFaultResult() )
|
||||
if ( eclView->faultCollection() && eclView->faultCollection()->isActive() && !eclView->faultResultSettings()->showCustomFaultResult() )
|
||||
{
|
||||
for ( const auto& f : eclView->faultCollection()->faults() )
|
||||
{
|
||||
|
@ -1613,7 +1613,7 @@ void RiuMainWindow::slotToggleFaultLabelsAction( bool showLabels )
|
||||
|
||||
if ( !activeRiv ) return;
|
||||
|
||||
activeRiv->faultCollection()->showFaultLabel.setValueWithFieldChanged( showLabels );
|
||||
activeRiv->faultCollection()->setShowFaultLabelWithFieldChanged( showLabels );
|
||||
|
||||
refreshDrawStyleActions();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user