Horizon
tool_place_net_label.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "schematic/net_label.hpp"
4 #include "tool_place_junction.hpp"
5 #include "tool_helper_draw_net_setting.hpp"
6 #include <forward_list>
7 
8 namespace horizon {
9 
10 class ToolPlaceNetLabel : public ToolPlaceJunction, public ToolHelperDrawNetSetting {
11 public:
12  ToolPlaceNetLabel(IDocument *c, ToolID tid);
13  bool can_begin() override;
14  std::set<InToolActionID> get_actions() const override
15  {
16  using I = InToolActionID;
17  return {
18  I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::MIRROR, I::NET_LABEL_SIZE_INC, I::NET_LABEL_SIZE_DEC,
19  I::ENTER_SIZE,
20  };
21  }
22 
23 protected:
24  std::forward_list<NetLabel *> labels_placed;
25  void create_attached() override;
26  void delete_attached() override;
27  bool begin_attached() override;
28  bool update_attached(const ToolArgs &args) override;
29  bool check_line(LineNet *li) override;
30  NetLabel *la = nullptr;
31  Orientation last_orientation = Orientation::RIGHT;
32  void apply_settings() override;
33 };
34 } // namespace horizon
horizon::ToolPlaceNetLabel::can_begin
bool can_begin() override