Horizon
tool_helper_map_symbol.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 
4 namespace horizon {
5 class ToolHelperMapSymbol : public virtual ToolBase {
6 public:
7  using ToolBase::ToolBase;
8 
9  class Settings : public ToolSettings {
10  public:
11  json serialize() const override;
12  void load_from_json(const json &j) override;
13  std::map<UUID, UUID> selected_symbols;
14  };
15 
16  ToolSettings *get_settings() override
17  {
18  return &settings;
19  }
20 
21  ToolID get_tool_id_for_settings() const override;
22 
23 protected:
24  class SchematicSymbol *map_symbol(class Component *c, const class Gate *g, const UUID &sym_default = UUID());
25  const class Symbol *get_symbol_for_unit(const UUID &unit_uu, bool *auto_selected = nullptr,
26  const UUID &sym_default = UUID());
27  void change_symbol(class SchematicSymbol *schsym);
28 
29 private:
30  Settings settings;
31 };
32 } // namespace horizon
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
Definition: gate.hpp:13
Definition: schematic_symbol.hpp:17
Definition: symbol.hpp:71
Common interface for all Tools.
Definition: tool.hpp:96
Definition: tool_helper_map_symbol.hpp:9
Definition: tool_helper_map_symbol.hpp:5
Definition: tool.hpp:84
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
a class to store JSON values
Definition: json.hpp:170