Horizon
core_padstack.hpp
1 #pragma once
2 #include "common/layer.hpp"
3 #include "core.hpp"
4 #include "pool/padstack.hpp"
5 #include "pool/pool.hpp"
6 #include <deque>
7 #include <iostream>
8 #include <memory>
9 
10 namespace horizon {
11 class CorePadstack : public Core {
12 public:
13  CorePadstack(const std::string &filename, Pool &pool);
14  bool has_object_type(ObjectType ty) override;
15 
16  class LayerProvider *get_layer_provider() override;
17 
18  void rebuild(bool from_undo = false) override;
19  void commit() override;
20  void revert() override;
21  void save() override;
22 
23  Padstack *get_padstack(bool work = true);
24 
25  bool set_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
26  const class PropertyValue &value) override;
27  bool get_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
28  class PropertyValue &value) override;
29  bool get_property_meta(ObjectType type, const UUID &uu, ObjectProperty::ID property,
30  class PropertyMeta &meta) override;
31 
32  std::string get_display_name(ObjectType type, const UUID &uu) override;
33 
34  const Padstack *get_canvas_data();
35  std::pair<Coordi, Coordi> get_bbox() override;
36 
37 private:
38  std::map<UUID, Polygon> *get_polygon_map(bool work = true) override;
39  std::map<UUID, Hole> *get_hole_map(bool work = true) override;
40 
41  Padstack padstack;
42  std::string m_filename;
43 
44  class HistoryItem : public Core::HistoryItem {
45  public:
46  HistoryItem(const Padstack &s) : padstack(s)
47  {
48  }
49  Padstack padstack;
50  };
51  void history_push() override;
52  void history_load(unsigned int i) override;
53 
54 public:
55  std::string parameter_program_code;
56  ParameterSet parameter_set;
57  std::set<ParameterID> parameters_required;
58 };
59 } // namespace horizon
Definition: core_padstack.hpp:11
void rebuild(bool from_undo=false) override
Expands the non-working document.
Definition: core_padstack.cpp:215
Definition: core_properties.hpp:7
Definition: padstack.hpp:21
Where Tools and and documents meet.
Definition: core.hpp:232
Definition: layer_provider.hpp:7
Definition: core_properties.hpp:77
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
Definition: block.cpp:9
Definition: core.hpp:449