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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user