Horizon
Loading...
Searching...
No Matches
odb_util.hpp
1#pragma once
2#include "common/common.hpp"
3#include "util/placement.hpp"
4#include <ostream>
5
6namespace horizon {
7class LayerRange;
8}
9namespace horizon::ODB {
10
11extern const char *endl;
12
13std::ostream &operator<<(std::ostream &os, const Coordi &c);
14
15struct Angle {
16 explicit Angle(int a) : angle((((65536 - a) % 65536) * (360. / 65536.)))
17 {
18 }
19 explicit Angle(const Placement &pl) : Angle(pl.get_angle())
20 {
21 }
22 const double angle;
23};
24
25std::ostream &operator<<(std::ostream &os, Angle a);
26
27struct Dim {
28 explicit Dim(int64_t x) : dim(x / 1e6)
29 {
30 }
31 explicit Dim(uint64_t x) : dim(x / 1e6)
32 {
33 }
34 explicit Dim(double x) : dim(x / 1e6)
35 {
36 }
37 const double dim;
38};
39
40std::ostream &operator<<(std::ostream &os, Dim d);
41
42struct DimUm {
43 explicit DimUm(int64_t x) : dim(x / 1e3)
44 {
45 }
46 explicit DimUm(uint64_t x) : dim(x / 1e3)
47 {
48 }
49 const double dim;
50};
51
52std::ostream &operator<<(std::ostream &os, DimUm d);
53
54std::string utf8_to_ascii(const std::string &s);
55std::string make_legal_name(const std::string &n);
56std::string make_legal_entity_name(const std::string &s);
57std::string get_layer_name(int id);
58std::string get_drills_layer_name(const LayerRange &span);
59
60std::string make_symbol_circle(uint64_t diameter);
61std::string make_symbol_rect(uint64_t w, uint64_t h);
62std::string make_symbol_oval(uint64_t w, uint64_t h);
63
64
65} // namespace horizon::ODB
Definition layer_range.hpp:11
Definition placement.hpp:8
Definition odb_util.hpp:15
Definition odb_util.hpp:42
Definition odb_util.hpp:27