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 The 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, see <https://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <memory>
23
24
#include <wx/event.h>
25
26
#include <
math/vector2d.h
>
27
#include <
tools/pcb_tool_base.h
>
28
#include <
tools/pcb_selection.h
>
29
30
class
ARRAY_OPTIONS
;
31
class
BOARD_COMMIT
;
32
class
DIALOG_CREATE_ARRAY
;
33
42
43
class
ARRAY_TOOL
:
public
PCB_TOOL_BASE
,
public
wxEvtHandler
44
{
45
public
:
46
ARRAY_TOOL
();
47
~ARRAY_TOOL
();
48
49
void
Reset
(
RESET_REASON
aReason )
override
;
50
52
bool
Init
()
override
;
53
57
int
CreateArray
(
const
TOOL_EVENT
& aEvent );
58
63
// int DoCreateArray( const VECTOR2I& anchor, const VECTOR2I& translation );
64
66
void
setTransitions
()
override
;
67
68
private
:
69
void
onDialogClosed
( wxCloseEvent& aEvent );
70
71
DIALOG_CREATE_ARRAY
*
m_dialog
;
72
std::unique_ptr<ARRAY_OPTIONS>
m_array_opts
;
73
std::unique_ptr<PCB_SELECTION>
m_selection
;
74
};
ARRAY_OPTIONS
Options that govern the setup of an "array" of multiple item.
Definition
array_options.h:35
ARRAY_TOOL::onDialogClosed
void onDialogClosed(wxCloseEvent &aEvent)
Definition
array_tool.cpp:111
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:71
ARRAY_TOOL::Init
bool Init() override
Init() is called once upon a registration of the tool.
Definition
array_tool.cpp:65
ARRAY_TOOL::m_array_opts
std::unique_ptr< ARRAY_OPTIONS > m_array_opts
Definition
array_tool.h:72
ARRAY_TOOL::m_dialog
DIALOG_CREATE_ARRAY * m_dialog
Definition
array_tool.h:71
ARRAY_TOOL::m_selection
std::unique_ptr< PCB_SELECTION > m_selection
Definition
array_tool.h:73
ARRAY_TOOL::ARRAY_TOOL
ARRAY_TOOL()
Definition
array_tool.cpp:49
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:399
ARRAY_TOOL::~ARRAY_TOOL
~ARRAY_TOOL()
Definition
array_tool.cpp:55
BOARD_COMMIT
Definition
board_commit.h:45
DIALOG_CREATE_ARRAY
Definition
dialog_create_array.h:37
PCB_TOOL_BASE::PCB_TOOL_BASE
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition
pcb_tool_base.h:74
TOOL_BASE::RESET_REASON
RESET_REASON
Determine the reason of reset for a tool.
Definition
tool_base.h:74
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 Fri Jun 26 2026 00:05:42 for KiCad PCB EDA Suite by
1.13.2