Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgenherje committed Mar 14, 2024
1 parent 69c38df commit 9169ee2
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions GrpcInterface/RiaGrpcGridGeometryExtractionService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ grpc::Status RiaGrpcGridGeometryExtractionService::CutAlongPolyline( grpc::Serve
return status;
}

// Validate requested polyline
auto& fencePolyline = request->fencepolylineutmxy();
if ( fencePolyline.size() < 2 )
{
return grpc::Status( grpc::StatusCode::INVALID_ARGUMENT, "Invalid fence polyline - require two or more points" );
}

// Get eclipse view, show inactive cells and ensure static geometry parts created for grid part manager in view
auto* eclipseView = dynamic_cast<RimEclipseView*>( m_eclipseCase->views().front() );
if ( eclipseView == nullptr )
Expand All @@ -183,12 +190,6 @@ grpc::Status RiaGrpcGridGeometryExtractionService::CutAlongPolyline( grpc::Serve
eclipseView->setShowInactiveCells( true );
eclipseView->createGridGeometryParts();

auto& fencePolyline = request->fencepolylineutmxy();
if ( fencePolyline.size() < 2 )
{
return grpc::Status( grpc::StatusCode::INVALID_ARGUMENT, "Invalid fence polyline" );
}

// Convert polyline to vector of cvf::Vec3d
std::vector<cvf::Vec2d> polylineUtmXy;
for ( int i = 0; i < fencePolyline.size(); i += 2 )
Expand All @@ -211,16 +212,6 @@ grpc::Status RiaGrpcGridGeometryExtractionService::CutAlongPolyline( grpc::Serve
cvf::UByteArray visibleCells = cvf::UByteArray( m_eclipseCase->mainGrid()->cellCount() );
eclipseView->calculateCurrentTotalCellVisibility( &visibleCells, firstTimeStep );

// Loop to count number of visible cells
int numVisibleCells = 0;
for ( size_t i = 0; i < visibleCells.size(); ++i )
{
if ( ( visibleCells )[i] != 0 )
{
++numVisibleCells;
}
}

// Generate intersection
polylineIntersectionGenerator.generateIntersectionGeometry( &visibleCells );
if ( !polylineIntersectionGenerator.isAnyGeometryPresent() )
Expand Down

0 comments on commit 9169ee2

Please sign in to comment.