Horizon
tool_draw_dimension.hpp
1 #pragma once
2 #include "core/tool.hpp"
3 #include "tool_helper_restrict.hpp"
4 
5 namespace horizon {
6 class ToolDrawDimension : public ToolBase, public ToolHelperRestrict {
7 public:
8  ToolDrawDimension(IDocument *c, ToolID tid);
9  ToolResponse begin(const ToolArgs &args) override;
10  ToolResponse update(const ToolArgs &args) override;
11  bool can_begin() override;
12  std::set<InToolActionID> get_actions() const override
13  {
14  using I = InToolActionID;
15  return {
16  I::LMB, I::CANCEL, I::RMB, I::RESTRICT, I::DIMENSION_MODE, I::ENTER_DATUM,
17  };
18  }
19 
20 private:
21  class Dimension *temp = nullptr;
22  void update_tip();
23 
24  enum class State { P0, P1, LABEL };
25  State state = State::P0;
26 };
27 } // namespace horizon
horizon::ToolDrawDimension::can_begin
bool can_begin() override
horizon::ToolDrawDimension::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
horizon::ToolDrawDimension::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
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