Horizon
tool_place_shape.hpp
1 #pragma once
2 #include "common/shape.hpp"
3 #include "core/tool.hpp"
4 #include <forward_list>
5 
6 namespace horizon {
7 
8 class ToolPlaceShape : public ToolBase {
9 public:
10  ToolPlaceShape(IDocument *c, ToolID tid);
11  ToolResponse begin(const ToolArgs &args) override;
12  ToolResponse update(const ToolArgs &args) override;
13  bool can_begin() override;
14 
15 protected:
16  Shape *temp = 0;
17  std::forward_list<Shape *> shapes_placed;
18 
19  void create_shape(const Coordi &c);
20 };
21 } // namespace horizon
horizon::ToolPlaceShape::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_place_shape.cpp:39
horizon::IDocument
Definition: idocument.hpp:5
horizon::Shape
For commonly used Pad shapes.
Definition: shape.hpp:19
horizon::Coord< int64_t >
horizon::ToolPlaceShape::can_begin
bool can_begin() override
Definition: tool_place_shape.cpp:14
horizon::ToolBase
Common interface for all Tools.
Definition: tool.hpp:136
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::ToolPlaceShape
Definition: tool_place_shape.hpp:8
horizon::ToolPlaceShape::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_shape.cpp:19