Horizon
Loading...
Searching...
No Matches
core_decal.hpp
1#pragma once
2#include "pool/decal.hpp"
3#include "core.hpp"
4#include "nlohmann/json.hpp"
5#include "document/idocument_decal.hpp"
6
7namespace horizon {
8class CoreDecal : public Core, public IDocumentDecal {
9public:
10 CoreDecal(const std::string &decal_filename, IPool &pool);
11 bool has_object_type(ObjectType ty) const override;
12
13 Decal &get_decal() override;
14 const Decal &get_canvas_data() const;
15 class LayerProvider &get_layer_provider() override;
16
17 std::pair<Coordi, Coordi> get_bbox() override;
18
19 const std::string &get_filename() const override;
20
21 ObjectType get_object_type() const override
22 {
23 return ObjectType::DECAL;
24 }
25
26 const FileVersion &get_version() const override
27 {
28 return decal.version;
29 }
30
31 void set_temp_mode();
32 void set_filename(const std::string &filename);
33
34private:
35 std::map<UUID, Polygon> *get_polygon_map() override;
36 std::map<UUID, Junction> *get_junction_map() override;
37 std::map<UUID, Text> *get_text_map() override;
38 std::map<UUID, Line> *get_line_map() override;
39 std::map<UUID, Arc> *get_arc_map() override;
40
41 Decal decal;
42
43 std::string m_decal_filename;
44
45 void rebuild_internal(bool from_undo, const std::string &comment) override;
46 std::unique_ptr<HistoryManager::HistoryItem> make_history_item(const std::string &comment) override;
47 void history_load(const HistoryManager::HistoryItem &it) override;
48 void save(const std::string &suffix) override;
49 void delete_autosave() override;
50};
51} // namespace horizon
Definition core_decal.hpp:8
Where Tools and and documents meet.
Definition core.hpp:42
Definition decal.hpp:16
Definition file_version.hpp:9
Definition history_manager.hpp:10
Definition idocument_decal.hpp:5
Definition ipool.hpp:15
Definition layer_provider.hpp:8