Horizon
dimension.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "nlohmann/json_fwd.hpp"
4 #include "common.hpp"
5 #include <vector>
6 #include <map>
7 #include <fstream>
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
12 class Dimension {
13 public:
14  Dimension(const UUID &uu, const json &j);
15  Dimension(const UUID &uu);
16 
17  UUID uuid;
18  Coordi p0;
19  Coordi p1;
20  int64_t label_distance = 3_mm;
21  uint64_t label_size = 1.5_mm;
22 
23  enum class Mode { HORIZONTAL, VERTICAL, DISTANCE };
24  Mode mode = Mode::DISTANCE;
25 
26  int64_t project(const Coordi &c) const;
27  int64_t get_length() const;
28 
29  json serialize() const;
30 };
31 } // namespace horizon
libzip::int64_t
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:166
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
libzip::uint64_t
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108