mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5372 Implement getting reservoir bounding box from Python
This commit is contained in:
@@ -338,7 +338,7 @@ grpc::Status RiaGrpcCaseService::GetCaseInfo( grpc::ServerContext* context,
|
||||
reply->set_type( caseType.toStdString() );
|
||||
return Status::OK;
|
||||
}
|
||||
return Status( grpc::NOT_FOUND, "No cases found" );
|
||||
return Status( grpc::NOT_FOUND, "Case not found" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -367,6 +367,28 @@ grpc::Status RiaGrpcCaseService::GetCellInfoForActiveCells( grpc::ServerContext*
|
||||
return stateHandler->assignReply( reply );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
grpc::Status RiaGrpcCaseService::GetReservoirBoundingBox( grpc::ServerContext* context,
|
||||
const rips::CaseRequest* request,
|
||||
rips::BoundingBox* reply )
|
||||
{
|
||||
RimCase* rimCase = findCase( request->id() );
|
||||
if ( rimCase )
|
||||
{
|
||||
cvf::BoundingBox boundingBox = rimCase->reservoirBoundingBox();
|
||||
reply->set_min_x( boundingBox.min().x() );
|
||||
reply->set_min_y( boundingBox.min().y() );
|
||||
reply->set_min_z( boundingBox.min().z() );
|
||||
reply->set_max_x( boundingBox.max().x() );
|
||||
reply->set_max_y( boundingBox.max().y() );
|
||||
reply->set_max_z( boundingBox.max().z() );
|
||||
return Status::OK;
|
||||
}
|
||||
return Status( grpc::NOT_FOUND, "Case not found" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -392,7 +414,10 @@ std::vector<RiaGrpcCallbackInterface*> RiaGrpcCaseService::createCallbacks()
|
||||
RiaActiveCellInfoStateHandler>( this,
|
||||
&Self::GetCellInfoForActiveCells,
|
||||
&Self::RequestGetCellInfoForActiveCells,
|
||||
new RiaActiveCellInfoStateHandler )};
|
||||
new RiaActiveCellInfoStateHandler ),
|
||||
new RiaGrpcUnaryCallback<Self, CaseRequest, BoundingBox>( this,
|
||||
&Self::GetReservoirBoundingBox,
|
||||
&Self::RequestGetReservoirBoundingBox )};
|
||||
}
|
||||
|
||||
static bool RiaGrpcCaseService_init = RiaGrpcServiceFactory::instance()->registerCreator<RiaGrpcCaseService>(
|
||||
|
||||
Reference in New Issue
Block a user