Horizon
Loading...
Searching...
No Matches
object_descr.hpp
1#pragma once
2#include "common.hpp"
3#include <map>
4
5namespace horizon {
7public:
8 enum class Type {
9 BOOL,
10 INT,
11 STRING,
12 STRING_RO,
13 STRING_MULTILINE,
14 LENGTH,
15 LAYER,
16 LAYER_COPPER,
17 NET_CLASS,
18 ENUM,
19 DIM,
20 ANGLE,
21 ANGLE90,
22 GROUP,
23 TAG,
24 EXPAND,
25 OPACITY,
26 PRIORITY,
27 SCALE,
29 };
30 enum class ID {
31 NAME,
32 NAME_VISIBLE,
33 PAD_VISIBLE,
34 LENGTH,
35 SIZE,
36 TEXT,
37 REFDES,
38 VALUE,
39 IS_POWER,
40 OFFSHEET_REFS,
41 WIDTH,
42 HEIGHT,
43 FORM,
44 LAYER,
45 DIAMETER,
46 PLATED,
47 FLIPPED,
48 NET_CLASS,
49 WIDTH_FROM_RULES,
50 MPN,
51 SHAPE,
52 PARAMETER_CLASS,
53 POSITION_X,
54 POSITION_Y,
55 ANGLE,
56 MIRROR,
57 PAD_TYPE,
58 FROM_RULES,
59 DISPLAY_DIRECTIONS,
60 USAGE,
61 MODE,
62 DIFFPAIR,
63 LOCKED,
64 DOT,
65 CLOCK,
66 SCHMITT,
67 DRIVER,
68 ALTERNATE_PACKAGE,
69 POWER_SYMBOL_STYLE,
70 PIN_NAME_DISPLAY,
71 PIN_NAME_ORIENTATION,
72 FONT,
73 KEEPOUT_CLASS,
74 DISPLAY_ALL_PADS,
75 GROUP,
76 TAG,
77 EXPAND,
78 OMIT_SILKSCREEN,
79 FIXED,
80 NOPOPULATE,
81 OMIT_OUTLINE,
82 ON_TOP,
83 OPACITY,
84 PRIORITY,
85 SCALE,
86 ALLOW_UPSIDE_DOWN,
87 DIRECTION,
88 IS_PORT,
89 SPAN,
90 VIA_DEFINITION,
91 };
92 ObjectProperty(Type t, const std::string &l, int o = 0, const std::vector<std::pair<int, std::string>> &its = {})
93 : type(t), label(l), enum_items(its), order(o)
94 {
95 }
96
97 Type type;
98 std::string label;
99 std::vector<std::pair<int, std::string>> enum_items;
100 int order = 0;
101};
102
104public:
105 ObjectDescription(const std::string &n, const std::string &n_pl,
106 const std::map<ObjectProperty::ID, ObjectProperty> &props)
107 : name(n), name_pl(n_pl), properties(props)
108 {
109 }
110
111 std::string name;
112 std::string name_pl;
113 const std::map<ObjectProperty::ID, ObjectProperty> properties;
114
115 const std::string &get_name_for_n(size_t n) const;
116};
117
118extern const std::map<ObjectType, ObjectDescription> object_descriptions;
119} // namespace horizon
Represent a contiguous set of PCB layers.
Definition pns_layerset.h:32
An abstract shape on 2D plane.
Definition shape.h:117
Definition object_descr.hpp:103
Definition object_descr.hpp:6