Horizon
imp_board.hpp
1 #pragma once
2 #include "core/core_board.hpp"
3 #include "imp_layer.hpp"
4 #include "search/searcher_board.hpp"
5 
6 namespace horizon {
7 class ImpBoard : public ImpLayer {
8 public:
9  ImpBoard(const std::string &board_filename, const std::string &block_filename, const std::string &pictures_dir,
10  const PoolParams &params);
11 
12  const std::map<int, Layer> &get_layers();
13 
14  std::map<ObjectType, SelectionFilterInfo> get_selection_filter_info() const override;
15 
16  ~ImpBoard();
17 
18 protected:
19  void construct() override;
20  bool handle_broadcast(const json &j) override;
21  void handle_maybe_drag(bool ctrl) override;
22  void update_action_sensitivity() override;
23  void apply_preferences() override;
24  void update_highlights() override;
25 
26  ActionCatalogItem::Availability get_editor_type_for_action() const override
27  {
28  return ActionCatalogItem::AVAILABLE_IN_BOARD;
29  };
30 
31  std::string get_hud_text(std::set<SelectableRef> &sel) override;
32  ActionToolID get_doubleclick_action(ObjectType type, const UUID &uu) override;
33 
34  void get_save_meta(json &j) override;
35  std::vector<std::string> get_view_hints() override;
36 
37  Searcher *get_searcher_ptr() override
38  {
39  return &searcher;
40  }
41 
42  ToolID get_tool_for_drag_move(bool ctrl, const std::set<SelectableRef> &sel) const override;
43 
44  void update_monitor() override;
45 
46 private:
47  void canvas_update() override;
48  void handle_selection_cross_probe() override;
49 
50  CoreBoard core_board;
51  const std::string project_dir;
52  SearcherBoard searcher;
53 
54  class FabOutputWindow *fab_output_window = nullptr;
55  class View3DWindow *view_3d_window = nullptr;
56  class StepExportWindow *step_export_window = nullptr;
57  class TuningWindow *tuning_window = nullptr;
58  class PDFExportWindow *pdf_export_window = nullptr;
59  class BoardDisplayOptionsBox *board_display_options_box = nullptr;
60  class PnPExportWindow *pnp_export_window = nullptr;
61  class AirwireFilterWindow *airwire_filter_window = nullptr;
62  class PartsWindow *parts_window = nullptr;
63  bool cross_probing_enabled = false;
64 
65  Coordf cursor_pos_drag_begin;
66  Target target_drag_begin;
67 
68  void handle_drag();
69  void handle_measure_tracks(const ActionConnection &a);
70 
71  class CanvasAnnotation *text_owner_annotation = nullptr;
72  std::map<UUID, UUID> text_owners;
73  void update_text_owners();
74  void update_text_owner_annotation();
75 
76  void handle_select_more(const ActionConnection &conn);
77 
78  class UnplacedBox *unplaced_box = nullptr;
79  void update_unplaced();
80 
81  void update_airwires();
82 
83  int get_schematic_pid();
84 
85  class CanvasAnnotation *airwire_annotation = nullptr;
86  void update_airwire_annotation();
87  void update_net_colors();
88  void apply_net_colors();
89  std::map<UUID, uint8_t> net_color_map;
90 
91  Gtk::Popover *reload_netlist_popover = nullptr;
92  sigc::connection reload_netlist_delay_conn;
93 
94  UUID net_from_selectable(const SelectableRef &sr);
95 
96  void handle_show_in_pool_manager(const ActionConnection &conn);
97 };
98 } // namespace horizon
Definition: action.hpp:87
Definition: airwire_filter_window.hpp:12
Definition: board_display_options.hpp:7
Definition: annotation.hpp:7
Definition: core_board.hpp:10
Definition: fab_output_window.hpp:11
Definition: imp_board.hpp:7
Definition: imp_layer.hpp:5
Definition: pdf_export_window.hpp:12
Definition: parts_window.hpp:11
Definition: pnp_export_window.hpp:13
Definition: imp.hpp:27
Definition: searcher_board.hpp:5
Definition: searcher.hpp:9
Definition: selectables.hpp:34
Definition: step_export_window.hpp:10
Definition: target.hpp:7
Definition: tuning_window.hpp:9
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: 3d_view.hpp:11
a class to store JSON values
Definition: json.hpp:177
Definition: action.hpp:13