mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Have global z in vertexArray for getGridSurface endpoint
- originUtm as 3D point changed to originUtmXy as 2D point. - Have global z value for vertex coordinate in vertexArray
This commit is contained in:
parent
d7c35fba7c
commit
b9589b3719
@ -50,11 +50,12 @@ message GetGridSurfaceRequest
|
||||
|
||||
message GetGridSurfaceResponse
|
||||
{
|
||||
repeated float vertexArray = 1;
|
||||
// Vertex array with local x and y coordinates, around originUtmXy. z is coordinate on global Z
|
||||
repeated float vertexArray = 1; // [x0, y0, z0, x1, y1, z1, ...]
|
||||
repeated fixed32 quadIndicesArr = 2; // 4*NumQuads long
|
||||
repeated fixed32 sourceCellIndicesArr = 3; // The originating cell index per quad, longnumQuads long
|
||||
Vec3i gridDimensions = 5;
|
||||
Vec3d originUtm = 6;
|
||||
Vec2d originUtmXy = 6;
|
||||
TimeElapsedInfo timeElapsedInfo = 7;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ named_events_and_time_elapsed = (
|
||||
|
||||
vertex_array = get_grid_surface_response.vertexArray
|
||||
quad_indices_array = get_grid_surface_response.quadIndicesArr
|
||||
origin_utm = get_grid_surface_response.originUtm
|
||||
origin_utm_xy = get_grid_surface_response.originUtmXy
|
||||
source_cell_indices_arr = get_grid_surface_response.sourceCellIndicesArr
|
||||
grid_dimensions = get_grid_surface_response.gridDimensions
|
||||
|
||||
@ -87,9 +87,7 @@ fig = go.Figure(
|
||||
|
||||
print(f"Number of quads: {num_quads}")
|
||||
print(f"Source cell indices array length: {len(source_cell_indices_arr)}")
|
||||
print(
|
||||
f"Origin UTM coordinates [x, y, z]: [{origin_utm.x}, {origin_utm.y}, {origin_utm.z}]"
|
||||
)
|
||||
print(f"Origin UTM coordinates [x, y]: [{origin_utm_xy.x}, {origin_utm_xy.y}]")
|
||||
print(
|
||||
f"Grid dimensions [I, J, K]: [{grid_dimensions.i}, {grid_dimensions.j}, {grid_dimensions.k}]"
|
||||
)
|
||||
|
@ -149,25 +149,27 @@ grpc::Status RiaGrpcGridGeometryExtractionService::GetGridSurface( grpc::ServerC
|
||||
m_elapsedTimeInfo.elapsedTimePerEventMs["CreateGridSurfaceVertices"] =
|
||||
static_cast<std::uint32_t>( createVerticesTimeCount.elapsedMsCount() );
|
||||
|
||||
// Retrieve the UTM offset
|
||||
const auto mainGridModelOffset = m_eclipseCase->mainGrid()->displayModelOffset();
|
||||
|
||||
// Set vertex_array and quadindicesarr response
|
||||
auto fillResponseTimeCount = ElapsedTimeCount();
|
||||
auto fillResponseTimeCount = ElapsedTimeCount();
|
||||
const auto zAxisOffset = mainGridModelOffset.z();
|
||||
for ( size_t i = 0; i < gridSurfaceVertices->size(); ++i )
|
||||
{
|
||||
const auto& vertex = gridSurfaceVertices->get( i );
|
||||
response->add_vertexarray( vertex.x() );
|
||||
response->add_vertexarray( vertex.y() );
|
||||
response->add_vertexarray( vertex.z() );
|
||||
response->add_vertexarray( vertex.z() + zAxisOffset );
|
||||
|
||||
response->add_quadindicesarr( static_cast<google::protobuf::uint32>( i ) );
|
||||
}
|
||||
|
||||
// Origin in utm is the offset
|
||||
rips::Vec3d* modelOffset = new rips::Vec3d;
|
||||
const auto mainGridModelOffset = m_eclipseCase->mainGrid()->displayModelOffset();
|
||||
modelOffset->set_x( mainGridModelOffset.x() );
|
||||
modelOffset->set_y( mainGridModelOffset.y() );
|
||||
modelOffset->set_z( mainGridModelOffset.z() );
|
||||
response->set_allocated_originutm( modelOffset );
|
||||
// Origin is the UTM offset
|
||||
rips::Vec2d* originUtmXy = new rips::Vec2d;
|
||||
originUtmXy->set_x( mainGridModelOffset.x() );
|
||||
originUtmXy->set_y( mainGridModelOffset.y() );
|
||||
response->set_allocated_originutmxy( originUtmXy );
|
||||
|
||||
// Source cell indices from main grid part manager
|
||||
std::vector<size_t> sourceCellIndicesArray = std::vector<size_t>();
|
||||
|
Loading…
Reference in New Issue
Block a user