Horizon
tool_place_pad.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "parameter/set.hpp"
4 
5 namespace horizon {
6 class ToolPlacePad : public ToolBase {
7 public:
8  using ToolBase::ToolBase;
9  ToolResponse begin(const ToolArgs &args) override;
10  ToolResponse update(const ToolArgs &args) override;
11  bool can_begin() override;
12  std::set<InToolActionID> get_actions() const override
13  {
14  using I = InToolActionID;
15  return {
16  I::LMB, I::CANCEL, I::RMB, I::ROTATE, I::EDIT,
17  };
18  }
19 
20 private:
21  const class Padstack *padstack = nullptr;
22  class Pad *temp = nullptr;
23  ParameterSet temp_param;
24  void create_pad(const Coordi &c);
25 };
26 } // namespace horizon
Definition: pad.hpp:15
Definition: padstack.hpp:21
This is what a Tool receives when the user did something.
Definition: tool_pub.hpp:23
Common interface for all Tools.
Definition: tool_pub.hpp:94
Definition: tool_place_pad.hpp:6
bool can_begin() override
Definition: tool_place_pad.cpp:10
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_pad.cpp:15
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_place_pad.cpp:54
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool_pub.hpp:40