Horizon
Loading...
Searching...
No Matches
tool_place_hole.hpp
1#pragma once
2#include "core/tool.hpp"
3#include <forward_list>
4
5namespace horizon {
6
7class ToolPlaceHole : public ToolBase {
8public:
9 using ToolBase::ToolBase;
10 ToolResponse begin(const ToolArgs &args) override;
11 ToolResponse update(const ToolArgs &args) override;
12 bool can_begin() override;
13 std::set<InToolActionID> get_actions() const override
14 {
15 using I = InToolActionID;
16 return {
17 I::LMB,
18 I::CANCEL,
19 I::RMB,
20 };
21 }
22
23protected:
24 class Hole *temp = 0;
25 std::forward_list<Hole *> holes_placed;
26
27 void create_hole(const Coordi &c);
28};
29} // namespace horizon
A hole with diameter and position, that's it.
Definition hole.hpp:15
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_hole.hpp:7
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_place_hole.cpp:15
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_place_hole.cpp:38
bool can_begin() override
Definition tool_place_hole.cpp:10
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40