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 #include "document/idocument_padstack.hpp"
10 
11 namespace horizon {
12 class CorePadstack : public Core, public virtual IDocumentPadstack {
13 public:
14  CorePadstack(const std::string &filename, Pool &pool);
15  bool has_object_type(ObjectType ty) const override;
16 
17  class LayerProvider *get_layer_provider() override;
18 
19  void rebuild(bool from_undo = false) override;
20 
21  Padstack *get_padstack() override;
22 
23  bool set_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
24  const class PropertyValue &value) override;
25  bool get_property(ObjectType type, const UUID &uu, ObjectProperty::ID property,
26  class PropertyValue &value) override;
27  bool get_property_meta(ObjectType type, const UUID &uu, ObjectProperty::ID property,
28  class PropertyMeta &meta) override;
29 
30  std::string get_display_name(ObjectType type, const UUID &uu) override;
31 
32  const Padstack *get_canvas_data();
33  std::pair<Coordi, Coordi> get_bbox() override;
34 
35  const std::string &get_filename() const override;
36 
37 private:
38  std::map<UUID, Polygon> *get_polygon_map() override;
39  std::map<UUID, Hole> *get_hole_map() 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  void save(const std::string &suffix) override;
54  void delete_autosave() override;
55 
56 public:
57  std::string parameter_program_code;
58  ParameterSet parameter_set;
59  std::set<ParameterID> parameters_required;
60 };
61 } // namespace horizon
horizon::IDocumentPadstack
Definition: idocument_padstack.hpp:5
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:12
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:47
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:191
horizon::PropertyValue
Definition: core_properties.hpp:7