mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for K filter to polyline intersections (#10302)
* Add support for K filter to polyline intersections
This commit is contained in:
@@ -61,11 +61,18 @@ void RivEclipseIntersectionGrid::findIntersectingCells( const cvf::BoundingBox&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RivEclipseIntersectionGrid::useCell( size_t cellIndex ) const
|
||||
{
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex];
|
||||
if ( m_showInactiveCells )
|
||||
return !( cell.isInvalid() || ( cell.subGrid() != nullptr ) );
|
||||
else
|
||||
return m_activeCellInfo->isActive( cellIndex ) && ( cell.subGrid() == nullptr );
|
||||
size_t i, j, k;
|
||||
m_mainGrid->ijkFromCellIndexUnguarded( cellIndex, &i, &j, &k );
|
||||
|
||||
if ( m_intervalTool.isNumberIncluded( k ) )
|
||||
{
|
||||
const RigCell& cell = m_mainGrid->globalCellArray()[cellIndex];
|
||||
if ( m_showInactiveCells )
|
||||
return !( cell.isInvalid() || ( cell.subGrid() != nullptr ) );
|
||||
else
|
||||
return m_activeCellInfo->isActive( cellIndex ) && ( cell.subGrid() == nullptr );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -97,3 +104,11 @@ const RigFault* RivEclipseIntersectionGrid::findFaultFromCellIndexAndCellFace( s
|
||||
{
|
||||
return m_mainGrid->findFaultFromCellIndexAndCellFace( reservoirCellIndex, face );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivEclipseIntersectionGrid::setKIntervalFilter( bool enabled, std::string kIntervalStr )
|
||||
{
|
||||
m_intervalTool.setInterval( enabled, kIntervalStr );
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "RivIntersectionHexGridInterface.h"
|
||||
|
||||
#include "RimCellFilterIntervalTool.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfVector3.h"
|
||||
@@ -45,9 +47,11 @@ public:
|
||||
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
|
||||
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
|
||||
void setKIntervalFilter( bool enabled, std::string kIntervalStr ) override;
|
||||
|
||||
private:
|
||||
cvf::cref<RigMainGrid> m_mainGrid;
|
||||
cvf::cref<RigActiveCellInfo> m_activeCellInfo;
|
||||
bool m_showInactiveCells;
|
||||
RimCellFilterIntervalTool m_intervalTool;
|
||||
};
|
||||
|
||||
@@ -64,8 +64,8 @@ cvf::ref<caf::DisplayCoordTransform> displayCoordTransform( const RimExtrudedCur
|
||||
RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* crossSection,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
const cvf::Vec3d& flattenedPolylineStartPoint )
|
||||
: m_intersection( crossSection )
|
||||
, m_polylines( polylines )
|
||||
@@ -278,6 +278,8 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays()
|
||||
|
||||
cvf::BoundingBox gridBBox = m_hexGrid->boundingBox();
|
||||
|
||||
m_hexGrid->setKIntervalFilter( m_intersection->kLayerFilterEnabled(), m_intersection->kFilterText().toStdString() );
|
||||
|
||||
calculateLineSegementTransforms();
|
||||
calculateTransformedPolyline();
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ class DrawableGeo;
|
||||
class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorInterface
|
||||
{
|
||||
public:
|
||||
RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
const RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
const cvf::Vec3d& flattenedPolylineStartPoint );
|
||||
RivExtrudedCurveIntersectionGeometryGenerator( RimExtrudedCurveIntersection* intersection,
|
||||
std::vector<std::vector<cvf::Vec3d>>& polylines,
|
||||
const cvf::Vec3d& extrusionDirection,
|
||||
RivIntersectionHexGridInterface* grid,
|
||||
bool isFlattened,
|
||||
const cvf::Vec3d& flattenedPolylineStartPoint );
|
||||
|
||||
~RivExtrudedCurveIntersectionGeometryGenerator() override;
|
||||
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
|
||||
private:
|
||||
RimExtrudedCurveIntersection* m_intersection;
|
||||
cvf::cref<RivIntersectionHexGridInterface> m_hexGrid;
|
||||
cvf::ref<RivIntersectionHexGridInterface> m_hexGrid;
|
||||
const std::vector<std::vector<cvf::Vec3d>> m_polylines;
|
||||
cvf::Vec3d m_extrusionDirection;
|
||||
bool m_isFlattened;
|
||||
|
||||
@@ -129,3 +129,11 @@ const RigFault* RivFemIntersectionGrid::findFaultFromCellIndexAndCellFace( size_
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFemIntersectionGrid::setKIntervalFilter( bool enabled, std::string kIntervalStr )
|
||||
{
|
||||
// not supported for geomech grids
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const override;
|
||||
void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const override;
|
||||
const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const override;
|
||||
void setKIntervalFilter( bool enabled, std::string kIntervalStr ) override;
|
||||
|
||||
private:
|
||||
cvf::cref<RigFemPartCollection> m_femParts;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "cvfStructGrid.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class RigFault;
|
||||
@@ -41,4 +42,5 @@ public:
|
||||
virtual void cellCornerVertices( size_t cellIndex, cvf::Vec3d cellCorners[8] ) const = 0;
|
||||
virtual void cellCornerIndices( size_t cellIndex, size_t cornerIndices[8] ) const = 0;
|
||||
virtual const RigFault* findFaultFromCellIndexAndCellFace( size_t reservoirCellIndex, cvf::StructGridInterface::FaceType face ) const = 0;
|
||||
virtual void setKIntervalFilter( bool enabled, std::string kIntervalStr ) = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user