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  ToolResponse begin(const ToolArgs &args) override;
13 
14  bool can_begin() override;
15  std::set<InToolActionID> get_actions() const override
16  {
17  using I = InToolActionID;
18  return {
19  I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::MIRROR,
20  };
21  }
22 
23 protected:
24  void create_attached() override;
25  void delete_attached() override;
26  bool begin_attached() override;
27  bool junction_placed() override;
28  bool update_attached(const ToolArgs &args) override;
29  bool check_line(LineNet *li) override;
30  class PowerSymbol *sym = nullptr;
31  std::forward_list<PowerSymbol *> symbols_placed;
32  Net *net = nullptr;
33 
34 private:
35  bool do_merge(Net *other);
36 };
37 } // 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:12
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_power_symbol.cpp:17
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool_pub.hpp:40