Horizon
hole.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "util/uuid_provider.hpp"
5 #include "nlohmann/json_fwd.hpp"
6 #include "polygon.hpp"
7 #include <vector>
8 #include <map>
9 #include <fstream>
10 #include "util/placement.hpp"
11 
12 
13 namespace horizon {
14 using json = nlohmann::json;
15 
19 class Hole : public UUIDProvider {
20 public:
21  Hole(const UUID &uu, const json &j);
22  Hole(const UUID &uu);
23 
24  UUID uuid;
25  Placement placement;
26  uint64_t diameter = 0.5_mm;
27  uint64_t length = 0.5_mm;
28  std::string parameter_class;
29 
34  bool plated = false;
35 
36  enum class Shape { ROUND, SLOT };
37  Shape shape = Shape::ROUND;
38 
39  Polygon to_polygon() const;
40 
41 
42  virtual UUID get_uuid() const;
43 
44  // not stored
45  json serialize() const;
46 };
47 } // namespace horizon
horizon::Polygon
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition: polygon.hpp:27
horizon::Shape
For commonly used Pad shapes.
Definition: shape.hpp:19
nlohmann::json
basic_json<> json
default JSON class
Definition: json_fwd.hpp:61
horizon::Hole::plated
bool plated
true if this hole is PTH, false if NPTH.
Definition: hole.hpp:34
libzip::uint64_t
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:161
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::UUIDProvider
Interface for objects that have a UUID.
Definition: uuid_provider.hpp:9
horizon::Placement
Definition: placement.hpp:8
horizon::Hole
A hole with diameter and position, that's it.
Definition: hole.hpp:19