Horizon
Loading...
Searching...
No Matches
dimension.hpp
1#pragma once
2#include "util/uuid.hpp"
3#include "nlohmann/json_fwd.hpp"
4#include "common.hpp"
5
6namespace horizon {
7using json = nlohmann::json;
8
9class Dimension {
10public:
11 Dimension(const UUID &uu, const json &j);
12 Dimension(const UUID &uu);
13
14 UUID uuid;
15 Coordi p0;
16 Coordi p1;
17 int64_t label_distance = 3_mm;
18 uint64_t label_size = 1.5_mm;
19
20 enum class Mode { HORIZONTAL, VERTICAL, DISTANCE };
21 Mode mode = Mode::DISTANCE;
22
23 int64_t project(const Coordi &c) const;
24 int64_t get_length() const;
25
26 json serialize() const;
27};
28} // namespace horizon
Definition dimension.hpp:9
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16
a class to store JSON values
Definition json.hpp:177
basic_json<> json
default JSON class
Definition json_fwd.hpp:62