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) const 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 
22  Padstack *get_padstack(bool work = true);
23 
24  bool set_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
25  const class PropertyValue &value) override;
26  bool get_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
27  class PropertyValue &value) override;
28  bool get_property_meta(ObjectType type, const UUID &uu, ObjectProperty::ID property,
29  class PropertyMeta &meta) override;
30 
31  std::string get_display_name(ObjectType type, const UUID &uu) override;
32 
33  const Padstack *get_canvas_data();
34  std::pair<Coordi, Coordi> get_bbox() override;
35 
36  const std::string &get_filename() const override;
37 
38 private:
39  std::map<UUID, Polygon> *get_polygon_map(bool work = true) override;
40  std::map<UUID, Hole> *get_hole_map(bool work = true) override;
41 
42  Padstack padstack;
43  std::string m_filename;
44 
45  class HistoryItem : public Core::HistoryItem {
46  public:
47  HistoryItem(const Padstack &s) : padstack(s)
48  {
49  }
50  Padstack padstack;
51  };
52  void history_push() override;
53  void history_load(unsigned int i) override;
54  void save(const std::string &suffix) override;
55  void delete_autosave() override;
56 
57 public:
58  std::string parameter_program_code;
59  ParameterSet parameter_set;
60  std::set<ParameterID> parameters_required;
61 };
62 } // namespace horizon
horizon::CorePadstack::rebuild
void rebuild(bool from_undo=false) override
Expands the non-working document.
Definition: core_padstack.cpp:218
horizon::LayerProvider
Definition: layer_provider.hpp:7
horizon::Padstack
Definition: padstack.hpp:21
horizon::CorePadstack
Definition: core_padstack.hpp:11
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::PropertyMeta
Definition: core_properties.hpp:77
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::Pool
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:21
horizon::Core::HistoryItem
Definition: core.hpp:498
horizon::PropertyValue
Definition: core_properties.hpp:7