Horizon
tool_place_hole.hpp
1 #pragma once
2 #include "common/hole.hpp"
3 #include "core/tool.hpp"
4 #include <forward_list>
5 
6 namespace horizon {
7 
8 class ToolPlaceHole : public ToolBase {
9 public:
10  ToolPlaceHole(IDocument *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14  std::set<InToolActionID> get_actions() const override
15  {
16  using I = InToolActionID;
17  return {
18  I::LMB,
19  I::CANCEL,
20  I::RMB,
21  };
22  }
23 
24 protected:
25  Hole *temp = 0;
26  std::forward_list<Hole *> holes_placed;
27 
28  void create_hole(const Coordi &c);
29 };
30 } // namespace horizon
horizon::IDocument
Definition: idocument.hpp:5
horizon::ToolPlaceHole::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_hole.cpp:19
horizon::Coord< int64_t >
horizon::ToolPlaceHole::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_place_hole.cpp:42
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:121
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: tool.hpp:23
horizon::ToolPlaceHole
Definition: tool_place_hole.hpp:8
horizon::ToolPlaceHole::can_begin
bool can_begin() override
Definition: tool_place_hole.cpp:14
horizon::Hole
A hole with diameter and position, that's it.
Definition: hole.hpp:18