Horizon
src
core
tool_draw_line.hpp
1
#pragma once
2
#include "core.hpp"
3
4
namespace
horizon
{
5
6
class
ToolDrawLine
:
public
ToolBase
{
7
public
:
8
ToolDrawLine
(
Core
*c, ToolID tid);
9
ToolResponse
begin
(
const
ToolArgs
&args)
override
;
10
ToolResponse
update
(
const
ToolArgs
&args)
override
;
11
bool
can_begin
()
override
;
12
bool
handles_esc
()
override
13
{
14
return
true
;
15
}
16
17
private
:
18
Junction
*temp_junc = 0;
19
Line
*temp_line = 0;
20
void
update_tip();
21
bool
first_line =
true
;
22
};
23
}
// namespace horizon
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition:
core.hpp:108
horizon::Line
Graphical line.
Definition:
line.hpp:19
horizon::ToolDrawLine::handles_esc
bool handles_esc() override
Definition:
tool_draw_line.hpp:12
horizon::ToolDrawLine::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition:
tool_draw_line.cpp:43
horizon::ToolDrawLine::can_begin
bool can_begin() override
Definition:
tool_draw_line.cpp:12
horizon::ToolDrawLine
Definition:
tool_draw_line.hpp:6
horizon::Core
Where Tools and and documents meet.
Definition:
core.hpp:249
horizon::ToolDrawLine::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition:
tool_draw_line.cpp:17
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition:
core.hpp:126
horizon
Definition:
block.cpp:7
horizon::ToolBase
Common interface for all Tools.
Definition:
core.hpp:170
horizon::Junction
A Junction is a point in 2D-Space.
Definition:
junction.hpp:25
Generated by
1.8.13