Horizon
imp_board.hpp
1 #pragma once
2 #include "core/core_board.hpp"
3 #include "imp_layer.hpp"
4 
5 namespace horizon {
6 class ImpBoard : public ImpLayer {
7 public:
8  ImpBoard(const std::string &board_filename, const std::string &block_filename, const std::string &via_dir,
9  const PoolParams &params);
10 
11  const std::map<int, Layer> &get_layers();
12  void update_highlights() override;
13 
14  std::map<ObjectType, SelectionFilterInfo> get_selection_filter_info() const override;
15 
16 protected:
17  void construct() override;
18  bool handle_broadcast(const json &j) override;
19  void handle_maybe_drag() override;
20  void update_action_sensitivity() override;
21  void apply_preferences() override;
22 
23  ActionCatalogItem::Availability get_editor_type_for_action() const override
24  {
25  return ActionCatalogItem::AVAILABLE_IN_BOARD;
26  };
27  ObjectType get_editor_type() const override
28  {
29  return ObjectType::BOARD;
30  }
31 
32  std::string get_hud_text(std::set<SelectableRef> &sel) override;
33  std::pair<ActionID, ToolID> get_doubleclick_action(ObjectType type, const UUID &uu) override;
34 
35 private:
36  void canvas_update() override;
37  void handle_selection_cross_probe();
38 
39  CoreBoard core_board;
40  const std::string project_dir;
41 
42  class FabOutputWindow *fab_output_window = nullptr;
43  class View3DWindow *view_3d_window = nullptr;
44  class StepExportWindow *step_export_window = nullptr;
45  class TuningWindow *tuning_window = nullptr;
46  class PDFExportWindow *pdf_export_window;
47  bool cross_probing_enabled = false;
48 
49  Coordf cursor_pos_drag_begin;
50  Target target_drag_begin;
51 
52  void handle_drag();
53  void handle_measure_tracks(const ActionConnection &a);
54 
55  class CanvasAnnotation *text_owner_annotation = nullptr;
56  std::map<UUID, UUID> text_owners;
57  void update_text_owners();
58  void update_text_owner_annotation();
59 
60  void handle_select_more(const ActionConnection &conn);
61 
62  int get_schematic_pid();
63 };
64 } // namespace horizon
horizon::ImpBoard
Definition: imp_board.hpp:6
horizon::CanvasAnnotation
Definition: annotation.hpp:7
horizon::CoreBoard
Definition: core_board.hpp:11
horizon::Coord< float >
horizon::PDFExportWindow
Definition: pdf_export_window.hpp:12
horizon::StepExportWindow
Definition: step_export_window.hpp:7
horizon::PoolParams
Definition: imp.hpp:25
horizon::Target
Definition: target.hpp:6
nlohmann::basic_json
a class to store JSON values
Definition: json.hpp:161
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::TuningWindow
Definition: tuning_window.hpp:9
horizon::ActionConnection
Definition: action.hpp:106
horizon::ImpLayer
Definition: imp_layer.hpp:5