Horizon
tool_place_power_symbol.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_place_junction_schematic.hpp"
4 #include <forward_list>
5 
6 namespace horizon {
7 
9 public:
10  using ToolPlaceJunctionSchematic::ToolPlaceJunctionSchematic;
11 
12  bool can_begin() override;
13  std::set<InToolActionID> get_actions() const override
14  {
15  using I = InToolActionID;
16  return {
17  I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::MIRROR,
18  };
19  }
20 
21 protected:
22  void create_attached() override;
23  void delete_attached() override;
24  bool begin_attached() override;
25  bool junction_placed() override;
26  bool update_attached(const ToolArgs &args) override;
27  bool check_line(LineNet *li) override;
28  class PowerSymbol *sym = nullptr;
29  std::forward_list<PowerSymbol *> symbols_placed;
30  Net *net = nullptr;
31 
32 private:
33  bool do_merge(Net *other);
34 };
35 } // namespace horizon
LineNet is similar to Line, except it denotes electrical connection.
Definition: line_net.hpp:17
Definition: net.hpp:11
GND symbols and the like.
Definition: power_symbol.hpp:16
This is what a Tool receives when the user did something.
Definition: tool_pub.hpp:23
Definition: tool_place_junction_schematic.hpp:6
Definition: tool_place_power_symbol.hpp:8
bool can_begin() override
Definition: tool_place_power_symbol.cpp:10