Horizon
shape.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 "util/placement.hpp"
7 #include "polygon.hpp"
8 #include <vector>
9 #include <map>
10 #include <fstream>
11 
12 
13 namespace horizon {
14 using json = nlohmann::json;
15 
19 class Shape : public UUIDProvider {
20 public:
21  Shape(const UUID &uu, const json &j);
22  Shape(const UUID &uu);
23 
24  UUID uuid;
25  Placement placement;
26  int layer = 0;
27  std::string parameter_class;
28 
29  enum class Form { CIRCLE, RECTANGLE, OBROUND };
30  Form form = Form::CIRCLE;
31  std::vector<int64_t> params;
32 
33  Polygon to_polygon() const;
34  std::pair<Coordi, Coordi> get_bbox() const;
35 
36  virtual UUID get_uuid() const;
37 
38  json serialize() const;
39 };
40 } // 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
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