Horizon
shape.hpp
1 #pragma once
2 #include "util/uuid.hpp"
3 #include "common.hpp"
4 #include "nlohmann/json_fwd.hpp"
5 #include "util/placement.hpp"
6 #include "polygon.hpp"
7 #include <vector>
8 #include <map>
9 #include <fstream>
10 
11 
12 namespace horizon {
13 using json = nlohmann::json;
14 
18 class Shape {
19 public:
20  Shape(const UUID &uu, const json &j);
21  Shape(const UUID &uu);
22 
23  UUID uuid;
24  Placement placement;
25  int layer = 0;
26  std::string parameter_class;
27 
28  enum class Form { CIRCLE, RECTANGLE, OBROUND };
29  Form form = Form::CIRCLE;
30  std::vector<int64_t> params;
31 
32  Polygon to_polygon() const;
33  std::pair<Coordi, Coordi> get_bbox() const;
34 
35  UUID get_uuid() const;
36 
37  json serialize() const;
38 };
39 } // namespace horizon
Definition: placement.hpp:8
Polygon used in Padstack, Package and Board for specifying filled Regions.
Definition: polygon.hpp:27
For commonly used Pad shapes.
Definition: shape.hpp:18
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