KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pad_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 <
tools/pcb_tool_base.h
>
25
26
class
ACTION_MENU
;
27
class
PAD
;
28
class
PAD_MASTER_PROVIDER
;
29
class
PCB_SHAPE
;
30
31
32
class
PAD_TOOL
:
public
PCB_TOOL_BASE
33
{
34
public
:
35
PAD_TOOL
();
36
~PAD_TOOL
();
37
39
void
Reset
(
RESET_REASON
aReason )
override
;
40
42
bool
Init
()
override
;
43
47
int
EnumeratePads
(
const
TOOL_EVENT
& aEvent );
48
49
int
PadTable
(
const
TOOL_EVENT
& aEvent );
50
54
int
PlacePad
(
const
TOOL_EVENT
& aEvent );
55
59
int
EditPad
(
const
TOOL_EVENT
& aEvent );
60
61
int
OnUndoRedo
(
const
TOOL_EVENT
& aEvent );
62
63
bool
InPadEditMode
() {
return
m_editPad
!=
niluuid
; }
64
void
ExitPadEditMode
();
65
66
wxString
GetLastPadNumber
()
const
{
return
m_lastPadNumber
; }
67
void
SetLastPadNumber
(
const
wxString& aPadNumber ) {
m_lastPadNumber
= aPadNumber; }
68
72
void
RecordMasterPad
(
const
PAD
& aPad );
73
80
std::vector<PCB_SHAPE*>
RecombinePad
(
PAD
* aPad,
bool
aIsDryRun );
81
82
protected
:
84
void
setTransitions
()
override
;
85
86
private
:
88
int
pastePadProperties
(
const
TOOL_EVENT
& aEvent );
89
91
int
copyPadSettings
(
const
TOOL_EVENT
& aEvent );
92
94
int
pushPadSettings
(
const
TOOL_EVENT
& aEvent );
95
96
void
explodePad
(
PAD
* aPad,
BOARD_COMMIT
& aCommit );
97
98
void
enterPadEditMode
();
99
100
private
:
101
wxString
m_lastPadNumber
;
102
103
HIGH_CONTRAST_MODE
m_previousHighContrastMode
;
104
KIID
m_editPad
;
105
107
std::unique_ptr<PAD_MASTER_PROVIDER>
m_masterPadProvider
;
108
110
std::unique_ptr<PAD>
m_bufferPad
;
111
};
HIGH_CONTRAST_MODE
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
Definition
board_project_settings.h:113
ACTION_MENU
Define the structure of a menu based on ACTIONs.
Definition
action_menu.h:43
BOARD_COMMIT
Definition
board_commit.h:45
KIID
Definition
kiid.h:46
PAD_MASTER_PROVIDER
Definition
pad_tool.cpp:61
PAD_TOOL::RecordMasterPad
void RecordMasterPad(const PAD &aPad)
Record aPad as the template for the next pad of its type placed.
Definition
pad_tool.cpp:386
PAD_TOOL::OnUndoRedo
int OnUndoRedo(const TOOL_EVENT &aEvent)
Definition
pad_tool.cpp:1113
PAD_TOOL::m_previousHighContrastMode
HIGH_CONTRAST_MODE m_previousHighContrastMode
Definition
pad_tool.h:103
PAD_TOOL::~PAD_TOOL
~PAD_TOOL()
Definition
pad_tool.cpp:381
PAD_TOOL::setTransitions
void setTransitions() override
Bind handlers to corresponding TOOL_ACTIONs.
Definition
pad_tool.cpp:1293
PAD_TOOL::EditPad
int EditPad(const TOOL_EVENT &aEvent)
Enter/exit WYSIWYG pad shape editing.
Definition
pad_tool.cpp:1062
PAD_TOOL::ExitPadEditMode
void ExitPadEditMode()
Definition
pad_tool.cpp:1185
PAD_TOOL::m_editPad
KIID m_editPad
Definition
pad_tool.h:104
PAD_TOOL::m_masterPadProvider
std::unique_ptr< PAD_MASTER_PROVIDER > m_masterPadProvider
When pads are created this provides the master pad settings.
Definition
pad_tool.h:107
PAD_TOOL::copyPadSettings
int copyPadSettings(const TOOL_EVENT &aEvent)
Copy pad settings from a pad to the tool's buffer pad.
Definition
pad_tool.cpp:502
PAD_TOOL::enterPadEditMode
void enterPadEditMode()
Definition
pad_tool.cpp:1149
PAD_TOOL::pastePadProperties
int pastePadProperties(const TOOL_EVENT &aEvent)
Apply pad settings from the buffer pad to a pad.
Definition
pad_tool.cpp:476
PAD_TOOL::PlacePad
int PlacePad(const TOOL_EVENT &aEvent)
Place a pad in footprint editor.
Definition
pad_tool.cpp:920
PAD_TOOL::EnumeratePads
int EnumeratePads(const TOOL_EVENT &aEvent)
Tool for quick pad enumeration.
Definition
pad_tool.cpp:657
PAD_TOOL::PAD_TOOL
PAD_TOOL()
Definition
pad_tool.cpp:369
PAD_TOOL::explodePad
void explodePad(PAD *aPad, BOARD_COMMIT &aCommit)
Definition
pad_tool.cpp:1215
PAD_TOOL::m_bufferPad
std::unique_ptr< PAD > m_bufferPad
The "buffer" pad that holds the settings applied by "Paste Pad Properties".
Definition
pad_tool.h:110
PAD_TOOL::PadTable
int PadTable(const TOOL_EVENT &aEvent)
Definition
pad_tool.cpp:1276
PAD_TOOL::Init
bool Init() override
Basic initialization.
Definition
pad_tool.cpp:414
PAD_TOOL::SetLastPadNumber
void SetLastPadNumber(const wxString &aPadNumber)
Definition
pad_tool.h:67
PAD_TOOL::GetLastPadNumber
wxString GetLastPadNumber() const
Definition
pad_tool.h:66
PAD_TOOL::RecombinePad
std::vector< PCB_SHAPE * > RecombinePad(PAD *aPad, bool aIsDryRun)
Recombine an exploded pad (or one produced with overlapping polygons in an older version).
Definition
pad_tool.cpp:1265
PAD_TOOL::InPadEditMode
bool InPadEditMode()
Definition
pad_tool.h:63
PAD_TOOL::m_lastPadNumber
wxString m_lastPadNumber
Definition
pad_tool.h:101
PAD_TOOL::pushPadSettings
int pushPadSettings(const TOOL_EVENT &aEvent)
Push pad settings from a pad to other pads on board or footprint.
Definition
pad_tool.cpp:599
PAD
Definition
pad.h:61
PCB_SHAPE
Definition
pcb_shape.h:35
PCB_TOOL_BASE::PCB_TOOL_BASE
PCB_TOOL_BASE(TOOL_ID aId, const std::string &aName)
Constructor.
Definition
pcb_tool_base.h:75
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
niluuid
KIID niluuid(0)
pcb_tool_base.h
src
pcbnew
tools
pad_tool.h
Generated on Tue Oct 27 2026 00:06:36 for KiCad PCB EDA Suite by
1.13.2