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 protected:
15  void construct() override;
16  bool handle_broadcast(const json &j) override;
17  void handle_maybe_drag() override;
18  void update_action_sensitivity() override;
19  void apply_preferences() override;
20 
21  ActionCatalogItem::Availability get_editor_type_for_action() const
22  {
23  return ActionCatalogItem::AVAILABLE_IN_BOARD;
24  };
25  ObjectType get_editor_type() const override
26  {
27  return ObjectType::BOARD;
28  }
29 
30  std::string get_hud_text(std::set<SelectableRef> &sel) override;
31 
32 private:
33  void canvas_update() override;
34  void handle_selection_cross_probe();
35 
36  CoreBoard core_board;
37 
38  class FabOutputWindow *fab_output_window = nullptr;
39  class View3DWindow *view_3d_window = nullptr;
40  class StepExportWindow *step_export_window = nullptr;
41  class TuningWindow *tuning_window = nullptr;
42  bool cross_probing_enabled = false;
43 
44  Coordf cursor_pos_drag_begin;
45  Target target_drag_begin;
46 
47  void handle_drag();
48  void handle_measure_tracks(const ActionConnection &a);
49 
50  class CanvasAnnotation *text_owner_annotation = nullptr;
51  std::map<UUID, UUID> text_owners;
52  void update_text_owners();
53  void update_text_owner_annotation();
54 };
55 } // namespace horizon
Definition: annotation.hpp:7
Definition: 3d_view.hpp:9
Definition: target.hpp:6
Definition: imp_board.hpp:6
a class to store JSON values
Definition: json.hpp:161
Definition: fab_output_window.hpp:9
Definition: imp_layer.hpp:5
Definition: imp.hpp:27
Definition: step_export_window.hpp:7
Definition: tuning_window.hpp:9
Definition: action.hpp:89
Definition: block.cpp:9
Definition: core_board.hpp:11