-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathslippymap-annotations.hh
65 lines (50 loc) · 1.21 KB
/
slippymap-annotations.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <string>
#include <stdbool.h>
#include "orb_viewport.hpp"
#include "orb_layer.hpp"
extern "C"
{
#include "horizonator.h"
}
// A class to markup the slippy map. It draws
//
// - The view point
// - The bounds of the azimuth being viewed
// - The point picked by the user from the render
// - The extents of the loaded DEMs
// this or less means "no pick". Duplicated in .cc
#define MIN_VALID_ANGLE -1000.0f
struct view_t
{
float az_center_deg;
float az_radius_deg;
float lat;
float lon;
};
class SlippymapAnnotations : public orb_layer
{
const view_t* view;
const horizonator_context_t* ctx;
float pick_lat, pick_lon;
public:
SlippymapAnnotations(const view_t* _view, const horizonator_context_t* _ctx)
: view(_view), ctx(_ctx),
pick_lat(MIN_VALID_ANGLE),
pick_lon(MIN_VALID_ANGLE)
{
name(std::string("Slippy-map annotations"));
}
void set_pick( float lat, float lon )
{
pick_lat = lat;
pick_lon = lon;
}
void unset_pick(void)
{
pick_lat = MIN_VALID_ANGLE;
}
// The one big-ish function. In the .cc file
void draw(const orb_viewport &viewport);
};
#undef MIN_VALID_ANGLE