From d046e18c43d883eb7d60cf77aac60a8782044a6c Mon Sep 17 00:00:00 2001 From: esther Date: Mon, 29 Apr 2024 15:02:50 +0200 Subject: [PATCH] changed to create a vector --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bf2fc46..503d81f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,7 +13,7 @@ #include #include -CellMap produce_cellmap(HeightMap* heightmap, float z) +std::vector produce_cellmap(HeightMap* heightmap, float z) { int length = (heightmap->width-1)*(heightmap->height-1); uint8_t *cells = (uint8_t *) CPLMalloc(sizeof(uint8_t)*length); @@ -27,24 +27,24 @@ CellMap produce_cellmap(HeightMap* heightmap, float z) (heightmap->get_pixel(x,y+1)>z)*8; if (result != 0 and result != 15 ) { points.push_back(Point(x, y, result)); - + }; } - return CellMap(heightmap->width-1, heightmap->height-1, cells, heightmap->reference_system, heightmap->geotransform); + return points; } -std::vector vector_cellmap(HeightMap* heightmap, int interval) +std::vector> vector_cellmap(HeightMap* heightmap, int interval) { int num_contours = (heightmap->max - heightmap->min)/interval; - std::vector vector_contours; + std::vector> vector_contours; omp_set_num_threads(12); #pragma omp parallel { - std::vector vec_private; + std::vector> vec_private; #pragma omp for for (int i = 1; i <= num_contours; i++) {