Horizon
Loading...
Searching...
No Matches
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
9namespace horizon {
10using json = nlohmann::json;
11
15class Shape {
16public:
17 Shape(const UUID &uu, const json &j);
18 Shape(const UUID &uu);
19
20 UUID uuid;
21 Placement placement;
22 int layer = 0;
23 std::string parameter_class;
24
25 enum class Form { CIRCLE, RECTANGLE, OBROUND };
26 Form form = Form::CIRCLE;
27 std::vector<int64_t> params;
28
29 Polygon to_polygon() const;
30 std::pair<Coordi, Coordi> get_bbox() const;
31
32 UUID get_uuid() const;
33
34 json serialize() const;
35};
36} // namespace horizon
Represent basic circle geometry with utility geometry functions.
Definition circle.h:33
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