Horizon
tool_move.hpp
1 #pragma once
2 #include "core.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(Core *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 selection_center;
25  void update_selection_center();
26  void expand_selection();
27  void update_tip();
28  void do_move(const Coordi &c);
29 
30  void collect_nets();
31  std::set<UUID> nets;
32 
33  bool update_airwires = true;
34  void finish();
35  bool is_key = false;
36  Coordi key_delta;
37 
38  std::set<class Plane *> planes;
39 };
40 } // namespace horizon
horizon::ToolMove::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_move.cpp:191
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:387
horizon::ToolMove::can_begin
bool can_begin() override
Definition: tool_move.cpp:311
horizon::ToolMove::handles_esc
bool handles_esc() override
Definition: tool_move.hpp:18
horizon::Coord
Your typical coordinate class.
Definition: common.hpp:72
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: core.hpp:26
horizon::ToolMove
Definition: tool_move.hpp:8
horizon::ToolHelperMerge
Definition: tool_helper_merge.hpp:5