Horizon
Loading...
Searching...
No Matches
tool_drag_polygon_edge.hpp
1#pragma once
2#include "core/tool.hpp"
3#include "util/keep_slope_util.hpp"
4#include "tool_helper_plane.hpp"
5
6namespace horizon {
7
8class ToolDragPolygonEdge : public virtual ToolBase, public ToolHelperPlane {
9public:
10 using ToolBase::ToolBase;
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 std::set<InToolActionID> get_actions() const override
19 {
20 using I = InToolActionID;
21 return {
22 I::LMB,
23 I::CANCEL,
24 I::RMB,
25 };
26 }
27
28private:
29 class PolyInfo : public KeepSlopeInfo {
30 public:
31 PolyInfo(const class Polygon &poly, int edge);
32
33 Coordi arc_center_orig;
34 };
35 std::optional<PolyInfo> poly_info;
36 bool circle_mode = false;
37
38 class Polygon *poly = nullptr;
39 unsigned int edge = 0;
40 Coordi pos_orig;
41 void update_tip();
42};
43} // namespace horizon
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_drag_polygon_edge.hpp:8
bool can_begin() override
Definition tool_drag_polygon_edge.cpp:10
bool is_specific() override
Definition tool_drag_polygon_edge.hpp:14
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_drag_polygon_edge.cpp:71
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_drag_polygon_edge.cpp:34
Definition tool_helper_plane.hpp:5
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40