mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2024-11-25 00:20:18 +00:00
Fixed some errors
This commit is contained in:
parent
25354cc115
commit
1a10f0df33
@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.0)
|
||||
find_package(GDAL CONFIG REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
src/HeightMap.cpp src/main.cpp
|
||||
src/HeightMap.cpp src/CaseMap.cpp src/main.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,11 +1,4 @@
|
||||
#include <gdal/gdal.h>
|
||||
#include "gdal/gdal_priv.h"
|
||||
#include <iostream>
|
||||
|
||||
#include <stdfloat>
|
||||
|
||||
#include "CaseMap.hh"
|
||||
#include "HeightMap.hh"
|
||||
|
||||
CaseMap::CaseMap(int width, int height, int* cases)
|
||||
{
|
@ -4,10 +4,10 @@
|
||||
class CaseMap
|
||||
{
|
||||
public:
|
||||
float* data;
|
||||
int* cases;
|
||||
int width; //!< width of image in cases
|
||||
int height; //!< height of image in cases
|
||||
|
||||
CaseMap(int width, int height, int* cases);
|
||||
float get_case(int x,int y);
|
||||
int get_case(int x,int y);
|
||||
};
|
12
src/main.cpp
12
src/main.cpp
@ -4,14 +4,17 @@
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
#include <gdal/gdal.h>
|
||||
#include "gdal/gdal_priv.h"
|
||||
#include <gdal/gdal_frmts.h>
|
||||
|
||||
std::vector<CaseMap> produce_casemap(HeightMap* heightmap)
|
||||
{
|
||||
std::vector<CaseMap> output;
|
||||
int* test = (int *) CPLMalloc(sizeof(int)*heightmap->width*heightmap->height);
|
||||
*(test + 4) = 13;
|
||||
CaseMap casemap1(heightmap->width-1, heightmap->height-1, test);
|
||||
output.push_back(casemap1);
|
||||
return output
|
||||
return output;
|
||||
}
|
||||
//(int a, int b, )
|
||||
|
||||
@ -23,7 +26,7 @@ int main(int argc, const char* argv[])
|
||||
|
||||
std::cout << "x: " << map.width << " y: " << map.height << "\n";
|
||||
std::cout << "max: " << map.max << " min: " << map.min << "\n";
|
||||
|
||||
/*
|
||||
for (int y = 0; y < map.height; y++)
|
||||
{
|
||||
for (int x = 0; x < map.width; x++)
|
||||
@ -32,7 +35,8 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
std::cout << "\n";
|
||||
}
|
||||
*/
|
||||
std::cout << "\nend🤡\n";
|
||||
casemap = produce_casemap(map);
|
||||
std::cout << casemap.get_case( 2, 2)
|
||||
auto casemap = produce_casemap(&map);
|
||||
std::cout << casemap[0].get_case( 4, 0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user