Horizon
junction.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include "util/layer_range.hpp"
6 #include <vector>
7 
8 namespace horizon {
9 using json = nlohmann::json;
10 
20 class Junction {
21 public:
22  Junction(const UUID &uu, const json &j);
23  Junction(const UUID &uu);
24 
25  UUID uuid;
26  Coord<int64_t> position;
27 
28  UUID get_uuid() const;
29 
30  // not stored
31  LayerRange layer = 10000;
32  std::vector<UUID> connected_lines;
33  std::vector<UUID> connected_arcs;
34  void clear();
35 
36  json serialize() const;
37  virtual ~Junction()
38  {
39  }
40 };
41 } // namespace horizon
A Junction is a point in 2D-Space.
Definition: junction.hpp:20
Definition: layer_range.hpp:7
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:166
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61