KiCad PCB EDA Suite
Loading...
Searching...
No Matches
array_tool.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, you may find one here:
18
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19
* or you may search the http://www.gnu.org website for the version 2 license,
20
* or you may write to the Free Software Foundation, Inc.,
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22
*/
23
24
#pragma once
25
26
#include <memory>
27
28
#include <wx/event.h>
29
30
#include <
math/vector2d.h
>
31
#include <
tools/pcb_tool_base.h
>
32
#include <
tools/pcb_selection.h
>
33
34
class
ARRAY_OPTIONS
;
35
class
BOARD_COMMIT
;
36
class
DIALOG_CREATE_ARRAY
;
37
47
class
ARRAY_TOOL
:
public
PCB_TOOL_BASE
,
public
wxEvtHandler
48
{
49
public
:
50
ARRAY_TOOL
();
51
~ARRAY_TOOL
();
52
53
void
Reset
(
RESET_REASON
aReason )
override
;
54
56
bool
Init
()
override
;
57
61
int
CreateArray
(
const
TOOL_EVENT
& aEvent );
62
67
// int DoCreateArray( const VECTOR2I& anchor, const VECTOR2I& translation );
68
70
void
setTransitions
()
override
;
71
72
private
:
73
void
onDialogClosed
( wxCloseEvent& aEvent );
74
75
DIALOG_CREATE_ARRAY
*
m_dialog
;
76
std::unique_ptr<ARRAY_OPTIONS>
m_array_opts
;
77
std::unique_ptr<PCB_SELECTION>
m_selection
;
78
};
ARRAY_OPTIONS
Options that govern the setup of an "array" of multiple item.
Definition:
array_options.h:38
ARRAY_TOOL
The array tool.
Definition:
array_tool.h:48
ARRAY_TOOL::onDialogClosed
void onDialogClosed(wxCloseEvent &aEvent)
Definition:
array_tool.cpp:112
ARRAY_TOOL::CreateArray
int CreateArray(const TOOL_EVENT &aEvent)
Invoke a dialog box to allow positioning of the item relative to another by an exact amount.
Definition:
array_tool.cpp:72
ARRAY_TOOL::Init
bool Init() override
Init() is called once upon a registration of the tool.
Definition:
array_tool.cpp:66
ARRAY_TOOL::m_array_opts
std::unique_ptr< ARRAY_OPTIONS > m_array_opts
Definition:
array_tool.h:76
ARRAY_TOOL::m_dialog
DIALOG_CREATE_ARRAY * m_dialog
Definition:
array_tool.h:75
ARRAY_TOOL::m_selection
std::unique_ptr< PCB_SELECTION > m_selection
Definition:
array_tool.h:77
ARRAY_TOOL::ARRAY_TOOL
ARRAY_TOOL()
Definition:
array_tool.cpp:51
ARRAY_TOOL::setTransitions
void setTransitions() override
Position the m_position_relative_selection selection relative to anchor position using the given tran...
Definition:
array_tool.cpp:298
ARRAY_TOOL::~ARRAY_TOOL
~ARRAY_TOOL()
Definition:
array_tool.cpp:56
BOARD_COMMIT
Definition:
board_commit.h:47
DIALOG_CREATE_ARRAY
Definition:
dialog_create_array.h:41
PCB_TOOL_BASE
Definition:
pcb_tool_base.h:71
TOOL_BASE::RESET_REASON
RESET_REASON
Determine the reason of reset for a tool.
Definition:
tool_base.h:78
TOOL_EVENT
Generic, UI-independent tool event.
Definition:
tool_event.h:167
Reset
void Reset() override
pcb_selection.h
pcb_tool_base.h
vector2d.h
src
pcbnew
tools
array_tool.h
Generated on Sun Dec 22 2024 00:05:29 for KiCad PCB EDA Suite by
1.9.6