Horizon
Loading...
Searching...
No Matches
imp_schematic.hpp
1#pragma once
2#include "imp.hpp"
3#include "core/core_schematic.hpp"
4#include "search/searcher_schematic.hpp"
5
6namespace horizon {
7class ImpSchematic : public ImpBase {
8
9public:
10 ImpSchematic(const CoreSchematic::Filenames &filenames, const PoolParams &params);
11
12protected:
13 void construct() override;
14 bool handle_broadcast(const json &j) override;
15 void handle_maybe_drag(bool ctrl) override;
16 void update_action_sensitivity() override;
17 void update_highlights() override;
18 void clear_highlights() override;
19
20 ActionCatalogItem::Availability get_editor_type_for_action() const override
21 {
22 return ActionCatalogItem::AVAILABLE_IN_SCHEMATIC;
23 };
24
25 std::string get_hud_text(std::set<SelectableRef> &sel) override;
26 void search_center(const Searcher::SearchResult &res) override;
27 ActionToolID get_doubleclick_action(ObjectType type, const UUID &uu) override;
28 void expand_selection_for_property_panel(std::set<SelectableRef> &sel_extra,
29 const std::set<SelectableRef> &sel) override;
30
31 Searcher *get_searcher_ptr() override
32 {
33 return &searcher;
34 }
35
36 ToolID get_tool_for_drag_move(bool ctrl, const std::set<SelectableRef> &sel) const override;
37
38 void update_monitor() override;
39
40 std::map<ObjectType, ImpBase::SelectionFilterInfo> get_selection_filter_info() const override;
41
42 void apply_preferences() override;
43
44private:
45 void canvas_update() override;
46 CoreSchematic core_schematic;
47 const std::string project_dir;
48 SearcherSchematic searcher;
49
50 int handle_ask_net_merge(class Net *net, class Net *into);
51 int handle_ask_delete_component(class Component *comp);
52 void handle_select_sheet(const UUID &sheet, const UUID &block, const UUIDVec &instance_path);
53 void handle_core_rebuilt();
54 void handle_tool_change(ToolID id) override;
55 void handle_move_to_other_sheet(const ActionConnection &conn);
56 void handle_highlight_group_tag(const ActionConnection &conn);
57 void handle_next_prev_sheet(const ActionConnection &conn);
58 const Entity *entity_from_selection(const std::set<SelectableRef> &sel);
59
60 struct ViewInfo {
61 float scale;
62 Coordf offset;
63 HistoryManager selection_history_manager;
64 };
65 std::map<std::pair<UUID, UUID>, ViewInfo> view_infos;
66 ViewInfo &get_view_info(const UUID &sheet, const UUID &block);
67 HistoryManager &get_selection_history_manager() override;
68
69 class SheetBox *sheet_box;
70 UUID current_sheet;
71 void handle_selection_cross_probe() override;
72 bool cross_probing_enabled = false;
73
74 Coordf cursor_pos_drag_begin;
75 Target target_drag_begin;
76
77 class BOMExportWindow *bom_export_window;
78 class PDFExportWindow *pdf_export_window;
79 class UnplacedBox *unplaced_box = nullptr;
80 void update_unplaced();
81
82 void handle_drag();
83
84 void handle_extra_button(const GdkEventButton *button_event) override;
85
86 Glib::RefPtr<Gio::SimpleAction> toggle_snap_to_targets_action;
87
88 int get_board_pid();
89
90 UUID net_from_selectable(const SelectableRef &sr);
91
92 std::vector<class ActionButton *> action_buttons_schematic;
93 ActionButton &add_action_button_schematic(ActionToolID id);
94
95 struct HighlightItem {
96 ObjectType type;
97 UUID uuid;
98 UUIDVec instance_path;
99 };
100
101 std::vector<HighlightItem> highlights_hierarchical;
102
103 void update_instance_path_bar();
104 UUIDVec instance_path_for_bar;
105
106 const Block &get_block_for_group_tag_names() override;
107
108 void handle_show_in_pool_manager(const ActionConnection &conn);
109};
110} // namespace horizon
Definition action_button.hpp:33
Definition action.hpp:87
Definition bom_export_window.hpp:16
A block is one level of hierarchy in the netlist.
Definition block.hpp:29
A Component is an instanced Entity in a Block.
Definition component.hpp:40
Definition core_schematic.hpp:16
Definition core_schematic.hpp:14
Definition entity.hpp:13
Definition history_manager.hpp:8
Definition net.hpp:11
Definition pdf_export_window.hpp:12
Definition imp.hpp:28
Definition searcher_schematic.hpp:5
Definition searcher.hpp:58
Definition searcher.hpp:9
Definition selectables.hpp:35
Definition sheet_box.hpp:8
Definition target.hpp:7
This class encapsulates a UUID and allows it to be uses as a value type.
Definition uuid.hpp:16
Definition unplaced_box.hpp:9
Definition action.hpp:13