Horizon
tool_move.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_helper_merge.hpp"
4 #include "tool_helper_move.hpp"
5 
6 namespace horizon {
7 
8 class ToolMove : public ToolHelperMove, public ToolHelperMerge {
9 public:
10  ToolMove(IDocument *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14  bool is_specific() override
15  {
16  return true;
17  }
18  bool handles_esc() override
19  {
20  return true;
21  }
22 
23 private:
24  Coordi get_selection_center();
25  void expand_selection();
26  void update_tip();
27  void do_move(const Coordi &c);
28 
29  void collect_nets();
30  std::set<UUID> nets;
31 
32  bool update_airwires = true;
33  void finish();
34  bool is_key = false;
35  Coordi key_delta;
36 
37  std::set<class Plane *> planes;
38 };
39 } // namespace horizon
horizon::ToolMove::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_move.cpp:201
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolMove::is_specific
bool is_specific() override
Definition: tool_move.hpp:14
horizon::ToolHelperMove
Definition: tool_helper_move.hpp:6
horizon::ToolMove::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_move.cpp:384
horizon::ToolMove::can_begin
bool can_begin() override
Definition: tool_move.cpp:324
horizon::ToolMove::handles_esc
bool handles_esc() override
Definition: tool_move.hpp:18
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:74
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:48
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:22
horizon::ToolMove
Definition: tool_move.hpp:8
horizon::ToolHelperMerge
Definition: tool_helper_merge.hpp:5