Horizon
imp_board.hpp
1 #pragma once
2 #include "core/core_board.hpp"
3 #include "imp_layer.hpp"
4 #include "airwire_filter.hpp"
5 #include "search/searcher_board.hpp"
6 
7 namespace horizon {
8 class ImpBoard : public ImpLayer {
9 public:
10  ImpBoard(const std::string &board_filename, const std::string &block_filename, const std::string &via_dir,
11  const PoolParams &params);
12 
13  const std::map<int, Layer> &get_layers();
14  void update_highlights() override;
15 
16  std::map<ObjectType, SelectionFilterInfo> get_selection_filter_info() const override;
17 
18 protected:
19  void construct() override;
20  bool handle_broadcast(const json &j) override;
21  void handle_maybe_drag() override;
22  void update_action_sensitivity() override;
23  void apply_preferences() override;
24 
25  ActionCatalogItem::Availability get_editor_type_for_action() const override
26  {
27  return ActionCatalogItem::AVAILABLE_IN_BOARD;
28  };
29  ObjectType get_editor_type() const override
30  {
31  return ObjectType::BOARD;
32  }
33 
34  std::string get_hud_text(std::set<SelectableRef> &sel) override;
35  std::pair<ActionID, ToolID> get_doubleclick_action(ObjectType type, const UUID &uu) override;
36 
37  void get_save_meta(json &j) override;
38  std::vector<std::string> get_view_hints() override;
39 
40  Searcher *get_searcher_ptr() override
41  {
42  return &searcher;
43  }
44 
45 private:
46  void canvas_update() override;
47  void handle_selection_cross_probe();
48 
49  CoreBoard core_board;
50  const std::string project_dir;
51  SearcherBoard searcher;
52 
53  class FabOutputWindow *fab_output_window = nullptr;
54  class View3DWindow *view_3d_window = nullptr;
55  class StepExportWindow *step_export_window = nullptr;
56  class TuningWindow *tuning_window = nullptr;
57  class PDFExportWindow *pdf_export_window = nullptr;
58  class BoardDisplayOptionsBox *board_display_options_box = nullptr;
59  class PnPExportWindow *pnp_export_window = nullptr;
60  class AirwireFilterWindow *airwire_filter_window = nullptr;
61  bool cross_probing_enabled = false;
62 
63  Coordf cursor_pos_drag_begin;
64  Target target_drag_begin;
65 
66  void handle_drag();
67  void handle_measure_tracks(const ActionConnection &a);
68 
69  class CanvasAnnotation *text_owner_annotation = nullptr;
70  std::map<UUID, UUID> text_owners;
71  void update_text_owners();
72  void update_text_owner_annotation();
73 
74  void handle_select_more(const ActionConnection &conn);
75 
76  class UnplacedBox *unplaced_box = nullptr;
77  void update_unplaced();
78 
79  void update_airwires();
80 
81  int get_schematic_pid();
82 
83  AirwireFilter airwire_filter;
84 };
85 } // namespace horizon
horizon::UnplacedBox
Definition: unplaced_box.hpp:9
horizon::ImpBoard
Definition: imp_board.hpp:8
horizon::CanvasAnnotation
Definition: annotation.hpp:7
horizon::AirwireFilter
Definition: airwire_filter.hpp:9
horizon::AirwireFilterWindow
Definition: airwire_filter_window.hpp:7
horizon::CoreBoard
Definition: core_board.hpp:12
horizon::Coord< float >
horizon::PDFExportWindow
Definition: pdf_export_window.hpp:12
horizon::StepExportWindow
Definition: step_export_window.hpp:10
horizon::PoolParams
Definition: imp.hpp:27
horizon::Target
Definition: target.hpp:6
horizon::PnPExportWindow
Definition: pnp_export_window.hpp:13
horizon::SearcherBoard
Definition: searcher_board.hpp:5
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:165
horizon::Searcher
Definition: searcher.hpp:8
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::View3DWindow
Definition: 3d_view.hpp:9
horizon::FabOutputWindow
Definition: fab_output_window.hpp:11
horizon::BoardDisplayOptionsBox
Definition: board_display_options.hpp:7
horizon::TuningWindow
Definition: tuning_window.hpp:9
horizon::ActionConnection
Definition: action.hpp:115
horizon::ImpLayer
Definition: imp_layer.hpp:5