satdump/src-core/handler/vector/shapefile_handler.h

41 lines
1.1 KiB
C
Raw Normal View History

2025-02-03 07:48:52 +01:00
#pragma once
#include "../handler.h"
#include "common/image/image.h"
2025-04-14 19:03:42 +01:00
#include "common/map/shapefile.h"
2025-02-03 07:48:52 +01:00
namespace satdump
{
namespace viewer
{
class ShapefileHandler : public Handler
{
public:
ShapefileHandler();
ShapefileHandler(std::string shapefile);
~ShapefileHandler();
2025-02-07 14:31:18 +01:00
std::string shapefile_name;
2025-02-03 07:48:52 +01:00
std::unique_ptr<shapefile::Shapefile> file;
2025-02-07 14:31:18 +01:00
nlohmann::json dbf_file;
ImVec4 color_to_draw = {0, 1, 0, 1};
2025-02-03 07:48:52 +01:00
2025-04-14 19:03:42 +01:00
void draw_to_image(image::Image &img,
std::function<std::pair<double, double>(double, double, double, double)> projectionFunc);
2025-02-03 07:48:52 +01:00
// The Rest
void drawMenu();
void drawContents(ImVec2 win_size);
void drawMenuBar();
void setConfig(nlohmann::json p);
nlohmann::json getConfig();
2025-02-07 14:31:18 +01:00
std::string getName() { return shapefile_name; }
2025-02-03 07:48:52 +01:00
std::string getID() { return "shapefile_handler"; }
};
2025-04-14 19:03:42 +01:00
} // namespace viewer
} // namespace satdump