Refactor code

Make use of calculateCurrentTotalCellVisibility for eclipse view to get surface vertices. Prevent usage of individual grid part managers in gRPC-service.
This commit is contained in:
Jørgen Herje
2024-02-26 16:00:23 +01:00
parent 42a939b107
commit f9f4bc1e86
10 changed files with 203 additions and 208 deletions

View File

@@ -203,33 +203,6 @@ void RivGridPartMgr::appendPartsToModel( cvf::ModelBasicList* model )
if ( m_surfaceGridLines.notNull() ) model->addPart( m_surfaceGridLines.p() );
}
//--------------------------------------------------------------------------------------------------
/// Returns the surface vertices of the grid part
///
/// Creates vertices if they do not exist
/// Used for gRPC service GridGeometryExtraction
//--------------------------------------------------------------------------------------------------
cvf::Vec3fArray* RivGridPartMgr::getOrCreateSurfaceVertices()
{
return m_surfaceGenerator.getOrCreateVertices();
}
//--------------------------------------------------------------------------------------------------
/// Get map from quad index to cell index
///
/// Used for gRPC service GridGeometryExtraction
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RivGridPartMgr::getSurfaceQuadToCellIndicesArray()
{
auto* gridQuadToCellFaceMapper = m_surfaceGenerator.quadToCellFaceMapper();
if ( gridQuadToCellFaceMapper == nullptr )
{
return std::vector<size_t>();
}
return gridQuadToCellFaceMapper->quadToCellIndicesArray();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -71,9 +71,6 @@ public:
void appendPartsToModel( cvf::ModelBasicList* model );
cvf::Vec3fArray* getOrCreateSurfaceVertices();
std::vector<size_t> getSurfaceQuadToCellIndicesArray();
private:
void generatePartGeometry( cvf::StructGridGeometryGenerator& geoBuilder );

View File

@@ -179,22 +179,6 @@ void RivReservoirPartMgr::appendElementVectorResultPartsToModel( cvf::ModelBasic
}
}
//--------------------------------------------------------------------------------------------------
/// Get the part manager for main grid
///
/// Needed for the gRPC service for GridGeometryExtraction
//--------------------------------------------------------------------------------------------------
RivGridPartMgr* RivReservoirPartMgr::mainGridPartManager()
{
if ( m_allGrids.empty() )
{
return nullptr;
}
// First grid should be the main grid
return m_allGrids.at( 0 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -76,8 +76,6 @@ public:
// Element Vector Result
void appendElementVectorResultPartsToModel( cvf::ModelBasicList* model, size_t timeStepIndex );
RivGridPartMgr* mainGridPartManager();
private:
cvf::Collection<RivGridPartMgr> m_allGrids; // Main grid and all LGR's
cvf::ref<RivElementVectorResultPartMgr> m_elementVectorResultMgr;

View File

@@ -910,14 +910,6 @@ void RivReservoirViewPartMgr::computePropertyVisibility( cvf::UByteArray*
}
}
//--------------------------------------------------------------------------------------------------
/// Needed for the gRPC service for GridGeometryExtraction
//--------------------------------------------------------------------------------------------------
RivReservoirPartMgr* RivReservoirViewPartMgr::rangeFilteredReservoirPartManager( size_t timeStepIndex )
{
return reservoirPartManager( RivCellSetEnum::RANGE_FILTERED, timeStepIndex );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -97,8 +97,6 @@ public:
const cvf::UByteArray* rangeFilterVisibility,
RimEclipsePropertyFilterCollection* propFilterColl );
RivReservoirPartMgr* rangeFilteredReservoirPartManager( size_t timeStepIndex );
private:
void createGeometry( RivCellSetEnum geometryType );
void computeVisibility( cvf::UByteArray* cellVisibility, RivCellSetEnum geometryType, RigGridBase* grid, size_t gridIdx );