Horizon
object_descr.hpp
1 #pragma once
2 #include "common.hpp"
3 #include <map>
4 
5 namespace horizon {
7 public:
8  enum class Type { BOOL, INT, STRING, STRING_RO, LENGTH, LAYER, LAYER_COPPER, NET_CLASS, ENUM, DIM, ANGLE, ANGLE90 };
9  enum class ID {
10  NAME,
11  NAME_VISIBLE,
12  PAD_VISIBLE,
13  LENGTH,
14  SIZE,
15  TEXT,
16  REFDES,
17  VALUE,
18  IS_POWER,
19  OFFSHEET_REFS,
20  WIDTH,
21  LAYER,
22  DIAMETER,
23  PLATED,
24  FLIPPED,
25  NET_CLASS,
26  WIDTH_FROM_RULES,
27  MPN,
28  SHAPE,
29  PARAMETER_CLASS,
30  POSITION_X,
31  POSITION_Y,
32  ANGLE,
33  MIRROR,
34  PAD_TYPE,
35  FROM_RULES,
36  DISPLAY_DIRECTIONS,
37  USAGE,
38  MODE,
39  DIFFPAIR,
40  LOCKED,
41  DOT,
42  CLOCK,
43  SCHMITT,
44  DRIVER,
45  ALTERNATE_PACKAGE,
46  POWER_SYMBOL_STYLE,
47  PIN_NAME_DISPLAY
48  };
49  ObjectProperty(Type t, const std::string &l, int o = 0, const std::vector<std::pair<int, std::string>> &its = {})
50  : type(t), label(l), enum_items(its), order(o)
51  {
52  }
53 
54  Type type;
55  std::string label;
56  std::vector<std::pair<int, std::string>> enum_items;
57  int order = 0;
58 };
59 
61 public:
62  ObjectDescription(const std::string &n, const std::string &n_pl,
63  const std::map<ObjectProperty::ID, ObjectProperty> &props)
64  : name(n), name_pl(n_pl), properties(props)
65  {
66  }
67 
68  std::string name;
69  std::string name_pl;
70  const std::map<ObjectProperty::ID, ObjectProperty> properties;
71 };
72 
73 extern const std::map<ObjectType, ObjectDescription> object_descriptions;
74 } // namespace horizon
Definition: object_descr.hpp:60
Class SHAPE.
Definition: shape.h:57
Definition: object_descr.hpp:6
Definition: block.cpp:7