SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
shapefile_handler.h
1#pragma once
2
3#include "../handler.h"
4
5#include "common/map/shapefile.h"
6#include "image/image.h"
7
8namespace satdump
9{
10 namespace handlers
11 {
12 class ShapefileHandler : public Handler
13 {
14 public:
15 ShapefileHandler();
16 ShapefileHandler(std::string shapefile);
17 ~ShapefileHandler();
18
19 std::string shapefile_name;
20 std::unique_ptr<shapefile::Shapefile> file;
21 nlohmann::json dbf_file;
22 bool has_dbf = false;
23
24 ImVec4 color_to_draw = {0, 1, 0, 1};
25 int font_size = 20;
26 int scalerank_filter = 3;
27
28 void draw_to_image(image::Image &img, std::function<std::pair<double, double>(double, double, double, double)> projectionFunc);
29
30 // The Rest
31 void drawMenu();
32 void drawContents(ImVec2 win_size);
33 void drawMenuBar();
34
35 void setConfig(nlohmann::json p);
36 nlohmann::json getConfig();
37
38 std::string getName() { return shapefile_name; }
39
40 std::string getID() { return "shapefile_handler"; }
41 };
42 } // namespace handlers
43} // namespace satdump
SatDump's handler base class.
Definition handler.h:32
void drawMenu()
Render explorer menu left sidebar.
Definition shapefile_handler.cpp:45
void setConfig(nlohmann::json p)
Optional, allows setting a configuration/state from JSON.
Definition shapefile_handler.cpp:117
nlohmann::json getConfig()
Optional, allows getting a configuration/state as JSON.
Definition shapefile_handler.cpp:133
void drawContents(ImVec2 win_size)
Render explorer contents (center/left)
Definition shapefile_handler.cpp:58
std::string getName()
Get this handler's readable name.
Definition shapefile_handler.h:38
void drawMenuBar()
Render explorer menu bar (in the left sidebar)
Definition shapefile_handler.cpp:56
Definition image.h:17
Core Image class.