Horizon
hole.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include "polygon.hpp"
6 #include "util/placement.hpp"
7 
8 
9 namespace horizon {
10 using json = nlohmann::json;
11 
15 class Hole {
16 public:
17  Hole(const UUID &uu, const json &j);
18  Hole(const UUID &uu);
19 
20  UUID uuid;
21  Placement placement;
22  uint64_t diameter = 0.5_mm;
23  uint64_t length = 0.5_mm;
24  std::string parameter_class;
25 
30  bool plated = false;
31 
32  enum class Shape { ROUND, SLOT };
33  Shape shape = Shape::ROUND;
34 
35  Polygon to_polygon() const;
36 
37 
38  UUID get_uuid() const;
39 
40  // not stored
41  json serialize() const;
42 };
43 } // namespace horizon
A hole with diameter and position, that's it.
Definition: hole.hpp:15
bool plated
true if this hole is PTH, false if NPTH.
Definition: hole.hpp:30
Definition: placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition: polygon.hpp:25
For commonly used Pad shapes.
Definition: shape.hpp:15
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