Horizon
tool_add_part.hpp
1 #pragma once
2 #include "core.hpp"
3 #include "tool_helper_map_symbol.hpp"
4 #include "tool_helper_move.hpp"
5 
6 namespace horizon {
8 public:
9  ToolAddPart(Core *c, ToolID tid);
10  ToolResponse begin(const ToolArgs &args) override;
11  ToolResponse update(const ToolArgs &args) override;
12  bool can_begin() override;
13 
14  class ToolDataAddPart : public ToolData {
15  public:
16  ToolDataAddPart(const UUID &uu) : part_uuid(uu)
17  {
18  }
19  const UUID part_uuid;
20  };
21 
22 private:
23  unsigned int current_gate = 0;
24  class SchematicSymbol *sym_current = nullptr;
25  std::vector<const class Gate *> gates;
26  class Component *comp = nullptr;
27  void update_tip();
28  UUID create_tag();
29 };
30 } // namespace horizon
horizon::ToolAddPart
Definition: tool_add_part.hpp:7
horizon::ToolData
Definition: tool_data.hpp:4
horizon::ToolHelperMove
Definition: tool_helper_move.hpp:6
horizon::ToolAddPart::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_add_part.cpp:27
horizon::ToolAddPart::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_add_part.cpp:93
horizon::SchematicSymbol
Definition: schematic_symbol.hpp:19
horizon::ToolAddPart::ToolDataAddPart
Definition: tool_add_part.hpp:14
horizon::Component
A Component is an instanced Entity in a Block.
Definition: component.hpp:39
horizon::ToolHelperMapSymbol
Definition: tool_helper_map_symbol.hpp:5
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
horizon::ToolAddPart::can_begin
bool can_begin() override
Definition: tool_add_part.cpp:14
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: core.hpp:26