Horizon
core_frame.hpp
1 #pragma once
2 #include "frame/frame.hpp"
3 #include "core.hpp"
4 #include <iostream>
5 #include <memory>
6 #include "nlohmann/json.hpp"
7 
8 namespace horizon {
9 class CoreFrame : public Core {
10 public:
11  CoreFrame(const std::string &frame_filename);
12  bool has_object_type(ObjectType ty) const override;
13 
14  Frame *get_frame();
15  const Frame *get_canvas_data() const;
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  std::pair<Coordi, Coordi> get_bbox() override;
24 
25  const std::string &get_filename() const override;
26 
27 private:
28  std::map<UUID, Polygon> *get_polygon_map(bool work = true) override;
29  std::map<UUID, Junction> *get_junction_map(bool work = true) override;
30  std::map<UUID, Text> *get_text_map(bool work = true) override;
31  std::map<UUID, Line> *get_line_map(bool work = true) override;
32  std::map<UUID, Arc> *get_arc_map(bool work = true) override;
33 
34  Frame frame;
35 
36  std::string m_frame_filename;
37 
38  class HistoryItem : public Core::HistoryItem {
39  public:
40  HistoryItem(const Frame &r);
41  Frame frame;
42  };
43  void history_push() override;
44  void history_load(unsigned int i) override;
45 };
46 } // namespace horizon
Definition: frame.hpp:21
Where Tools and and documents meet.
Definition: core.hpp:240
Definition: layer_provider.hpp:7
Definition: block.cpp:9
Definition: core.hpp:489
Definition: core_frame.hpp:9
void rebuild(bool from_undo=false) override
Expands the non-working document.
Definition: core_frame.cpp:55