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  void set_window_title(const std::string &s) override;
26 
27  ActionCatalogItem::Availability get_editor_type_for_action() const override
28  {
29  return ActionCatalogItem::AVAILABLE_IN_BOARD;
30  };
31 
32  std::string get_hud_text(std::set<SelectableRef> &sel) override;
33  ActionToolID get_doubleclick_action(ObjectType type, const UUID &uu) override;
34 
35  void get_save_meta(json &j) override;
36  std::vector<std::string> get_view_hints() override;
37 
38  Searcher *get_searcher_ptr() override
39  {
40  return &searcher;
41  }
42 
43  ToolID get_tool_for_drag_move(bool ctrl, const std::set<SelectableRef> &sel) const override;
44 
45  void update_monitor() override;
46 
47 private:
48  void canvas_update() override;
49  void handle_selection_cross_probe() override;
50 
51  CoreBoard core_board;
52  const std::string project_dir;
53  SearcherBoard searcher;
54 
55  class FabOutputWindow *fab_output_window = nullptr;
56  class View3DWindow *view_3d_window = nullptr;
57  class StepExportWindow *step_export_window = nullptr;
58  class TuningWindow *tuning_window = nullptr;
59  class PDFExportWindow *pdf_export_window = nullptr;
60  class BoardDisplayOptionsBox *board_display_options_box = nullptr;
61  class PnPExportWindow *pnp_export_window = nullptr;
62  class AirwireFilterWindow *airwire_filter_window = nullptr;
63  class PartsWindow *parts_window = nullptr;
64  bool cross_probing_enabled = false;
65 
66  Coordf cursor_pos_drag_begin;
67  Target target_drag_begin;
68 
69  void handle_drag();
70  void handle_measure_tracks(const ActionConnection &a);
71 
72  class CanvasAnnotation *text_owner_annotation = nullptr;
73  std::map<UUID, UUID> text_owners;
74  void update_text_owners();
75  void update_text_owner_annotation();
76 
77  void handle_select_more(const ActionConnection &conn);
78 
79  class UnplacedBox *unplaced_box = nullptr;
80  void update_unplaced();
81 
82  void update_airwires();
83 
84  int get_schematic_pid();
85 
86  class CanvasAnnotation *airwire_annotation = nullptr;
87  void update_airwire_annotation();
88  void update_net_colors();
89  void apply_net_colors();
90  std::map<UUID, uint8_t> net_color_map;
91 
92  Gtk::Popover *reload_netlist_popover = nullptr;
93  sigc::connection reload_netlist_delay_conn;
94 
95  UUID net_from_selectable(const SelectableRef &sr);
96 
97  void handle_show_in_pool_manager(const ActionConnection &conn);
98 };
99 } // 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:12
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:14
Definition: imp.hpp:28
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